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

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --success: #10b981;
    --highlight: #fef08a;
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #f9fafb;
    --white: #ffffff;
    --border: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg);
}

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

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--primary);
}

.version-select {
    padding: 12px 20px;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    cursor: pointer;
    transition: all 0.3s;
}

.version-select:hover {
    border-color: var(--primary);
}

.db-status {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.db-status.loading {
    background: #fef3c7;
    color: #92400e;
}

.db-status.ready {
    background: #d1fae5;
    color: #065f46;
}

.db-status.error {
    background: #fee2e2;
    color: #991b1b;
}

.search-container {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.tab {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-light);
    transition: all 0.3s;
}

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

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-input, .select-field {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    transition: all 0.3s;
}

.search-input:focus, .select-field:focus {
    outline: none;
    border-color: var(--primary);
}

.select-field:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
}

.btn-primary, .btn-secondary, .btn-success {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

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

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

.btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.btn-secondary {
    background: #6b7280;
    color: var(--white);
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-success {
    background: #25D366;
    color: var(--white);
}

.btn-success:hover {
    background: #1da851;
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.2rem;
    color: var(--text-light);
}

.hidden {
    display: none !important;
}

.results {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.verse-card {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.verse-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.verse-reference {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.verse-text {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 15px;
}

.highlight {
    background: var(--highlight);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 500;
}

.verse-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-generate {
    padding: 8px 16px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

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

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-light);
}

.close:hover {
    color: var(--text);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: var(--primary);
}

.color-picker {
    margin-bottom: 20px;
}

.color-picker label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
}

.color-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-btn {
    width: 60px;
    height: 60px;
    border: 3px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.color-btn:hover {
    transform: scale(1.1);
}

.color-btn.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

#imagePreview {
    margin: 20px 0;
    text-align: center;
}

#imagePreview img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.modal-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.modal-actions button {
    flex: 1;
    min-width: 150px;
}

.verses-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.verse-highlighted {
    border-left: 4px solid var(--primary);
    background: #eff6ff;
}

.chapter-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
    padding: 20px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.btn-nav {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid var(--primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--white);
    color: var(--primary);
}

.btn-nav:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
}

.btn-prev {
    order: 1;
}

.btn-next {
    order: 2;
    margin-left: auto;
}

footer {
    text-align: center;
    padding: 18px 20px;
    margin-top: 50px;
    border-top: 2px solid var(--border);
    background: var(--white);
    border-radius: 12px;
}

footer p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin: 0;
}

footer a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

footer strong {
    color: var(--primary);
    font-weight: 600;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .tab-content.active {
        flex-direction: column;
    }

    .search-input, .select-field {
        width: 100%;
    }

    .tabs {
        flex-direction: column;
        gap: 0;
    }

    .tab {
        border-bottom: 1px solid var(--border);
        border-right: 3px solid transparent;
    }

    .tab.active {
        border-bottom-color: var(--border);
        border-right-color: var(--primary);
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions button {
        width: 100%;
    }
}
