/**
 * Main Stylesheet - Dark Theme
 * GSMArena-style mobile specification website
 */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #999999;
    --accent: #4a9eff;
    --accent-hover: #3a8eef;
    --border: #333333;
    --border-light: #444444;
    --success: #28a745;
    --danger: #d32f2f;
    --warning: #ff9800;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Header */
.site-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 24px;
    color: var(--accent);
    font-weight: 700;
}

.logo {
    text-decoration: none;
}

.main-nav {
    display: flex;
    gap: 25px;
    align-items: center;
}

.main-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: var(--accent);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    transition: all 0.3s;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 40px 0;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    padding: 60px 0;
    text-align: center;
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

/* Search */
.search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-form input {
    flex: 1;
    padding: 15px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 16px;
}

.search-form input:focus {
    outline: none;
    border-color: var(--accent);
}

.search-btn {
    padding: 15px 30px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.search-btn:hover {
    background: var(--accent-hover);
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-top: 5px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}

.search-suggestions.active {
    display: block;
}

.suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.suggestion-item:hover {
    background: var(--bg-tertiary);
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* Sections */
.section {
    margin: 60px 0;
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--text-primary);
}

.page-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--text-primary);
}

/* Grids */
.phones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

/* Cards */
.phone-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.phone-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(74, 158, 255, 0.2);
    border-color: var(--accent);
}

.phone-image {
    width: 100%;
    height: 200px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.phone-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.phone-info {
    padding: 20px;
}

.phone-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.phone-brand {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 5px;
}

.phone-price {
    color: var(--accent);
    font-weight: 600;
    font-size: 16px;
    margin-top: 10px;
}

.phone-date {
    color: var(--text-muted);
    font-size: 14px;
}

.brand-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 30px 20px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: inherit;
}

.brand-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(74, 158, 255, 0.2);
    border-color: var(--accent);
}

.brand-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.brand-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.brand-count {
    color: var(--text-muted);
    font-size: 14px;
}

/* Phone Detail Page */
.breadcrumb {
    margin-bottom: 30px;
    color: var(--text-secondary);
    font-size: 14px;
}

.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    margin: 0 10px;
    color: var(--text-muted);
}

.phone-header {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    margin-bottom: 50px;
    padding: 30px;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.phone-header-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 20px;
}

.phone-header-image img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.phone-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.phone-brand-link a {
    color: var(--accent);
    text-decoration: none;
    font-size: 18px;
}

.phone-brand-link a:hover {
    text-decoration: underline;
}

.phone-release {
    color: var(--text-secondary);
    margin: 10px 0;
}

.phone-price-large {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
    margin: 15px 0;
}

.phone-actions {
    margin-top: 25px;
}

/* Specifications */
.specs-section {
    margin: 50px 0;
}

.spec-category {
    margin-bottom: 40px;
}

.spec-category-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--accent);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.specs-table tbody tr {
    border-bottom: 1px solid var(--border);
}

.specs-table tbody tr:last-child {
    border-bottom: none;
}

.spec-key {
    padding: 15px 20px;
    font-weight: 600;
    color: var(--text-secondary);
    width: 30%;
    background: var(--bg-tertiary);
}

.spec-value {
    padding: 15px 20px;
    color: var(--text-primary);
}

/* Compare Page */
.compare-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.compare-count {
    color: var(--text-secondary);
}

.compare-table-wrapper {
    overflow-x: auto;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.compare-table thead {
    background: var(--bg-tertiary);
}

.compare-header {
    padding: 20px;
    font-weight: 600;
    text-align: left;
    border-right: 1px solid var(--border);
}

.compare-phone-header {
    padding: 20px;
    text-align: center;
    border-right: 1px solid var(--border);
}

.compare-phone-header:last-child {
    border-right: none;
}

.compare-phone-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.compare-phone-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

.compare-phone-info h3 {
    font-size: 16px;
    font-weight: 600;
}

.compare-phone-info p {
    font-size: 14px;
    color: var(--text-secondary);
}

.category-row {
    background: var(--bg-tertiary);
}

.category-header {
    padding: 15px 20px;
    font-weight: 600;
    font-size: 18px;
    color: var(--accent);
}

.compare-table tbody tr {
    border-bottom: 1px solid var(--border);
}

.compare-table tbody tr:last-child {
    border-bottom: none;
}

.compare-table tbody td {
    padding: 15px 20px;
    border-right: 1px solid var(--border);
}

.compare-table tbody td:last-child {
    border-right: none;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    font-size: 14px;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--accent);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #c62828;
}

.btn-remove {
    background: var(--danger);
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-remove:hover {
    background: #c62828;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 10px 15px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s;
}

.pagination-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
}

.pagination-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.pagination-ellipsis {
    padding: 10px 5px;
    color: var(--text-muted);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state p {
    margin-bottom: 15px;
    font-size: 18px;
}

/* Footer */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 15px;
    color: var(--accent);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: var(--accent);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

/* Brand Header */
.brand-header {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
    padding: 30px;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.brand-logo-large {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 20px;
}

.brand-logo-large img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.brand-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
}

.brand-count {
    color: var(--text-secondary);
    font-size: 18px;
}

/* Search Results */
.search-results-count {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .main-nav {
        display: none;
    }

    .hero-title {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .phone-header {
        grid-template-columns: 1fr;
    }

    .phones-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .brands-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 15px;
    }

    .compare-table-wrapper {
        overflow-x: scroll;
    }

    .compare-table {
        min-width: 600px;
    }
}

