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

body {
    font-family: 'Georgia', serif;
    background: linear-gradient(135deg, #FFF8F2 0%, #FFF0E8 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #2D5A4A;
}

.container {
    max-width: 600px;
    width: 90%;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo {
    width: 50px;
    height: 50px;
}

.brand {
    text-align: left;
}

header h1 {
    font-size: 1.6rem;
    margin-bottom: 0;
    color: #F47A7A;
    line-height: 1.2;
}

.brand-hebrew {
    font-size: 0.95rem;
    color: #2D7A5E;
    font-weight: bold;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tab {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #2D7A5E;
    background: transparent;
    color: #2D7A5E;
    font-size: 0.95rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab.active {
    background: #2D7A5E;
    color: white;
}

.tab:hover:not(.active) {
    background: rgba(45, 122, 94, 0.1);
}

.date {
    color: #2D7A5E;
    font-size: 0.9rem;
    font-weight: bold;
}

.verse-card {
    position: relative;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(244, 122, 122, 0.3);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(45, 122, 94, 0.12);
}

.verse-actions {
    display: flex;
    gap: 0.5rem;
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.action-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: #2D7A5E;
    transition: transform 0.2s, color 0.2s;
    padding: 0.25rem;
}

.action-btn:hover {
    transform: scale(1.2);
}

.action-btn.favorite-btn {
    color: #F47A7A;
}

.action-btn.favorited {
    color: #F47A7A;
}

.note-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(45, 122, 94, 0.2);
}

.note-section textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    border: 1px solid rgba(45, 122, 94, 0.3);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    margin-bottom: 0.5rem;
}

.note-section textarea:focus {
    outline: none;
    border-color: #2D7A5E;
}

.save-note-btn {
    padding: 0.5rem 1rem;
    background: #2D7A5E;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
}

.save-note-btn:hover {
    background: #246B50;
}

.saved-note {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(45, 122, 94, 0.1);
    border-radius: 8px;
    font-size: 0.95rem;
    color: #2D5A4A;
}

.saved-note-label {
    font-weight: bold;
    color: #2D7A5E;
    margin-bottom: 0.5rem;
    display: block;
}

.hidden {
    display: none !important;
}

.favorites-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.favorites-list .verse-card {
    margin-bottom: 0;
}

.favorites-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.favorites-section-title {
    color: #2D7A5E;
    font-size: 1.1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(45, 122, 94, 0.2);
    margin: 0;
}

.favorite-names-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
}

.favorite-name-card {
    position: relative;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(244, 122, 122, 0.3);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
}

.favorite-name-card .name-hebrew {
    font-size: 1.3rem;
}

.favorite-name-card .name-trans {
    font-size: 0.7rem;
    color: #666;
    margin-top: 0.25rem;
}

.remove-name-btn {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: none;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.remove-name-btn:hover {
    color: #F47A7A;
}

.empty-message {
    text-align: center;
    color: #2D7A5E;
    font-style: italic;
    padding: 2rem;
}

.remove-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.remove-btn:hover {
    color: #F47A7A;
}

.verse-text {
    font-size: 1.3rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.verse-reference {
    text-align: right;
    color: #2D7A5E;
    font-weight: bold;
    font-size: 1rem;
}

.refresh-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #F47A7A 0%, #E8686A 100%);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(244, 122, 122, 0.5);
}

.refresh-btn:active {
    transform: translateY(0);
}

.verse-source-toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #2D7A5E;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 0.85rem;
    color: #2D7A5E;
    font-weight: bold;
}

.parsha-card {
    background: rgba(45, 122, 94, 0.08);
    border: 1px solid rgba(45, 122, 94, 0.2);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-top: 1.25rem;
    text-align: center;
}

.parsha-label {
    font-size: 0.75rem;
    color: #2D7A5E;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.parsha-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2D7A5E;
}

.parsha-ref {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}

footer {
    text-align: center;
    margin-top: 2rem;
    color: #2D7A5E;
    font-size: 0.85rem;
    font-weight: bold;
}

.notify-btn {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid #2D7A5E;
    color: #2D7A5E;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.notify-btn:hover {
    background: #2D7A5E;
    color: white;
}

.notify-btn.enabled {
    background: #2D7A5E;
    color: white;
}

.disclaimer-btn {
    display: block;
    margin: 0.75rem auto 0;
    padding: 0.4rem 0.8rem;
    background: transparent;
    border: none;
    color: #999;
    font-size: 0.75rem;
    cursor: pointer;
    text-decoration: underline;
}

.disclaimer-btn:hover {
    color: #2D7A5E;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}

.modal {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    padding: 1.5rem;
}

.modal h3 {
    color: #2D7A5E;
    margin-bottom: 1rem;
    padding-right: 2rem;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #F47A7A;
}

.modal-content p {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #444;
}

.modal-content a {
    color: #2D7A5E;
}

.modal-content .modal-footer {
    margin-top: 1.5rem;
    text-align: center;
    color: #F47A7A;
    font-style: italic;
}

@media print {
    body {
        background: white !important;
    }
    .tabs, .refresh-btn, .verse-actions, .note-section, footer, header .date, .notify-btn {
        display: none !important;
    }
    .container {
        max-width: 100%;
        padding: 2rem;
    }
    .verse-card {
        box-shadow: none;
        border: 2px solid #2D7A5E;
    }
}

/* Browse View */
.browse-controls, .search-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.browse-controls select, .search-controls input {
    flex: 1;
    min-width: 120px;
    padding: 0.75rem;
    border: 2px solid #2D7A5E;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    background: white;
}

.browse-controls select:focus, .search-controls input:focus {
    outline: none;
    border-color: #F47A7A;
}

.load-btn, .search-btn {
    padding: 0.75rem 1.25rem;
    background: #2D7A5E;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.95rem;
    white-space: nowrap;
}

.load-btn:hover, .search-btn:hover {
    background: #246B50;
}

.browse-results, .search-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 60vh;
    overflow-y: auto;
}

.browse-results .verse-card, .search-results .verse-card {
    margin-bottom: 0;
}

.verse-number {
    color: #F47A7A;
    font-weight: bold;
    margin-right: 0.5rem;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #2D7A5E;
}

.highlight {
    background: rgba(244, 122, 122, 0.3);
    padding: 0 2px;
    border-radius: 2px;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: #2D7A5E;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: bold;
    z-index: 1000;
    animation: fadeInOut 2s ease;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(20px); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0); }
    85% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* 72 Names View */
.names-intro {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #2D5A4A;
    font-size: 0.9rem;
    line-height: 1.6;
}

.names-intro p {
    margin-bottom: 0.5rem;
}

.names-source {
    font-size: 0.8rem;
    color: #2D7A5E;
    font-style: italic;
}

.names-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.5rem;
    max-height: 65vh;
    overflow-y: auto;
}

.name-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(244, 122, 122, 0.3);
    border-radius: 8px;
    padding: 0.75rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.name-card:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(45, 122, 94, 0.2);
    border-color: #2D7A5E;
}

.name-card.selected {
    background: #2D7A5E;
    border-color: #2D7A5E;
}

.name-card.selected .name-hebrew {
    color: white;
}

.name-card.selected .name-number {
    color: rgba(255, 255, 255, 0.7);
}

.name-card.favorited {
    border-color: #F47A7A;
    background: rgba(244, 122, 122, 0.1);
}

.name-card.favorited .name-number {
    color: #F47A7A;
}

.name-detail-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.75rem;
}

.name-favorite-btn, .name-save-img-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 2px solid #F47A7A;
    color: #F47A7A;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.name-save-img-btn {
    border-color: #2D7A5E;
    color: #2D7A5E;
}

.name-favorite-btn:hover {
    background: #F47A7A;
    color: white;
}

.name-save-img-btn:hover {
    background: #2D7A5E;
    color: white;
}

.name-hebrew {
    font-size: 1.4rem;
    font-weight: bold;
    color: #F47A7A;
    direction: rtl;
}

.name-number {
    font-size: 0.7rem;
    color: #2D7A5E;
    margin-top: 0.25rem;
}

.name-detail {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    border: 1px solid rgba(45, 122, 94, 0.3);
}

.name-detail-hebrew {
    font-size: 2.5rem;
    text-align: center;
    color: #F47A7A;
    direction: rtl;
    margin-bottom: 1rem;
}

.name-detail-info {
    text-align: center;
    color: #2D5A4A;
}

.name-detail-meaning {
    font-weight: bold;
    color: #2D7A5E;
    margin-bottom: 0.5rem;
}

@media (max-width: 500px) {
    .names-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .name-hebrew {
        font-size: 1.1rem;
    }
}
