/* Modern IPSW CMS - Main Stylesheet */

:root {
    --primary: #007AFF;
    --primary-dark: #0051D5;
    --secondary: #5856D6;
    --success: #34C759;
    --danger: #FF3B30;
    --warning: #FF9500;
    --dark: #1C1C1E;
    --gray: #8E8E93;
    --light-gray: #F2F2F7;
    --bg: #FFFFFF;
    --text: #000000;
    --text-secondary: #6E6E73;
    --border: #D1D1D6;
    --shadow: rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
}

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

/* Header */
.header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

.logo a:hover {
    transform: scale(1.05);
}

.logo i {
    font-size: 1.8rem;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.main-nav a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary);
    background: var(--light-gray);
}

.mobile-menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    animation: fadeInUp 0.6s ease;
}

.hero-tagline {
    font-size: 1.3rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease 0.1s both;
}

/* Search Box */
.search-box {
    max-width: 600px;
    margin: 2rem auto;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.search-box form {
    display: flex;
    gap: 1rem;
}

.search-input-group {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border-radius: var(--radius);
    padding: 0 1rem;
}

.search-input-group i {
    color: var(--gray);
    margin-right: 0.5rem;
}

.search-input-group input {
    flex: 1;
    border: none;
    outline: none;
    padding: 1rem 0;
    font-size: 1rem;
    color: var(--text);
}

.search-clear {
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
}

.search-clear:hover {
    color: var(--danger);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-download {
    background: var(--success);
    color: white;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.btn-download:hover {
    background: #28a745;
    transform: translateY(-1px);
}

/* Hero Stats */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
    animation: fadeInUp 0.6s ease 0.3s both;
}

.stat {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat i {
    font-size: 2rem;
    opacity: 0.8;
}

.stat strong {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
}

.stat span {
    display: block;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Device Categories */
.device-categories {
    padding: 4rem 0;
}

.device-category {
    margin-bottom: 3rem;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--dark);
}

.category-title i {
    color: var(--primary);
}

.device-count {
    font-size: 1rem;
    color: var(--gray);
    font-weight: 400;
}

/* Device Grid */
.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.device-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
    cursor: pointer;
}

.device-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow);
    border-color: var(--primary);
}

.device-icon {
    width: 60px;
    height: 60px;
    background: var(--light-gray);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary);
}

.device-info {
    flex: 1;
}

.device-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
    color: var(--text);
}

.device-identifier {
    color: var(--gray);
    font-size: 0.9rem;
}

.device-arrow {
    color: var(--gray);
    font-size: 1.2rem;
}

/* Search Results */
.search-results-header {
    margin-bottom: 2rem;
}

.search-results-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.search-results-header p {
    color: var(--gray);
}

.no-results {
    text-align: center;
    padding: 4rem 2rem;
}

.no-results i {
    font-size: 4rem;
    color: var(--gray);
    margin-bottom: 1rem;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.no-results p {
    color: var(--gray);
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 1rem 0;
    margin-bottom: 1rem;
}

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
}

.breadcrumbs li {
    display: flex;
    align-items: center;
}

.breadcrumbs li:not(:last-child)::after {
    content: '/';
    margin-left: 0.5rem;
    color: var(--gray);
}

.breadcrumbs a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

/* Device Header */
.device-header {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin: 2rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.device-header-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.device-header-icon {
    width: 80px;
    height: 80px;
    background: var(--light-gray);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--primary);
}

.device-header-info h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.device-identifier {
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.device-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-item strong {
    display: block;
    font-size: 2rem;
    color: var(--primary);
}

.stat-item span {
    color: var(--gray);
    font-size: 0.9rem;
}

/* Firmware Filters */
.firmware-filters {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    gap: 2rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-group label {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    cursor: pointer;
    background: white;
}

/* Firmware Table */
.table-responsive {
    overflow-x: auto;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.firmware-table {
    width: 100%;
    border-collapse: collapse;
}

.firmware-table th {
    background: var(--light-gray);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border);
}

.firmware-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.firmware-row:hover {
    background: var(--light-gray);
}

.version-cell strong {
    color: var(--primary);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-badge.signed {
    background: #d4edda;
    color: var(--success);
}

.status-badge.unsigned {
    background: #f8d7da;
    color: var(--danger);
}

/* Firmware Info Cards */
.firmware-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.info-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.info-card h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.info-card p {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.info-card.warning {
    background: #fff3cd;
    border-color: var(--warning);
}

.info-card.warning h3 {
    color: var(--warning);
}

/* Footer */
.footer {
    background: var(--dark);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--primary);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.social-links a:hover {
    background: var(--primary);
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.newsletter-form input {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: var(--radius);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

.footer-bottom a {
    color: var(--primary);
}

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

/* Responsive */
@media (max-width: 768px) {
    .main-nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .device-grid {
        grid-template-columns: 1fr;
    }
    
    .device-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .device-stats {
        width: 100%;
        justify-content: space-around;
    }
    
    .firmware-filters {
        flex-direction: column;
    }
    
    .firmware-table {
        font-size: 0.85rem;
    }
    
    .firmware-table td,
    .firmware-table th {
        padding: 0.5rem;
    }
}

/* Admin Styles */
.admin-container {
    max-width: 1400px;
}

.admin-header {
    background: var(--dark);
    color: white;
}

.admin-sidebar {
    width: 250px;
    background: white;
    border-right: 1px solid var(--border);
    height: calc(100vh - 60px);
    position: fixed;
    left: 0;
    top: 60px;
    overflow-y: auto;
}

.admin-sidebar ul {
    list-style: none;
}

.admin-sidebar a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text);
    text-decoration: none;
    transition: var(--transition);
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
    background: var(--light-gray);
    color: var(--primary);
}

.admin-main {
    margin-left: 250px;
    padding: 2rem;
}

.admin-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
}

.admin-card h2 {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: var(--success);
    border: 1px solid var(--success);
}

.alert-danger {
    background: #f8d7da;
    color: var(--danger);
    border: 1px solid var(--danger);
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #0c5460;
}
