/* Custom Font */
@font-face {
    font-family: 'Porsche';
    src: url('assets/Porsche Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Edington';
    src: url('assets/eightgon-font/Eightgon-OGn6p.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Edington';
    src: url('assets/eightgon-font/EightgonItalic-Zpw6z.ttf') format('truetype');
    font-weight: normal;
    font-style: italic;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Edington', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    overflow: hidden;
    color: white;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

.loader {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader p {
    font-family: 'Edington', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 18px;
    color: white;
}

/* Main Container */
#main-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
}

/* Canvas */
#three-canvas {
    flex: 1;
    display: block;
    background: transparent;
}

/* Sidebar */
#sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 350px;
    height: 100vh;
    background: rgba(0, 0, 0, 0.0);
    padding: 20px;
    z-index: 100;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.logo {
    height: 152px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 50px;
}

.text-logo {
    max-width: 200px;
    height: auto;
}

/* Menu */
.menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 6px 0px 6px 55px;
    background: transparent;
    border: none;
    color: white;
    font-family: 'Edington', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    cursor: pointer;
    transition: font-size 0.3s ease;
    text-align: left;
    position: relative;
}

.menu-item:hover {
    opacity: 0.8;
}

.menu-item.active {
    font-size: 26px;
}

.menu-text {
    font-family: 'Edington', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

.menu-item:hover .menu-text::after,
.menu-item.active .menu-text::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #73add8;
    border-radius: 1px;
    animation: underlineSlide 0.4s ease-out;
}

#carmodel {
    font-size: 30px !important;
}

#carmodel.active {
    font-size: 40px !important;
}

@keyframes underlineSlide {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

/* Info Panel */
.info-panel {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    width: 350px;
    background: transparent;
    backdrop-filter: none;
    border-radius: 0;
    padding: 0;
    border: none;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
}

/* NEW SIMPLE POSITIONING SYSTEM - Uses CSS custom properties */
.info-panel.custom-positioned {
    position: fixed !important;
    left: var(--panel-x, 75%) !important;
    top: var(--panel-y, 50%) !important;
    right: auto !important;
    transform: translate(-50%, -50%) !important;
    width: var(--panel-width, 350px) !important;
    text-align: var(--text-align, left) !important;
    /* This centers the panel on the specified coordinates */
}

/* Apply text alignment to content within custom positioned panels */
.info-panel.custom-positioned .info-content h2,
.info-panel.custom-positioned .info-content p {
    text-align: inherit;
}

.info-panel.show {
    opacity: 1;
    visibility: visible;
}

.info-panel.left {
    right: auto;
    left: 320px;
}

/* Info content container - no background, just spacing */
.info-content {
    padding: 0;
}

.info-content h2 {
    font-family: 'Edington', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 32px;
    margin-bottom: 15px;
    color: #73add8;
    font-weight: 600;
    /* Background only behind the title text */
    background: rgba(0, 0, 0, 0.0);
    backdrop-filter: blur(5px);
    border-radius: 8px;
    padding: 8px 12px;
    display: inline-block;
    margin-bottom: 20px;
}

.info-content p {
    font-family: 'Edington', 'Segington', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 20px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    /* Background only behind the paragraph text */
    background: rgba(0, 0, 0, 0.0);
    backdrop-filter: blur(5px);
    border-radius: 8px;
    padding: 12px 16px;
    display: inline-block;
    margin: 0;
}

/* Controls Info */
#controls-info {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 12px 24px;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 50;
}

#controls-info p {
    font-family: 'Edington', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.1);
    margin: 0;
}

/* Blue Logo */
#blue-logo {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
    width: 120px;
    height: 120px;
}

.blue-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0.8;
    transition: opacity 0.3s ease;
    display: block;
}

.blue-logo:hover {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    #sidebar {
        width: 100%;
        height: auto;
        position: fixed;
        bottom: 0;
        top: auto;
        padding: 15px;
        transform: translateY(calc(100% - 80px));
    }
    
    #sidebar:hover,
    #sidebar.active {
        transform: translateY(0);
    }
    
    .logo {
        margin-bottom: 20px;
    }
    
    .text-logo {
        max-width: 120px;
    }
    
    #blue-logo {
        top: 15px;
        right: 15px;
    }
    
    .blue-logo {
        max-width: 60px;
    }
    
    .menu {
        flex-direction: row;
        overflow-x: auto;
        gap: 10px;
        padding-bottom: 10px;
    }
    
    .menu-item {
        min-width: 120px;
        padding: 12px 16px;
        flex-shrink: 0;
        font-size: 14px;
    }
    
    .menu-item.active {
        font-size: 20px;
    }
    
    .info-panel {
        right: 20px;
        left: 20px;
        width: auto;
        bottom: 120px;
        top: auto;
        transform: none;
    }
    
    .info-panel.left {
        left: 20px;
        right: 20px;
    }
    
    #controls-info {
        display: none;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.fade-in-left {
    animation: fadeInLeft 0.6s ease forwards;
}

.fade-in-right {
    animation: fadeInRight 0.6s ease forwards;
}

/* Hidden class */
.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
}
