/**
 * TechSpecs - Modern Frontend Styles
 */

:root {
    /* Colors */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #0ea5e9;
    --accent: #f43f5e;

    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;

    --text-white: #ffffff;
    --text-light: #cbd5e1;
    --text-muted: #64748b;
    --text-dark: #1e293b;

    --border: rgba(255, 255, 255, 0.1);
    --border-light: #e2e8f0;

    --gradient-hero: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.header {
    background: var(--bg-dark);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header .container {
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.1);
}

.search-form {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.search-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid transparent;
    padding: 10px 16px;
    border-radius: var(--radius-lg);
    color: var(--text-white);
    font-size: 0.875rem;
    width: 220px;
    transition: all 0.2s;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary);
    width: 280px;
}

.search-btn {
    background: var(--primary);
    border: none;
    padding: 10px 16px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s;
}

.search-btn:hover {
    background: var(--primary-dark);
}

/* Hero */
.hero {
    background: var(--gradient-hero);
    padding: 80px 0 100px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-white);
    line-height: 1.2;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 40px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-bottom: 40px;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-light);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-search {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    gap: 0;
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.hero-search-input {
    flex: 1;
    border: none;
    padding: 18px 24px;
    font-size: 1rem;
    outline: none;
}

.hero-search-btn {
    background: var(--gradient-primary);
    color: var(--text-white);
    border: none;
    padding: 18px 32px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.hero-search-btn:hover {
    opacity: 0.9;
}

/* Sections */
.section {
    padding: 60px 0;
}

.section-featured {
    background: linear-gradient(180deg, var(--bg-light) 0%, #e0e7ff 100%);
}

.section-dark {
    background: var(--bg-dark);
}

.section-dark .section-header h2 {
    color: var(--text-white);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.section-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
}

.see-all {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.see-all:hover {
    color: var(--primary-dark);
}

/* Brands Grid */
.brands-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

.brand-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 24px 16px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
    border: 1px solid var(--border-light);
}

.brand-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    margin: 0 auto 12px;
    background: var(--gradient-primary);
    color: var(--text-white);
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: var(--radius-md);
}

.brand-name {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
}

.brand-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Phones Grid */
.phones-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.phones-grid-featured {
    grid-template-columns: repeat(3, 1fr);
}

.phone-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
    border: 1px solid var(--border-light);
}

.phone-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.phone-card-featured {
    background: linear-gradient(145deg, #fff 0%, #f0f4ff 100%);
}

.phone-image {
    position: relative;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%);
    overflow: hidden;
}

.phone-card-featured .phone-image {
    height: 240px;
}

.phone-image img {
    max-height: 90%;
    max-width: 90%;
    object-fit: contain;
    transition: transform 0.3s;
}

.phone-card:hover .phone-image img {
    transform: scale(1.05);
}

.phone-placeholder {
    font-size: 4rem;
    opacity: 0.3;
}

.phone-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--gradient-primary);
    color: var(--text-white);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
}

.phone-info {
    padding: 16px 20px 20px;
}

.phone-brand {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.phone-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 4px 0 10px;
    line-height: 1.3;
}

.phone-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.phone-specs .spec {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-light);
    padding: 4px 8px;
    border-radius: 4px;
}

.phone-price {
    margin-top: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

/* Phones List (Popular) */
.phones-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.phone-list-item {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--bg-card);
    padding: 20px 24px;
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-white);
    transition: all 0.3s;
    border: 1px solid var(--border);
}

.phone-list-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(8px);
}

.phone-rank {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-light);
    width: 50px;
    text-align: center;
}

.phone-image-sm {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.phone-image-sm img {
    max-width: 50px;
    max-height: 50px;
    object-fit: contain;
}

.phone-placeholder-sm {
    font-size: 1.5rem;
    opacity: 0.5;
}

.phone-details {
    flex: 1;
}

.phone-details h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.phone-list-item .phone-specs {
    gap: 12px;
}

.phone-list-item .phone-specs span {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.phone-views {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Footer */
.footer {
    background: var(--bg-dark);
    color: var(--text-light);
    padding: 60px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand .logo {
    margin-bottom: 16px;
    display: inline-block;
}

.footer-brand p {
    color: var(--text-muted);
    max-width: 300px;
}

.footer-links h4 {
    color: var(--text-white);
    font-weight: 600;
    margin-bottom: 16px;
}

.footer-links a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    padding: 6px 0;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--text-white);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .brands-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .phones-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .phones-grid-featured {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-wrap: wrap;
    }

    .nav {
        order: 3;
        width: 100%;
        margin-top: 16px;
        justify-content: center;
    }

    .search-form {
        order: 2;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-stats {
        gap: 30px;
    }

    .stat-number {
        font-size: 2rem;
    }

    .brands-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand p {
        max-width: none;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero-search {
        flex-direction: column;
        border-radius: var(--radius-md);
    }

    .hero-search-btn {
        border-radius: 0;
    }

    .brands-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .phones-grid {
        grid-template-columns: 1fr;
    }

    .phone-list-item {
        flex-wrap: wrap;
    }
}

/* ==========================================
   PHONE DETAIL PAGE
   ========================================== */

.phone-hero {
    background: var(--gradient-hero);
    padding: 40px 0 60px;
}

.phone-hero-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 60px;
    align-items: center;
}

.phone-hero-image {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-xl);
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.phone-hero-image img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.phone-hero-info h1 {
    font-size: 2.5rem;
    color: var(--text-white);
    margin-bottom: 12px;
}

.phone-hero-brand {
    color: var(--primary-light);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.phone-hero-description {
    color: var(--text-light);
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 30px;
}

.phone-hero-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.highlight {
    background: rgba(255, 255, 255, 0.1);
    padding: 16px 24px;
    border-radius: var(--radius-md);
    text-align: center;
    min-width: 120px;
}

.highlight-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-white);
}

.highlight-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Specs Section */
.specs-section {
    padding: 40px 0;
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.specs-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.specs-card-header {
    background: var(--bg-light);
    padding: 16px 24px;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-light);
}

.specs-card-body {
    padding: 0;
}

.spec-row {
    display: flex;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border-light);
}

.spec-row:last-child {
    border-bottom: none;
}

.spec-label {
    flex: 0 0 40%;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.spec-value {
    flex: 1;
    font-weight: 500;
}

.score-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.score-bar-track {
    flex: 1;
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width 0.5s;
}

.score-value {
    font-weight: 700;
    min-width: 40px;
    text-align: right;
}

/* ==========================================
   ADDITIONAL PAGES
   ========================================== */

/* Page Header */
.page-header {
    background: var(--gradient-hero);
    padding: 60px 0;
    text-align: center;
}

.page-header h1 {
    font-size: 2.5rem;
    color: var(--text-white);
    margin-bottom: 12px;
}

.page-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Brand Hero */
.brand-hero {
    background: var(--gradient-hero);
    padding: 40px 0;
}

.brand-hero-content {
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand-hero-logo {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    color: var(--text-white);
    font-size: 2rem;
    font-weight: 700;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-hero-info h1 {
    font-size: 2rem;
    color: var(--text-white);
    margin-bottom: 4px;
}

.brand-hero-info p {
    color: var(--text-muted);
}

/* Brands Full Grid */
.brands-grid-full {
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.brand-card-large {
    padding: 32px 24px;
}

.brand-card-large .brand-logo {
    width: 80px;
    height: 80px;
    font-size: 2rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
}

.pagination-btn {
    background: var(--primary);
    color: var(--text-white);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.pagination-btn:hover {
    background: var(--primary-dark);
}

.pagination-info {
    color: var(--text-muted);
}

/* New Badge */
.phone-badge-new {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    left: 12px;
    right: auto;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

/* Button */
.btn {
    display: inline-block;
    background: var(--gradient-primary);
    color: var(--text-white);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Responsive for new elements */
@media (max-width: 768px) {
    .brand-hero-content {
        flex-direction: column;
        text-align: center;
    }

    .brands-grid-full {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .phone-hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .phone-hero-image {
        max-width: 300px;
        margin: 0 auto;
    }

    .specs-grid {
        grid-template-columns: 1fr;
    }
}