:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --light-bg: #f9f9f9;
    --border-color: #e0e0e0;
    --text-color: #333;
    --text-light: #666;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --error-color: #e74c3c;
}

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

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.search-container,
.dictionary-section,
.word-card,
.footer-content,
.stats-container {
    max-width: 100%;
}

.container {
    width: 100%;
    max-width: 100%;
    padding: 0 1rem;
}

body {
    font-family: 'Open Sans', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f8f9fa;
}

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

/* Header Styles */
header {
    background-color: var(--secondary-color);
    color: white;
    padding: 0.1rem 0;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

.logo {
    font-family: 'Heebo', sans-serif;
    font-size: 2rem;
    font-weight: 700;
}

.form-group {
    display: flex;
    justify-content: flex-start;
    /* Cambiado de center a flex-start */
    align-items: center;
    margin: 1.5rem 0;
    gap: 1rem;
    flex-wrap: wrap;
    direction: ltr;
    /* Asegurar dirección izquierda a derecha */
}

h4{
    text-align: center;
}

.navbar {
    border-radius: 8px;
}

nav ul {
    display: flex;
    list-style: none;
}

nav li {
    margin-left: 2rem;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

nav a:hover {
    color: rgba(255, 255, 255, 0.8);
}

label {
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    text-align: left;
    /* Asegurar alineación a la izquierda */
}

input {
    font-family: var(--font-hebrew);
    font-size: 1.5rem;
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    direction: ltr;
    /* Para entradas de texto */
}

input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 5px rgba(231, 76, 60, 0.5);
}

/* Search Container */
.search-container {
    background-color: white;
    border-radius: 30px;
    padding: 1.5rem 2rem;
    margin: 2rem auto;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.search-direction {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
    gap: 2rem;
}

.search-direction label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-light);
}

.search-direction input[type="radio"] {
    accent-color: var(--primary-color);
    width: 16px;
    height: 16px;
}

.search-direction label:has(input:checked) {
    color: var(--primary-color);
}

.search-input-group {
    display: flex;
    width: 100%;
    flex-direction: column;
}

.search-input-group input[type="text"],
.search-input-group button {
    width: 100%;
    border-radius: 20px;
    margin: 0.3rem 0;
}

.search-container input[type="text"] {
    flex: 1;
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: 20px 0 0 20px;
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.search-container input[type="text"]:focus {
    border-color: var(--primary-color);
}

.search-container button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 20px 20px 20px 20px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.search-container button:hover {
    background-color: #2980b9;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    /* Permitirá que las pestañas se envuelvan si no caben en una línea */
}

.tab {
    padding: 10px 15px;
    cursor: pointer;
}

.tab:hover {
    background-color: #e9ecef;
}

.tab.active {
    background-color: white;
    border-color: #ddd;
    border-bottom: 1px solid white;
    margin-bottom: -1px;
    font-weight: bold;
    color: var(--primary-color);
}

.tab-content {
    display: none;
    padding: 1rem;
    background-color: white;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 1rem;
}

th,
td {
    padding: 0.8rem;
    text-align: center;
    border: 1px solid #ddd;
}

th {
    background-color: var(--secondary-color);
    color: white;
    font-weight: 600;
}

tr:nth-child(even) {
    background-color: #f2f2f2;
}

.hebrew {
    font-family: var(--font-hebrew);
    font-size: 1.3rem;
}

.binyan-name {
    font-weight: bold;
    color: var(--accent-color);
}

.note {
    font-size: 0.9rem;
    color: #666;
    margin-top: 1rem;
    font-style: italic;
}

/* Main Content */
main {
    padding: 2rem 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-options select {
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    outline: none;
    font-size: 0.9rem;
}

/* Categories */
.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin: 2rem 0;
}

.category-btn {
    background-color: white;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

/* Dictionary Section */
.dictionary-section {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

h2 {
    font-family: 'Heebo', sans-serif;
    color: var(--secondary-color);
    font-weight: 700;
    font-size: 1.5rem;
}

/* Word List and Cards */
.word-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.word-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: white;
}

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

.word-card.popular {
    border-left: 3px solid var(--accent-color);
}

.hebrew-word {
    font-family: 'Heebo', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
    direction: rtl;
    text-align: right;
}

.spanish-word {
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.word-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.word-detail {
    display: flex;
    justify-content: space-between;
}

.detail-label {
    font-weight: 600;
    color: var(--text-light);
}

.detail-value {
    color: var(--text-color);
    text-align: right;
}

/* Estilos para la barra de estadísticas compacta */
.stats-container.compact {
    background-color: #f5f5f5;
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 20px;
}

.stats-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    font-size: 0.9rem;
}

.stats-summary .stat-item {
    margin: 0 5px;
}

/* Estilos para el indicador de dirección */
.search-direction-indicator {
    font-size: 0.8rem;
    color: #666;
    text-align: right;
    margin-top: 4px;
}

/* Statistics */
.stats-container {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stats-container h3 {
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
    text-align: center;
    font-family: 'Heebo', sans-serif;
    font-size: 1.3rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    text-align: center;
}

.stat-item {
    padding: 1rem;
    border-radius: 8px;
    background-color: var(--light-bg);
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-3px);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* Loading, Error and Empty States */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error {
    background-color: #ffebee;
    color: var(--error-color);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    text-align: center;
    border-left: 4px solid var(--error-color);
}

.empty-results {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Pie de página */
h5 {
    margin-top: 40px;
    color: #578285;
    font-style: italic;
    text-align: center;
    font-weight: normal;
    font-size: medium;
}

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

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-section {
    flex: 1;
    min-width: 200px;
}

.footer-section h3 {
    margin-bottom: 0.5rem;
    font-family: 'Heebo', sans-serif;
    font-size: 1.2rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
}

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

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

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

.footer-section a:hover {
    color: white;
}

.copyright {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Vue-specific */
[v-cloak] {
    display: none;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .container {
        padding: 0.5rem;
    }

    table {
        font-size: 0.9rem;
    }

    th,
    td {
        padding: 0.5rem;
    }

    .hebrew {
        font-size: 1.1rem;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .tab {
        padding: 0.6rem 1rem;
        margin-bottom: 5px;
    }
}

@media print {

    header,
    footer,
    .form-group,
    .tabs {
        display: none;
    }

    .tab-content {
        display: block !important;
        box-shadow: none;
    }

    body {
        font-size: 12pt;
    }
}

@media print {

    header,
    footer,
    .form-group,
    .tabs {
        display: none;
    }

    .tab-content {
        display: block !important;
        box-shadow: none;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        margin-top: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    nav li {
        margin: 0.5rem;
    }

    .word-list {
        grid-template-columns: 1fr;
    }

    .search-direction {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .search-input-group {
        flex-direction: column;
    }

    .search-container input[type="text"] {
        border-radius: 20px;
        border-right: 1px solid var(--border-color);
        margin-bottom: 0.8rem;
    }

    .search-container button {
        border-radius: 20px;
        width: 100%;
    }

    @media (max-width: 360px) {
        .hebrew-word {
            font-size: 1.4rem;
        }

        .spanish-word {
            font-size: 1rem;
        }

        h2 {
            font-size: 1.2rem;
        }

        .search-container {
            padding: 1rem;
        }
    }

        @keyframes fadeIn {
            from {
                opacity: 0;
            }
    
            to {
                opacity: 1;
            }
        }
    
        .tab-content.active {
            animation: fadeIn 0.5s ease-in-out;
        }
    
        .tooltip {
            position: relative;
            display: inline-block;
            cursor: help;
            border-bottom: 1px dotted var(--primary-color);
        }
    
        .tooltip .tooltip-text {
            visibility: hidden;
            width: 200px;
            background-color: var(--dark-color);
            color: white;
            text-align: center;
            border-radius: 6px;
            padding: 5px;
            position: absolute;
            z-index: 1;
            bottom: 125%;
            left: 50%;
            margin-left: -100px;
            opacity: 0;
            transition: opacity 0.3s;
            font-size: 0.9rem;
        }
    
        .tooltip:hover .tooltip-text {
            visibility: visible;
            opacity: 1; }
}