/* Reset y variables CSS */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-bg: #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;
    --gray-900: #0f172a;
    --border-radius: 8px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --transition: all 0.3s ease;
}

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

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

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

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 1.5rem 0;
    box-shadow: var(--shadow-lg);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.nav-tabs {
    display: flex;
    gap: 0.5rem;
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img {
    height: 32px;
    width: auto;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.logo-img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Asegurar que el logo mantenga proporciones */
.logo-img {
    object-fit: contain;
    max-width: 100%;
}

/* Mejorar la alineación del logo con el texto */
.logo {
    align-items: center;
    justify-content: flex-start;
}

@media (max-width: 768px) {
    .logo {
        justify-content: center;
    }
}

.nav-tab {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-tab:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.nav-tab.active {
    background: var(--white);
    color: var(--primary-color);
    border-color: var(--white);
}

/* Main Content */
.main {
    padding: 2rem 0;
    min-height: calc(100vh - 120px);
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* Search and Filters */
.search-filters {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-bar {
    position: relative;
    flex: 1;
    min-width: 300px;
}

.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-group select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: var(--white);
    cursor: pointer;
    transition: var(--transition);
    min-width: 200px;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Results Info */
.results-info {
    margin-bottom: 1rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* Table */
.table-container {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

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

.data-table th {
    background: var(--gray-50);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: top;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.course-title {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.platform-name, .category-name {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.category-name {
    background: var(--success-color);
}

.author-name {
    color: var(--gray-600);
    font-style: italic;
}

.course-description {
    color: var(--gray-600);
    font-size: 0.9rem;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination button {
    padding: 0.5rem 1rem;
    border: 2px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-600);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.pagination button:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination button.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .page-info {
    margin: 0 1rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.loading-spinner i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.loading-spinner p {
    color: var(--gray-600);
    font-weight: 500;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-500);
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        text-align: center;
    }

    .nav-tabs {
        width: 100%;
        justify-content: center;
    }

    .nav-tab {
        flex: 1;
        justify-content: center;
    }

    .search-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .search-bar {
        min-width: auto;
    }

    .filter-group select {
        min-width: auto;
        width: 100%;
    }

    .table-container {
        overflow-x: auto;
    }

    .data-table {
        min-width: 600px;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .course-description {
        max-width: 200px;
    }

    /* Logo responsivo para tablets */
    .logo {
        font-size: 1.5rem;
    }

    .logo-img {
        height: 28px;
    }
}

/* Breakpoint para pantallas medianas (tablets pequeñas) */
@media (max-width: 640px) {
    .logo {
        font-size: 1.4rem;
        gap: 0.5rem;
    }

    .logo-img {
        height: 26px;
    }

    .nav-tab {
        padding: 0.6rem 1rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }

    .main {
        padding: 1rem 0;
    }

    .search-filters {
        padding: 1rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
    }

    .logo {
        font-size: 1.25rem;
        gap: 0.4rem;
    }

    .logo-img {
        height: 24px;
    }

    .nav-tab {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* Breakpoint para móviles muy pequeños */
@media (max-width: 360px) {
    .logo {
        font-size: 1.1rem;
        gap: 0.3rem;
    }

    .logo-img {
        height: 22px;
    }

    .nav-tab {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        gap: 0.3rem;
    }

    .nav-tab i {
        font-size: 0.9rem;
    }

    .header {
        padding: 1rem 0;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-section.active {
    animation: fadeIn 0.3s ease-out;
}

.data-table tbody tr {
    animation: fadeIn 0.3s ease-out;
}

/* Mejoras de accesibilidad */
.nav-tab:focus,
.search-bar input:focus,
.filter-group select:focus,
.pagination button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Estados de hover mejorados */
.data-table tbody tr:hover .course-title {
    color: var(--primary-color);
}

.platform-name:hover,
.category-name:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}