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

body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #f4f4f4;
    padding: 10px;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: transparent;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

/* Botón hamburguesa */
.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hamburger-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.05);
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}
.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}
.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.navbar-title {
    margin-left: 15px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    position: fixed;
    top: 0;
    left: -350px;
    width: 350px;
    height: 100vh;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 999;
    overflow-y: auto;
}
.sidebar.active {
    left: 0;
}

.sidebar-header {
    padding: 25px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
}

.sidebar-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-subtitle {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 300;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
}
.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.sidebar-content {
    padding: 30px 0;
}
.menu-section {
    margin-bottom: 10px;
}
.menu-item {
    display: block;
    padding: 18px 25px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    position: relative;
    overflow: hidden;
}
.menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    transition: all 0.4s ease;
}
.menu-item:hover::before {
    left: 0;
}
.menu-item:hover {
    background: rgba(102, 126, 234, 0.05);
    border-left-color: #667eea;
    transform: translateX(5px);
    color: #667eea;
}
.menu-item .icon {
    font-size: 20px;
    margin-right: 12px;
    transition: all 0.3s ease;
}
.menu-item:hover .icon {
    transform: scale(1.2);
}
.menu-text {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
}

.main-content {
    margin-top: 80px;
    padding: 40px 20px;
    text-align: center;
    color: white;
}
.main-content h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}
.main-content p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

header {
    width: 90%;
    max-width: 1200px;
    background-color: #16a085;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    border-radius: 30px;
    margin-bottom: 20px;
    margin-top: 80px;
    text-align: center;
}

.search-bar {
    text-align: center;
    margin: 30px auto;
    max-width: 400px;
}
.search-bar input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #16a085;
    border-radius: 10px;
    font-size: 16px;
}

h1 {
    font-family: Arial, sans-serif;
    font-weight: bold;
    color: black;
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    text-align: center;
}
.torah-icon {
    font-size: 36px;
    margin-right: 10px;
}

/* CONTENEDOR PRINCIPAL - CAMBIO IMPORTANTE AQUÍ */
.container {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 5 columnas fijas en desktop */
    gap: 20px;
    padding: 20px;
    width: 100%;
    max-width: 1400px; /* Aumentado para acomodar 5 columnas */
    justify-items: center;
    margin: 0 auto; /* Centrar el contenedor */
}

.box {
    width: 100%; /* Usar todo el ancho disponible de la columna */
    max-width: 250px; /* Límite máximo para no verse demasiado ancho */
    background-color: #fff;
    border: 2px solid #16a085;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out;
}

.box:hover {
    transform: scale(1.03);
}
.parasha-name {
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 15px;
}
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #16a085;
    color: white;
    text-decoration: none;
    font-weight: bold;
    border-radius: 8px;
    transition: background 0.3s;
}
.btn:hover {
    background-color: #1abc9c;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}
.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    width: 300px;
    position: relative;
}
.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 20px;
    cursor: pointer;
}

/* Media Queries */
@media (max-width: 1024px) {
    h1 {
        font-size: 2rem;
    }
    .container {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        padding: 15px;
    }
    .box {
        width: 100%;
        margin: 0;
    }
}

/* CAMBIO PRINCIPAL: Media query para tablets */
@media (max-width: 768px) {
    .container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px;
    }
    
    .box {
        width: 100%;
        margin: 0;
        padding: 15px;
        font-size: 14px;
    }

    .navbar-title {
        font-size: 16px;
    }

    .main-content h1 {
        font-size: 2rem;
    }

    .main-content p {
        font-size: 1rem;
    }

    header {
        padding: 15px;
        font-size: 1.2rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    .sidebar {
        width: 80%;
    }

    .sidebar-header {
        padding: 10px 15px;
    }

    .sidebar-title {
        font-size: 18px;
    }

    .sidebar-subtitle {
        font-size: 14px;
    }

    .menu-item {
        font-size: 15px;
    }

    .search-bar input {
        width: 100%;
        font-size: 16px;
        padding: 10px;
    }

    .box .btn {
        font-size: 16px;
        padding: 8px 14px;
    }

    .modal-content {
        width: 90%;
        padding: 20px;
    }

    header h1 {
        font-size: 24px;
        padding: 10px;
    }
}

/* CAMBIO PRINCIPAL: Media query para móviles pequeños - FORZAR 2 COLUMNAS */
@media (max-width: 480px) {
    .container {
        grid-template-columns: repeat(2, 1fr); /* FORZAR EXACTAMENTE 2 COLUMNAS */
        gap: 8px;
        padding: 8px;
    }
    
    .box {
        width: 100%;
        margin: 0;
        padding: 12px;
        font-size: 13px;
    }

    .search-bar input {
        font-size: 14px;
        padding: 10px;
    }

    h1 {
        font-size: 1.5rem;
    }

    header {
        padding: 10px;
    }

    .navbar-title {
        font-size: 14px;
    }

    .sidebar-title {
        font-size: 16px;
    }

    .sidebar-subtitle {
        font-size: 12px;
    }

    .menu-item {
        font-size: 14px;
    }

    .box .btn {
        font-size: 14px;
        padding: 6px 12px;
    }

    .modal-content h2 {
        font-size: 20px;
    }

    .modal-content p {
        font-size: 14px;
    }
}

/* Media query adicional para móviles muy pequeños */
@media (max-width: 320px) {
    .container {
        grid-template-columns: repeat(2, 1fr); /* MANTENER 2 COLUMNAS SIEMPRE */
        gap: 6px;
        padding: 6px;
    }
    
    .box {
        padding: 10px;
        font-size: 12px;
    }
    
    .parasha-name {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .btn {
        padding: 6px 10px;
        font-size: 12px;
    }
}

@media (min-width: 601px) {
    .menu-container:hover .dropdown-content {
        display: block;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
.sidebar.active .menu-item {
    animation: slideIn 0.5s ease forwards;
}
.sidebar.active .menu-item:nth-child(1) {
    animation-delay: 0.1s;
}
.sidebar.active .menu-item:nth-child(2) {
    animation-delay: 0.2s;
}
.sidebar.active .menu-item:nth-child(3) {
    animation-delay: 0.3s;
}