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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #06b6d4;
    --dark: #0f172a;
    --dark-light: #1e293b;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --light-gray: #f1f5f9;
    --white: #ffffff;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--light-gray);
    color: var(--dark);
    line-height: 1.6;
}

/* Navbar Styles */
.navbar {
    background: var(--white);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    color: var(--primary);
    font-size: 1.8rem;
}

.logo span {
    color: var(--primary);
}

.logo .highlight {
    color: var(--secondary);
}

.search-bar {
    flex: 1;
    max-width: 400px;
    position: relative;
}

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

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

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

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--primary);
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    min-width: 220px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 100;
    margin-top: 0.5rem;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--dark);
    transition: background 0.3s;
    font-size: 0.9rem;
}

.dropdown-menu a:hover {
    background: var(--light-gray);
}

.btn-login, .btn-register {
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

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

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

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

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

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

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    padding: 5rem 2rem;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 4rem;
    margin-top: 2rem;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    display: block;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Sections */
.categories-section,
.magazines-section,
.popular-section {
    padding: 4rem 0;
}

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

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.section-header p {
    color: var(--gray);
    font-size: 1.1rem;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: var(--white);
    padding: 2rem 1.5rem;
    border-radius: 16px;
    text-align: center;
    text-decoration: none;
    color: var(--dark);
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.category-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.category-card p {
    font-size: 0.85rem;
    color: var(--gray);
}

/* Magazines Grid */
.magazines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.magazine-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.magazine-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.magazine-cover {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: var(--light-gray);
}

.magazine-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.magazine-card:hover .magazine-cover img {
    transform: scale(1.05);
}

.magazine-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.magazine-card:hover .magazine-overlay {
    opacity: 1;
}

.btn-read {
    background: var(--primary);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s;
}

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

.magazine-info {
    padding: 1rem;
}

.magazine-category {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.magazine-info h3 {
    font-size: 1rem;
    margin: 0.5rem 0;
    line-height: 1.4;
}

.magazine-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--gray);
}

.magazine-meta i {
    margin-right: 0.25rem;
}

/* Popular Section */
.popular-grid {
    max-width: 800px;
    margin: 0 auto;
}

.popular-item {
    background: var(--white);
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.popular-item:hover {
    transform: translateX(10px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.rank {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    width: 60px;
}

.popular-content {
    flex: 1;
}

.popular-content h3 {
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.popular-content p {
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.btn-small {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 0.4rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.3s;
}

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

.popular-stats {
    margin-left: 1rem;
    color: var(--gray);
    font-size: 0.9rem;
}

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

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

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

.footer-section h3 i {
    color: var(--primary);
    margin-right: 0.5rem;
}

.footer-section p {
    color: var(--gray-light);
    line-height: 1.6;
}

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

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

.footer-section a {
    color: var(--gray-light);
    text-decoration: none;
    transition: color 0.3s;
}

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

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

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transition: all 0.3s;
}

.social-links a:hover {
    background: var(--primary);
    transform: translateY(-2px);
}

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

/* Responsive */
@media (max-width: 968px) {
    .nav-container {
        flex-wrap: wrap;
    }
    
    .search-bar {
        order: 3;
        margin: 1rem 0 0;
        max-width: 100%;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        gap: 1rem;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .dropdown-menu {
        position: static;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        display: none;
        margin-top: 0;
        padding-left: 1rem;
    }
    
    .dropdown:hover .dropdown-menu {
        display: block;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 1rem;
    }
    
    .magazines-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }
    
    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 3rem 1rem;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
    }
    
    .categories-section,
    .magazines-section,
    .popular-section {
        padding: 2rem 0;
    }
    
    .popular-item {
        flex-direction: column;
        text-align: center;
    }
    
    .rank {
        margin-bottom: 0.5rem;
    }
    
    .popular-stats {
        margin-top: 0.5rem;
    }
}

/* Estilos para el formulario de búsqueda */
.search-form {
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-input-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    z-index: 1;
    pointer-events: none;
}

.search-input-wrapper input {
    width: 100%;
    padding: 0.75rem 4rem 0.75rem 2.5rem;
    border: 2px solid var(--light-gray);
    border-radius: 12px;
    font-size: 0.9rem;
    transition: all 0.3s;
    background: var(--white);
}

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

.search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    border: none;
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
}

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

/* Responsive para búsqueda en móvil */
@media (max-width: 768px) {
    .search-form {
        order: 3;
        margin: 1rem 0 0;
        max-width: 100%;
        width: 100%;
    }
    
    .search-input-wrapper input {
        padding: 0.7rem 4rem 0.7rem 2.5rem;
    }
    
    .search-btn {
        padding: 0.3rem 0.8rem;
    }
}