/* Base Variables */
:root {
    --bg-dark: #070b14;
    --bg-card: rgba(255, 255, 255, 0.03);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --accent-primary: #3b82f6;
    --accent-secondary: #8b5cf6;
    --apple-gradient: linear-gradient(135deg, #1f2937, #000000);
    --success: #10b981;
    --glass-blur: blur(12px);
}

#models-page {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    padding-bottom: 80px;
}

#models-page h1, #models-page h2, #models-page h3, #models-page h4, #models-page h5, #models-page h6 {
    font-family: 'Outfit', sans-serif;
    margin-bottom: 0;
}

#models-page p { margin-bottom: 0; }

#models-page .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Brand Icons Bar */
.brand-icons-bar {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    backdrop-filter: blur(10px);
    position: sticky;
    top: 70px; /* Below bootstrap header */
    z-index: 90;
}

.brand-icons-scroll {
    display: flex;
    justify-content: center;
    gap: 30px;
    overflow-x: auto;
    scrollbar-width: none;
}

.brand-icons-scroll::-webkit-scrollbar { display: none; }

.brand-icon-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 10px 15px;
    border-radius: 12px;
}

.brand-icon-btn:hover, .brand-icon-btn.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.brand-icon-btn i {
    font-size: 1.5rem;
}

.brand-icon-btn span {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Hero Section */
.hero {
    position: relative;
    padding: 100px 0 80px;
    text-align: center;
    overflow: hidden;
}

.hero-bg-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.shape {
    position: absolute;
    filter: blur(100px);
    border-radius: 50%;
    opacity: 0.4;
    animation: float 10s infinite ease-in-out alternate;
}

.shape-1 { width: 400px; height: 400px; background: var(--accent-primary); top: -100px; left: -100px; }
.shape-2 { width: 300px; height: 300px; background: var(--accent-secondary); bottom: 50px; right: -50px; animation-delay: -5s; }
.shape-3 { width: 200px; height: 200px; background: #ec4899; top: 50%; left: 50%; transform: translate(-50%, -50%); opacity: 0.2; }

@keyframes float {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(20px) scale(1.1); }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.badge {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 24px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    color: #fff;
}

.hero-title span {
    background: linear-gradient(to right, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Models Grid */
.models-section {
    padding: 40px 0 100px;
    position: relative;
    z-index: 1;
}

.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
}

.model-card {
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.model-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.card-status {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-new { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.status-hot { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.status-premium { background: rgba(139, 92, 246, 0.2); color: #c084fc; }

.card-brand {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    margin-top: 10px;
}

.model-name {
    font-size: 1.6rem;
    margin-bottom: 24px;
    color: #fff;
    transition: all 0.3s ease;
}

.model-card:hover .model-name {
    color: var(--accent-primary);
}

.model-design {
    width: 100%;
    max-width: 130px;
    height: 180px;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center bottom !important;
    background-color: transparent !important;
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin: 0 auto 24px auto;
    transition: transform 0.3s ease;
    position: relative;
    filter: drop-shadow(0 15px 15px rgba(0,0,0,0.4));
}

.model-design::after {
    display: none;
}

[data-brand="apple"] .model-design, [data-brand="Apple"] .model-design { background-image: url('assets/img/apple.png'); }
[data-brand="samsung"] .model-design, [data-brand="Samsung"] .model-design { background-image: url('assets/img/samsung.png'); }
[data-brand="oppo"] .model-design, [data-brand="Oppo"] .model-design { background-image: url('assets/img/oppo.png'); }
[data-brand="vivo"] .model-design, [data-brand="Vivo"] .model-design { background-image: url('assets/img/vivo.png'); }
[data-brand="realme"] .model-design, [data-brand="Realme"] .model-design { background-image: url('assets/img/oppo.png'); }
[data-brand="moto"] .model-design, [data-brand="Moto"] .model-design { background-image: url('assets/img/moto.png'); }

.model-card:hover .model-design {
    transform: scale(1.05);
}

.emi-preview {
    font-size: 0.9rem;
    color: #fbbf24;
    margin-bottom: 15px;
    font-weight: 600;
}

.view-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.model-card:hover .view-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-color: transparent;
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
}

/* Custom Modal Design */
.km-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.km-modal-overlay.active { display: flex; }

.km-modal-content {
    background: #0f172a;
    width: 100%;
    max-width: 900px;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 90vh;
    position: relative;
    display: flex;
    flex-wrap: wrap;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s ease;
}

.km-modal-overlay.active .km-modal-content {
    transform: translateY(0);
    opacity: 1;
}

.km-modal-close {
    position: absolute;
    top: 20px; right: 20px;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.3s ease;
}

.km-modal-close:hover { background: rgba(239, 68, 68, 0.8); }

/* Modal Carousel */
.km-modal-carousel {
    flex: 1 1 400px;
    background: linear-gradient(135deg, #1e293b, #000);
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.carousel-main-img {
    width: 200px;
    height: 400px;
    background: transparent;
    border-radius: 30px;
    border: 4px solid #334155;
    margin-bottom: 20px;
    position: relative;
    box-shadow: inset 0 0 20px rgba(255,255,255,0.05);
}

.carousel-main-img::after {
    content: '';
    position: absolute;
    top: 15px; left: 15px;
    width: 50px; height: 50px;
    background: transparent;
    border-radius: 12px;
}

.carousel-thumbs {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.thumb-img {
    width: 50px; height: 50px;
    border-radius: 8px;
    background: transparent;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border 0.3s;
}

.thumb-img.active { border-color: var(--accent-primary); }

/* Modal Specs */
.km-modal-info {
    flex: 1 1 400px;
    padding: 40px;
    display: flex;
    flex-direction: column;
}

.modal-brand {
    font-size: 0.9rem;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    margin-bottom: 5px;
}

.modal-title {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 10px;
    line-height: 1.1;
}

.modal-status {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 25px;
}

.specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255,255,255,0.03);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
}

.spec-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}

.spec-details { display: flex; flex-direction: column; }

.spec-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.spec-value {
    font-size: 0.9rem;
    color: #fff;
    font-weight: 600;
}

.emi-highlight {
    background: linear-gradient(135deg, rgba(200, 169, 74, 0.1), rgba(232, 201, 106, 0.1));
    border: 1px solid rgba(200, 169, 74, 0.3);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.emi-text p {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.emi-text h3 {
    color: #fbbf24;
    font-size: 2rem;
    font-weight: 700;
}

.buy-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
    transition: transform 0.3s;
}

.buy-btn:hover { transform: translateY(-3px); }

/* Mobile Responsiveness */
@media (max-width: 768px) {
    /* Brand Icons Bar Fixes */
    .brand-icons-scroll {
        justify-content: flex-start; /* Fixes brand names being cut off on mobile */
        padding: 0 15px;
        gap: 20px;
    }

    .brand-icon-btn i {
        font-size: 1.2rem;
    }

    .brand-icon-btn span {
        font-size: 0.7rem;
    }

    /* Hero Section Fixes */
    .hero {
        padding: 80px 0 60px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    /* Models Grid 2x2 */
    .models-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .model-card {
        padding: 12px;
        border-radius: 12px;
    }

    .card-status {
        font-size: 0.6rem;
        padding: 3px 8px;
        top: 10px;
        right: 10px;
    }

    .card-brand {
        font-size: 0.7rem;
        letter-spacing: 1px;
        margin-top: 5px;
        margin-bottom: 5px;
    }

    .model-name {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }

    .model-design {
        width: 100px;
        height: 160px;
        border: none;
        border-radius: 0;
        margin-bottom: 15px;
    }

    .model-design::after {
        display: none;
    }

    .emi-preview {
        font-size: 0.7rem;
        margin-bottom: 10px;
    }

    .view-btn {
        padding: 8px;
        font-size: 0.8rem;
        border-radius: 6px;
    }

    /* Modal Fixes for Mobile */
    .specs-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .modal-title {
        font-size: 1.8rem;
    }

    .km-modal-carousel {
        padding: 20px;
    }

    .carousel-main-img {
        width: 150px;
        height: 280px;
        margin-bottom: 15px;
    }

    .carousel-thumbs {
        flex-wrap: wrap;
    }

    .thumb-img {
        width: 40px;
        height: 40px;
    }

    .km-modal-info {
        padding: 20px;
    }
}
