/* ===== CSS Variables ===== */
:root {
    --primary: #3EA3F2;
    --primary-dark: #3EA3F2;
    --secondary: #64748b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1e293b;
    --light: #f8fafc;
    --white: #ffffff;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-lg: 12px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
}

/* ===== Header ===== */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

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

.nav {
    display: flex;
    gap: 5px;
    align-items: center;

}

.nav-link {
    padding: 10px 16px;
    border-radius: var(--radius);
    color: var(--gray-600);
    font-weight: 100;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    background: var(--primary);
    color: var(--white);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-600);
    cursor: pointer;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    padding: 20px;
    flex-direction: column;
    gap: 10px;
    z-index: 99;
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu a {
    padding: 12px 16px;
    border-radius: var(--radius);
    color: var(--gray-700);
    font-weight: 500;
}

.mobile-menu a:hover {
    background: var(--gray-100);
}

/* ===== Hero ===== */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 20px 0;
    text-align: center;
    color: var(--white);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 30px;
}

.search-box {
    max-width: 500px;
    margin: 0 auto;
}

.search-box form {
    display: flex;
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.search-box input {
    flex: 1;
    padding: 16px 20px;
    border: none;
    font-size: 1rem;
    outline: none;
}

.search-box button {
    padding: 16px 24px;
    background: var(--primary);
    border: none;
    color: var(--white);
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.search-box button:hover {
    background: var(--primary-dark);
}

/* ===== Page Header ===== */
.page-header {
    background: var(--primary);
    padding: 20px 0;
    color: var(--white);
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.page-header h1 i {
    margin-right: 10px;
}

.page-header p {
    opacity: 0.9;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    opacity: 0.9;
}

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

.breadcrumb i {
    font-size: 0.7rem;
}

/* ===== Section ===== */
.section-title {
    font-size: 1.75rem;
    margin-bottom: 30px;
    color: var(--gray-800);
}

.categories-section,
.recent-section {
    padding: 60px 0;
}

.recent-section {
    background: var(--white);
}

/* ===== Categories Grid ===== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 15px;
}

.category-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 10px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.category-icon {
    width: 70px;
    height: 70px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
}

.category-icon i {
    font-size: 2rem;
    color: var(--primary);
}

.category-card h3 {
    font-size: 1.25rem;
    margin-bottom: 20px;
    color: var(--gray-800);
}

.category-card p {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.file-count {
    display: inline-block;
    background: var(--gray-100);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--gray-600);
}

/* ===== Files Grid ===== */
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.file-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.file-card .file-icon {
    width: 60px;
    height: 60px;
    background: var(--gray-100);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-card .file-icon i {
    font-size: 1.75rem;
    color: var(--primary);
}

.file-card .file-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.file-card .file-info h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--gray-800);
}

.file-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--gray-500);
}

.file-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.version {
    display: inline-block;
    background: var(--gray-100);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--gray-600);
}

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--primary);
    color: var(--white);
    padding: 12px 20px;
    border-radius: var(--radius);
    font-weight: 500;
    transition: background 0.2s;
    margin-top: auto;
}

.download-btn:hover {
    background: var(--primary-dark);
}

/* ===== Content Layout ===== */
.main-content {
    padding: 40px 0;
}

.content-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 24px;
}

.content-area {
    min-width: 0;
    overflow: hidden;
}

/* ===== Sidebar ===== */
.sidebar-widget {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

.sidebar-widget h3 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-800);
}

.category-list {
    list-style: none;
}

.category-list li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius);
    color: var(--gray-600);
    transition: all 0.2s;
}

.category-list li a:hover,
.category-list li.active a {
    background: var(--primary);
    color: var(--white);
}

.category-list .count {
    margin-left: auto;
    background: rgba(0,0,0,0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
}

/* ===== Files Row Grid (2 columns side by side) ===== */
.files-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    width: 100%;
}

.file-row-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.2s ease;
    border: 1px solid var(--gray-200);
    min-width: 0;
}

.file-row-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.file-row-icon {
    width: 50px;
    height: 50px;
    background: var(--gray-100);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-row-icon i {
    font-size: 1.3rem;
    color: var(--primary);
}

.file-row-icon img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.file-row-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.file-row-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.file-row-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.file-row-meta i {
    color: var(--gray-400);
    font-size: 0.75rem;
}

.file-row-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    color: var(--white);
    padding: 10px 16px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.85rem;
    transition: background 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.file-row-btn:hover {
    background: var(--primary-dark);
}

/* ===== Files List ===== */
.files-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ===== Files Grid 2 Columns ===== */
.files-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.file-card-item {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.file-card-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.file-card-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.file-card-header .file-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-card-header .file-icon i {
    font-size: 1.5rem;
    color: var(--primary);
}

.file-card-header .file-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.file-title-wrap {
    flex: 1;
    min-width: 0;
}

.file-title-wrap h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 5px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.version-tag {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.file-description {
    color: var(--gray-500);
    font-size: 0.85rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.file-card-item .file-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--gray-500);
    padding-top: 10px;
    border-top: 1px solid var(--gray-200);
}

.file-card-item .file-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.file-card-item .file-meta i {
    color: var(--gray-400);
}

.file-card-item .download-btn {
    margin-top: auto;
    width: 100%;
    text-align: center;
}

.file-item {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
}

.file-item .file-icon {
    width: 64px;
    height: 64px;
    background: var(--gray-100);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-item .file-icon i {
    font-size: 1.75rem;
    color: var(--primary);
}

.file-item .file-icon img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.file-item .file-details {
    flex: 1;
    min-width: 0;
}

.file-item .file-details h3 {
    font-size: 1.1rem;
    margin-bottom: 6px;
    color: var(--gray-800);
}

.file-item .file-details p {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border-radius: var(--radius-lg);
}

.empty-state i {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: 20px;
}

.empty-state h3 {
    color: var(--gray-600);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--gray-500);
}

/* ===== Page Content ===== */
.page-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow);
}

.page-content h2 {
    margin-bottom: 20px;
    color: var(--gray-800);
}

.page-content p {
    margin-bottom: 15px;
    color: var(--gray-600);
}

/* ===== Results Count ===== */
.results-count {
    margin-bottom: 20px;
    color: var(--gray-600);
}

/* ===== View All ===== */
.view-all {
    text-align: center;
    margin-top: 40px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

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

/* ===== Footer ===== */
.footer {
    background: var(--gray-800);
    padding: 40px 0;
    color: var(--gray-300);
    text-align: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 15px;
}

.footer-logo i {
    font-size: 1.5rem;
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .files-row-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .content-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: -1;
    }
    
    .files-row-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .file-item {
        flex-direction: column;
        text-align: center;
    }
    
    .file-meta {
        justify-content: center;
    }
    
    .files-grid-2col {
        grid-template-columns: 1fr;
    }
    
    .files-row-grid {
        grid-template-columns: 1fr;
    }
    
    .file-row-card {
        flex-wrap: wrap;
    }
    
    .file-row-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .categories-grid,
    .files-grid {
        grid-template-columns: 1fr;
    }
}
