/* Custom styles for dictdict */

body {
    background-color: #f8edeb;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.875rem;
    line-height: 1.65;
    color: #3a2a1a;
}

.navbar-brand {
    font-family: Georgia, 'Palatino Linotype', serif;
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: -0.01em;
}

/* Navbar gradient effect */
.navbar.bg-primary {
    background: linear-gradient(135deg, #c47d65 0%, #9b5b46 50%, #6b3b2d 100%) !important;
    box-shadow: 0 4px 8px rgba(155, 91, 70, 0.3);
}

#hamburgerBtn:hover {
    color: #6b3b2d;
}

.card {
    border: none;
    border-radius: 12px;
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    border: none;
}

.input-group-lg .form-control {
    border-radius: 8px 0 0 8px;
    border: 2px solid #e0e0e0;
    font-size: 0.95rem;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.input-group-lg .form-control:focus {
    border-color: #9b5b46;
    box-shadow: 0 0 0 0.2rem rgba(155, 91, 70, 0.25);
}

.input-group-lg .btn {
    border-radius: 0 8px 8px 0;
    padding: 12px 24px;
    font-weight: 600;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #c47d65 0%, #9b5b46 50%, #6b3b2d 100%);
    border: none;
    color: white;
    box-shadow: 0 4px 8px rgba(155, 91, 70, 0.3);
}

.input-group-lg .btn:hover {
    background: linear-gradient(135deg, #9b5b46 0%, #7d4835 50%, #5c3425 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(155, 91, 70, 0.4);
}

.nav-tabs {
    border: none;
    margin-bottom: 0;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 8px 8px 0 0;
    margin-right: 4px;
    padding: 10px 18px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: #6c757d;
    background-color: #f8edeb;
    transition: all 0.3s ease;
    position: relative;
}

.nav-tabs .nav-link:hover {
    background: linear-gradient(135deg, #ece4db 0%, #f8edeb 100%);
    color: #495057;
}

.nav-tabs .nav-link.active {
    background: linear-gradient(135deg, #c47d65 0%, #9b5b46 50%, #6b3b2d 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 8px rgba(155, 91, 70, 0.3);
    transform: translateY(-1px);
}

.tab-content {
    background-color: white;
    border-radius: 0 0 8px 8px;
    padding: 24px;
    min-height: 300px;
}

/* Override for notebook section tab content */
#notebookSection .tab-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 0;
}

#notebookSection .tab-content .tab-pane {
    flex: 1;
    height: 100%;
    overflow: hidden;
}

#notebookSection .tab-content .tab-pane .row{
    flex: 1;
    height: 100%;
    overflow: hidden;
}

.language-content {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Etymology section */
.etymology-section {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.etymology-content {
    font-style: italic;
    color: #6c757d;
}

/* POS and definition styling */
.pos-group {
    margin-bottom: 2rem;
    border-left: 3px solid #c47d65;
    padding: 0.25rem 0 0.25rem 1.25rem;
    background: none;
}

.pos-header {
    background: linear-gradient(135deg, #c47d65 0%, #9b5b46 50%, #6b3b2d 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    box-shadow: 0 4px 8px rgba(155, 91, 70, 0.3);
    transition: all 0.3s ease;
}

.pos-header:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(155, 91, 70, 0.4);
}

/* Language badge and secondary badges gradient effects */
.badge.bg-secondary {
    background: linear-gradient(135deg, #c47d65 0%, #9b5b46 50%, #6b3b2d 100%);
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.3);
    transition: all 0.3s ease;
}

.badge.bg-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.4);
}

/* Primary badges gradient effect */
.badge.bg-primary {
    background: linear-gradient(135deg, #c47d65 0%, #9b5b46 50%, #6b3b2d 100%) !important;
    box-shadow: 0 2px 4px rgba(155, 91, 70, 0.3);
    transition: all 0.3s ease;
}

.badge.bg-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(155, 91, 70, 0.4);
}

/* General button gradient enhancements */
.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 50%, #198754 100%) !important;
    border: none;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
}

.btn-success:hover {
    background: linear-gradient(135deg, #20c997 0%, #198754 50%, #157347 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 50%, #c82333 100%) !important;
    border: none;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #e74c3c 0%, #c82333 50%, #bd2130 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.4);
}

.btn-outline-primary {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, #c47d65 0%, #9b5b46 50%, #6b3b2d 100%) border-box;
    color: #9b5b46;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover,
.btn-outline-primary:active,
.btn-outline-primary:focus,
.btn-outline-primary:focus-visible {
    background: linear-gradient(135deg, #c47d65 0%, #9b5b46 50%, #6b3b2d 100%);
    border-color: transparent;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(155, 91, 70, 0.3);
    outline: none;
}

.btn-outline-primary:hover .text-muted,
.btn-outline-primary:hover small {
    color: rgba(255, 255, 255, 0.85) !important;
}

.btn-outline-secondary {
    border: 2px solid #c4a898;
    color: #7a5547;
    background: white;
    transition: all 0.3s ease;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:active,
.btn-outline-secondary:focus,
.btn-outline-secondary:focus-visible {
    background-color: #fae1dd;
    border-color: #9b5b46;
    color: #6b3b2d;
    box-shadow: 0 2px 6px rgba(155, 91, 70, 0.2);
    outline: none;
}

.definition-item {
    background: none;
    border: none;
    border-bottom: 1px solid #ece4db;
    padding: 10px 0;
    margin-bottom: 0;
    border-radius: 0;
    transition: all 0.2s ease;
    position: relative;
}

.definition-item:last-child {
    border-bottom: none;
}

.definition-item:hover {
    background: none;
    transform: none;
    border-color: #ece4db;
}

.definition-text {
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.7;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.examples-container {
    margin-top: 0.5rem;
}

.example-item {
    background: none;
    border-left: 2px solid #ddc9bb;
    padding: 4px 0 4px 12px;
    margin-top: 6px;
    margin-bottom: 4px;
    border-radius: 0;
    font-style: italic;
    font-size: 0.82rem;
    line-height: 1.6;
    color: #7a5547;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.example-item:hover {
    background: none;
    border-left-color: #9b5b46;
    color: #6b3b2d;
    transform: none;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

.alert {
    border-radius: 8px;
    border: none;
}

.alert-success {
    background: linear-gradient(135deg, #fae1dd 0%, #f8edeb 100%);
    border-left: 4px solid #9b5b46 !important;
    color: #6b3b2d;
}

footer {
    margin-top: auto;
}

/* Language-specific font improvements */
#chinese-content,
#japanese-content {
    font-family: 'Microsoft YaHei', 'Hiragino Sans GB', 'WenQuanYi Micro Hei', sans-serif;
    line-height: 1.6;
}

#french-content {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

/* Word information styling */
#searchedWord {
    color: #6b3b2d;
    font-size: 1.25rem;
    font-weight: bold;
}

#wordType {
    background-color: #e9ecef;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    text-transform: capitalize;
}

#pronunciation {
    font-family: 'Courier New', monospace;
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

#wordLanguage {
    font-size: 0.9rem;
    padding: 6px 12px;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .nav-tabs .nav-link {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .tab-content {
        padding: 16px;
    }
    
    .input-group-lg .form-control,
    .input-group-lg .btn {
        font-size: 1rem;
        padding: 10px 14px;
    }
    
    .pos-group {
        padding: 0.75rem;
    }
    
    .card-header .row {
        text-align: center;
    }
    
    .card-header .col-md-4 {
        margin-top: 0.5rem;
    }
}

/* Empty state styling */
.empty-state {
    text-align: center;
    color: #6c757d;
    padding: 40px 20px;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Search suggestions */
.search-suggestion {
    background-color: #fae1dd;
    border: 1px solid #fcd5ce;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 4px 0;
    color: #6b3b2d;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-suggestion:hover {
    background-color: #fcd5ce;
    transform: translateX(2px);
}


/* Add these styles at the end of the file */

/* Vote buttons styling */
.definition-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.example-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.vote-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: center;
}

.vote-btn {
    background: none;
    border: 1px solid #ddc9bb;
    color: #9b5b46;
    padding: 3px 7px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 36px;
    justify-content: center;
}

.vote-btn:hover:not(:disabled) {
    background-color: #fae1dd;
    border-color: #9b5b46;
    color: #6b3b2d;
    transform: translateY(-1px);
}

.vote-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.like-btn.voted {
    background-color: #9b5b46;
    color: white;
    border-color: #9b5b46;
}

.dislike-btn.voted {
    background-color: #ece4db;
    color: #6b3b2d;
    border-color: #c4a898;
}

.vote-btn.voted i {
    color: inherit;
}

.vote-btn.vote-queued {
    background-color: #fae1dd;
    color: #9b5b46;
    border-color: #c47d65;
    opacity: 0.85;
}

.vote-btn.vote-queued i {
    color: #9b5b46;
}

.upload-status {
    font-size: 0.75rem;
    color: #6c757d;
    font-style: italic;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.upload-status::before {
    content: "⏳";
    font-size: 0.8rem;
}

.vote-count {
    font-weight: 500;
    font-size: 0.8rem;
}

.vote-error {
    margin-bottom: 15px;
    font-size: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .definition-content,
    .example-content {
        flex-direction: column;
        gap: 8px;
    }
    
    .vote-buttons {
        justify-content: flex-start;
    }
    
    .vote-btn {
        font-size: 0.8rem;
        padding: 3px 6px;
        min-width: 40px;
    }
}

/* Clickable words styling */
.clickable-word {
    cursor: pointer;
    color: inherit; /* Keep the same color as surrounding text by default */
    text-decoration: none;
    padding: 1px 2px;
    border-radius: 3px;
    transition: all 0.2s ease;
    position: relative;
}

.clickable-word:hover {
    background-color: #fae1dd;
    color: #6b3b2d;
    text-decoration: underline;
    transform: scale(1.02);
}

.clickable-word:active {
    background-color: #fcd5ce;
    transform: scale(0.98);
}

/* Improve contrast for better accessibility */
.clickable-word:focus {
    outline: 2px solid #9b5b46;
    outline-offset: 1px;
    background-color: #fae1dd;
    color: #6b3b2d;
}

/* Tab close button styles */
.tab-close-btn {
    opacity: 0;
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

.nav-link:hover .tab-close-btn {
    opacity: 1;
}

.tab-close-btn:hover {
    background: rgba(220, 53, 69, 0.8);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* Glass effect for inactive tabs close button */
.nav-link:not(.active) .tab-close-btn {
    background: rgba(108, 117, 125, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(108, 117, 125, 0.3);
    color: #6c757d;
}

.nav-link:not(.active) .tab-close-btn:hover {
    background: rgba(220, 53, 69, 0.8);
    color: white;
}

/* Add tab button styles */
#add-tab-btn {
    color: #28a745;
    border: 1px dashed #28a745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(40, 167, 69, 0.05) 100%);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

#add-tab-btn:hover {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.2) 0%, rgba(40, 167, 69, 0.1) 100%);
    border-color: #28a745;
    color: #28a745;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.2);
}

/* Prevent tab close button from triggering tab selection */
.tab-close-btn {
    pointer-events: auto;
}

.nav-link {
    position: relative;
}

/* Style for restore language modal buttons */
.restore-lang-btn {
    text-align: left;
    display: flex;
    align-items: center;
}

.restore-lang-btn i {
    width: 20px;
}

/* Etymology foldable section styles */
.etymology-toggle {
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.etymology-toggle:hover {
    color: #9b5b46 !important;
}

.etymology-chevron {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.etymology-toggle[aria-expanded="true"] .etymology-chevron {
    transform: rotate(180deg);
}

.etymology-content {
    border-left: 4px solid #9b5b46;
    background: linear-gradient(135deg, #fae1dd 0%, #ece4db 100%) !important;
}

/* Content alignment fixes */
.container {
    max-width: 1200px;
}

/* Ensure consistent centered alignment for all content sections */
.row.justify-content-center {
    margin-left: auto;
    margin-right: auto;
}

/* Force proper centering for all col-md-10 elements */
.col-md-10 {
    margin-left: auto;
    margin-right: auto;
    float: none;
}

/* Override Bootstrap's default behavior for medium screens and up */
@media (min-width: 768px) {
    .col-md-10 {
        width: 83.33333333%;
        margin-left: auto;
        margin-right: auto;
        float: none;
    }
}

/* Card header layout improvements */
.card-header .d-flex {
    gap: 0.75rem;
}

.pronunciation-row {
    min-height: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Word type badge styling */
#wordType {
    font-size: 0.8rem;
}

/* Ensure proper alignment for elements in second row */
.card-header .d-flex:last-child {
    min-height: 1.5rem;
}

/* Responsive adjustments for card header */
@media (max-width: 767px) {
    .card-header .d-flex {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center !important;
    }
    
    .card-header h5 {
        margin-bottom: 0.25rem !important;
    }
}

/* Language Selector Wheel Styles */
.language-selector-container {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 12px;
    flex-shrink: 0; /* Prevent shrinking */
}

.language-wheel-frame {
    position: relative;
    width: 100px; /* Reduced from 120px */
    height: 48px; /* Reduced from 56px */
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    overflow: visible; /* Change to visible so expansion doesn't get clipped */
    background: linear-gradient(135deg, #f8edeb 0%, #ece4db 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30; /* Ensure it's above other elements during expansion */
}

.language-wheel-frame:hover {
    border-color: #9b5b46;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(155, 91, 70, 0.3);
    transform: translateY(-12px); /* Move up to center the expansion */
    height: 72px; /* Expand vertically */
    position: absolute; /* Take out of flow to not affect search box */
    top: 0; /* Position relative to container */
}

/* Scroll hint arrows - moved to the left */
.language-selector-container::before,
.language-selector-container::after {
    content: '';
    position: absolute;
    left: -24px;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-radius: 3px;
    opacity: 0.5;
    transition: all 0.6s ease;
    z-index: 25;
}

.language-selector-container::before {
    /* Up chevron */
    top: 12px;
    border-bottom: 2px solid #9b5b46;
    border-right: 2px solid #9b5b46;
    transform: rotate(-135deg); /* Points up */
    animation: breatheUp 2s ease-in-out infinite;
}

.language-selector-container::after {
    /* Down chevron */
    bottom: 12px;
    border-bottom: 2px solid #9b5b46;
    border-right: 2px solid #9b5b46;
    transform: rotate(45deg); /* Points down */
    animation: breatheDown 2s ease-in-out infinite;
}

/* Breathing animation for arrows */
@keyframes breatheUp {
    0%, 100% { 
        transform: rotate(-135deg) scale(1);
        opacity: 0.5;
    }
    50% { 
        transform: rotate(-135deg) scale(1.2);
        opacity: 0.8;
    }
}

@keyframes breatheDown {
    0%, 100% { 
        transform: rotate(45deg) scale(1);
        opacity: 0.5;
    }
    50% { 
        transform: rotate(45deg) scale(1.2);
        opacity: 0.8;
    }
}

/* Hide scroll hint arrows when hovering — wheel is expanded, hints aren't needed */
.language-selector-container:hover::before,
.language-selector-container:hover::after {
    opacity: 0;
    pointer-events: none;
}

/* Initial attention-grabbing animation */
@keyframes wheelPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.language-wheel-frame {
    animation: wheelPulse 2s ease-in-out 3;
}

.language-wheel-frame:hover {
    animation: none;
}

.language-wheel {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.language-option {
    position: absolute;
    width: 70px; /* Reduced from 80px */
    height: 32px; /* Reduced from 40px */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem; /* Slightly smaller font */
    border-radius: 8px;
    background: white;
    color: #6c757d;
    border: 2px solid #e0e0e0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    user-select: none;
    opacity: 0;
    transform: translateY(60px) scale(0.8); /* Reduced from 80px */
}

.language-option.active {
    background: linear-gradient(135deg, #c47d65 0%, #9b5b46 50%, #6b3b2d 100%);
    color: white;
    border-color: #9b5b46;
    box-shadow: 0 4px 8px rgba(155, 91, 70, 0.4);
    opacity: 1;
    transform: translateY(0) scale(1);
    z-index: 10;
}

/* Wheel states - simulate wheel rotation by showing different options */
.language-wheel.lang-en .language-option[data-lang="en"] {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.language-wheel.lang-ja .language-option[data-lang="ja"] {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.language-wheel.lang-zh .language-option[data-lang="zh"] {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.language-wheel.lang-fr .language-option[data-lang="fr"] {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Show adjacent options when hovering - revealing more of the spinwheel */
.language-wheel-frame:hover .language-option {
    opacity: 0.3 !important;
    transform: translateY(0) scale(0.8) !important;
}

.language-wheel-frame:hover .language-option.active {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    z-index: 15;
}

/* Show next/previous options when hovering */
.language-wheel.lang-en:hover .language-option[data-lang="ja"] {
    opacity: 0.5 !important;
    transform: translateY(-25px) scale(0.7) !important;
}
.language-wheel.lang-en:hover .language-option[data-lang="fr"] {
    opacity: 0.5 !important;
    transform: translateY(25px) scale(0.7) !important;
}

.language-wheel.lang-ja:hover .language-option[data-lang="zh"] {
    opacity: 0.5 !important;
    transform: translateY(-25px) scale(0.7) !important;
}
.language-wheel.lang-ja:hover .language-option[data-lang="en"] {
    opacity: 0.5 !important;
    transform: translateY(25px) scale(0.7) !important;
}

.language-wheel.lang-zh:hover .language-option[data-lang="fr"] {
    opacity: 0.5 !important;
    transform: translateY(-25px) scale(0.7) !important;
}
.language-wheel.lang-zh:hover .language-option[data-lang="ja"] {
    opacity: 0.5 !important;
    transform: translateY(25px) scale(0.7) !important;
}

.language-wheel.lang-fr:hover .language-option[data-lang="en"] {
    opacity: 0.5 !important;
    transform: translateY(-25px) scale(0.7) !important;
}
.language-wheel.lang-fr:hover .language-option[data-lang="zh"] {
    opacity: 0.5 !important;
    transform: translateY(25px) scale(0.7) !important;
}

/* Animation for wheel "rotation" */
.language-wheel.lang-en .language-option[data-lang="ja"] {
    transform: translateY(-60px) scale(0.8);
}
.language-wheel.lang-en .language-option[data-lang="zh"] {
    transform: translateY(60px) scale(0.8);
}
.language-wheel.lang-en .language-option[data-lang="fr"] {
    transform: translateY(-60px) scale(0.8);
}

.language-wheel.lang-ja .language-option[data-lang="en"] {
    transform: translateY(60px) scale(0.8);
}
.language-wheel.lang-ja .language-option[data-lang="zh"] {
    transform: translateY(-60px) scale(0.8);
}
.language-wheel.lang-ja .language-option[data-lang="fr"] {
    transform: translateY(60px) scale(0.8);
}

.language-wheel.lang-zh .language-option[data-lang="en"] {
    transform: translateY(-60px) scale(0.8);
}
.language-wheel.lang-zh .language-option[data-lang="ja"] {
    transform: translateY(60px) scale(0.8);
}
.language-wheel.lang-zh .language-option[data-lang="fr"] {
    transform: translateY(-60px) scale(0.8);
}

.language-wheel.lang-fr .language-option[data-lang="en"] {
    transform: translateY(60px) scale(0.8);
}
.language-wheel.lang-fr .language-option[data-lang="ja"] {
    transform: translateY(-60px) scale(0.8);
}
.language-wheel.lang-fr .language-option[data-lang="zh"] {
    transform: translateY(60px) scale(0.8);
}

.input-group-lg .form-control {
    border-radius: 8px 8px 8px 0;
    border: 2px solid #e0e0e0;
    border-left: 2px solid #e0e0e0;
    padding-left: 20px;
    font-size: 0.95rem;
    padding: 12px 20px 12px 20px;
    transition: all 0.3s ease;
}

.input-group-lg .form-control:focus {
    border-color: #9b5b46;
    box-shadow: 0 0 0 0.2rem rgba(155, 91, 70, 0.25);
}

.input-group-lg .btn {
    border-radius: 8px;
    margin-left: 8px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .language-wheel-frame {
        width: 100px;
        height: 48px;
    }
    
    .language-option {
        width: 70px;
        height: 32px;
        font-size: 0.75rem;
    }
    
    .language-selector-container::before,
    .language-selector-container::after {
        left: -15px;
        border-left-width: 3px;
        border-right-width: 3px;
        border-bottom-width: 5px;
        border-top-width: 5px;
    }
}

/* Login Page Styling */
.login-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

.login-card-header {
    background: linear-gradient(135deg, #c47d65 0%, #9b5b46 50%, #6b3b2d 100%) !important;
    box-shadow: 0 4px 8px rgba(155, 91, 70, 0.3);
    border-radius: 12px 12px 0 0 !important;
    border: none;
}

.login-input-group-text {
    border: 2px solid #e0e0e0;
    border-right: none;
    background: linear-gradient(135deg, #f8edeb 0%, #ece4db 100%);
    transition: all 0.3s ease;
}

.login-form-control {
    border: 2px solid #e0e0e0;
    border-left: none;
    transition: all 0.3s ease;
    font-size: 1rem;
    padding: 12px 16px;
}

.login-form-control:focus {
    border-color: #9b5b46;
    box-shadow: 0 0 0 0.2rem rgba(155, 91, 70, 0.25);
    border-left: 2px solid #9b5b46;
}

.login-form-control:focus + .login-input-group-text,
.login-form-control:focus ~ .login-input-group-text {
    border-color: #9b5b46;
}

.login-password-input {
    border-left: none;
    border-right: none;
}

.login-eye-btn {
    border: 2px solid #e0e0e0;
    border-left: none;
    background: linear-gradient(135deg, #f8edeb 0%, #ece4db 100%);
    transition: all 0.3s ease;
}

.login-eye-btn:hover {
    background: linear-gradient(135deg, #ece4db 0%, #e0d4c8 100%);
    transform: translateY(-1px);
}

.login-btn-primary {
    background: linear-gradient(135deg, #c47d65 0%, #9b5b46 50%, #6b3b2d 100%);
    border: none;
    color: white;
    box-shadow: 0 4px 8px rgba(155, 91, 70, 0.3);
    transition: all 0.3s ease;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 8px;
}

.login-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #9b5b46 0%, #7d4835 50%, #5c3425 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(155, 91, 70, 0.4);
}

.login-btn-primary:disabled {
    color: white;
    opacity: 0.75;
}

.login-btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 50%, #198754 100%);
    border: none;
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 8px;
}

.login-btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #20c997 0%, #198754 50%, #157347 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(40, 167, 69, 0.4);
}

.login-mode-switch {
    border-top: 1px solid #e9ecef;
    margin-top: 1rem;
    padding-top: 1rem;
}

.login-mode-link {
    color: #9b5b46;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.login-mode-link:hover {
    color: #6b3b2d;
    text-decoration: underline;
}

/* Animation for form transitions */
.login-form-enter-active,
.login-form-leave-active {
    transition: all 0.3s ease;
}

.login-form-enter-from,
.login-form-leave-to {
    opacity: 0;
    transform: translateY(10px);
}

/* Language Mismatch Modal Styles */
.lang-confirm-btn {
    text-align: left;
    display: flex;
    align-items: center;
    font-weight: 500;
    padding: 12px 16px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, #c47d65 0%, #9b5b46 50%, #6b3b2d 100%) border-box;
    color: #9b5b46;
}

.lang-confirm-btn:hover {
    background: linear-gradient(135deg, #c47d65 0%, #9b5b46 50%, #6b3b2d 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(155, 91, 70, 0.3);
}

.lang-confirm-btn i {
    width: 24px;
    text-align: center;
    margin-right: 8px;
}

/* Language mismatch modal info alert */
#languageMismatchModal .alert-warning {
    background: linear-gradient(135deg, #fae1dd 0%, #f8edeb 100%);
    border: 1px solid #fcd5ce;
    border-left: 4px solid #9b5b46;
    font-size: 0.9rem;
    color: #6b3b2d;
}

#languageMismatchModal .modal-header {
    background: linear-gradient(135deg, #c47d65 0%, #9b5b46 50%, #6b3b2d 100%);
    border-bottom: none;
}

#languageMismatchModal .modal-header .text-warning {
    color: rgba(255, 255, 255, 0.9) !important;
}

#languageMismatchModal .modal-title {
    color: white;
    font-weight: 600;
}

#languageMismatchModal .btn-close {
    filter: invert(1) grayscale(1) brightness(2);
}

.modal-footer .btn {
    background-color: #c47d65;
}

/* Add a subtle animation to the detected languages list */
#detectedLanguagesList {
    animation: slideInUp 0.4s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Add to Notebook Button Styles */
#addToNotebookBtn {
    color: #9b5b46;
    transition: all 0.3s ease;
    border: 2px solid #9b5b46;
}

#addToNotebookBtn:hover {
    background-color: #9b5b46;
    color: white;
    transform: scale(1.05);
}

/* Added state */
#addToNotebookBtn.added {
    background-color: #6b3b2d !important;
    color: white !important;
    border-color: #6b3b2d !important;
}

#addToNotebookBtn.added:hover {
    background-color: #3a2a1a !important;
    border-color: #3a2a1a !important;
    transform: scale(1.05);
}

/* Pulse animation for successful add */
@keyframes pulse-terracotta {
    0% {
        box-shadow: 0 0 0 0 rgba(155, 91, 70, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(155, 91, 70, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(155, 91, 70, 0);
    }
}

#addToNotebookBtn.pulse {
    animation: pulse-terracotta 0.6s ease-out;
}

/* Notebook Word Wheel Styles */
.notebook-word-selector {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 40px 0;
}

.word-wheel-frame {
    position: relative;
    width: 140px;
    height: 480px;
    margin: 0 auto;
    overflow: hidden;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #f8edeb;
}

.word-wheel {
    position: relative;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.word-wheel::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.word-option {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 4px 8px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #6c757d;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    word-wrap: break-word;
    hyphens: auto;
    margin: 2px 0;
    position: relative;
}

.word-option:hover {
    background: #fae1dd;
    color: #6b3b2d;
}

.word-option.active {
    background: linear-gradient(135deg, #c47d65 0%, #9b5b46 50%, #6b3b2d 100%);
    color: white;
    font-weight: 600;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3);
}


/* Scroll Indicators */
.scroll-indicators {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 2;
}

.scroll-arrow {
    width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9b5b46;
    font-size: 10px;
    opacity: 0.7;
    animation: breathe 2s ease-in-out infinite;
}

.scroll-arrow-up {
    animation-delay: 0s;
}

.scroll-arrow-down {
    animation-delay: 1s;
}

@keyframes breathe {
    0%, 100% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* Spacer elements for centering */
.word-option.spacer {
    pointer-events: none;
    user-select: none;
}

/* Base styles for word options - depth effects will be applied via JavaScript */
.word-option {
    transition: all 0.3s ease;
}

/* Center word (active) gets full emphasis */
.word-option.active {
    opacity: 1 !important;
    font-size: 16px !important;
    transform: scale(1.1) !important;
}

/* Don't apply depth effects to spacer elements */
.word-option.spacer {
    opacity: 0 !important;
    transform: none !important;
}

/* Notebook section styles */
#notebookSection {
    animation: fadeIn 0.4s ease-out;
}

/* Reduce spacing in notebook header */
#notebookSection .col-12.mb-4 {
    margin-bottom: 1rem !important; /* Reduce from mb-4 (1.5rem) to 1rem */
}

#notebookSection .col-12.mb-3 {
    margin-bottom: 0.75rem !important; /* Reduce back button margin too */
}

/* Notebook Header Redesign */
.notebook-header {
    background: linear-gradient(135deg, #c47d65 0%, #9b5b46 50%, #6b3b2d 100%) !important;
    border: none;
    padding: 0.5rem 0.75rem;
    position: relative;
    overflow: hidden;
}

.notebook-navigator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    height: 2.5rem;
}

.nav-arrow {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-size: 1rem;
}

.nav-arrow:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-arrow:active {
    transform: translateY(0);
}

.notebook-selector-wrapper {
    flex: 1;
    max-width: 400px;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
}

.notebook-selector {
    display: flex;
    transition: transform 0.3s ease;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.notebook-selector::-webkit-scrollbar {
    display: none;
}

.notebook-item {
    flex: 0 0 auto;
    padding: 0.5rem 1.25rem;
    text-align: center;
    font-weight: 500;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
    background: transparent;
}

.notebook-item.notebook-add-btn {
    padding: 0.5rem 0.9rem;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.notebook-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.notebook-item.active {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    font-weight: 600;
}

.notebook-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: white;
    border-radius: 2px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .notebook-navigator {
        gap: 0.5rem;
    }
    
    .nav-arrow {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
    
    .notebook-selector-wrapper {
        max-width: 250px;
    }
    
    .notebook-item {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Notebook layout improvements - equal height columns */
#notebookSection .row .col-md-3,
#notebookSection .row .col-md-9 {
    display: flex;
    flex-direction: column;
    min-height: 0; /* Allow columns to shrink */
    max-height: 100%;
    overflow: auto; /* scrollable */
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* Main notebook card containing everything */
#notebookSection .col-12.mb-4 > .card {
    height: 85vh; /* Set height for the main container card */
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

/* Main container card body */
#notebookSection .col-12.mb-4 > .card > .card-body {
    flex: 1;
    overflow: hidden;
    padding: 0;
}

#notebookSection .col-12.mb-4 > .card > .card-body > .row {
    height: 100%;
    margin: 0;
    padding: 1rem;
    overflow: hidden; /* Prevent row from overflowing */
}

#notebookSection .col-12.mb-4 > .card > .card-body > .row > .col-12 {
    height: 100%;
}

#notebookSection .card.shadow {
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#notebookSection .card.shadow .card-header {
    flex-shrink: 0; /* Header keeps its natural height */
}

#notebookSection .card.shadow .card-body {
    flex: 1; /* Body takes remaining space */
    overflow: hidden; /* Prevent body from overflowing */
}

/* Left sidebar card (word wheel) */
#notebookSection .col-md-3 .card {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

#notebookSection .col-md-3 .card-body {
    flex: 1;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Right sidebar card (content) */
#notebookSection .col-md-9 .card {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.notebook-word-selector {
    flex: 1;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center the wheel vertically */
    align-items: center; /* Center the wheel horizontally */
}

.word-wheel-frame {
    height: 55%; /* Reduce to 2/3 of current height */
    max-height: none;
    min-height: 300px;
}

/* Right sidebar card body and tabs */
#notebookSection .col-md-9 .card-header {
    flex-shrink: 0;
}

#notebookSection .col-md-9 .card-body {
    flex: 1;
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
}

#notebookSection .col-md-9 .tab-content {
    flex: 1;
    overflow-y: auto;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    min-height: 0; /* This is the key fix - allows flex child to shrink */
}

/* Browse content area - ensure proper scrolling */
#browseContent {
    min-height: auto; /* Remove fixed min-height */
    max-height: none; /* Let it scroll naturally */
    flex: 1;
    overflow-y: auto; /* Allow internal scrolling if needed */
}

#browseEmptyState {
    padding: 60px 20px;
    font-size: 16px;
}

/* Review content area */

/* Review Cards Container */
.review-cards-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 300px;
}

/* Word and Language Card - Fixed height */
.review-card-item.word-language-card {
    flex: 0 0 auto;
    min-height: 120px;
    max-height: 120px;
    min-width: 360px;
    width: 80%;
    margin: 0 auto;
}

#reviewLanguage {
    align-self: center;
}

/* Definition Card - Takes remaining space */
.definition-card {
    flex: 1;
    min-height: 0;
    perspective: 1000px;
    min-width: 360px;
    width: 80%;
    margin: 0 auto;
}

.review-card-item .card {
    height: 100%;
    border: none;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.review-card-item .card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

/* Definition Card Reveal */
.review-card-flip {
    position: relative;
    width: 100%;
    height: 100%;
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    transition: opacity 0.35s ease;
}

.card-front {
    z-index: 2;
    opacity: 1;
    pointer-events: auto;
}

.card-back {
    z-index: 1;
    opacity: 0;
    pointer-events: none;
}

.review-card-flip.flipped .card-front {
    opacity: 0;
    pointer-events: none;
}

.review-card-flip.flipped .card-back {
    opacity: 1;
    pointer-events: auto;
    z-index: 3;
}

.review-word {
    font-family: Georgia, 'Palatino Linotype', serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #3a2a1a;
    margin-bottom: 1rem;
    letter-spacing: 0.01em;
}

.review-word-back {
    font-family: Georgia, 'Palatino Linotype', serif;
    font-size: 1.6rem;
    font-weight: 600;
    color: #3a2a1a;
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
}

.review-word-info .badge {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

#showAnswerBtn {
    font-size: 1.1rem;
    padding: 0.75rem 2rem;
    border-width: 2px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#showAnswerBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(155, 91, 70, 0.3);
}

/* Review Definitions */
.card-back .card-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.review-definitions {
    text-align: left;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 8px;
}

.review-definitions .definition-item {
    background-color: #fae1dd;
    border: 1px solid #fcd5ce;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.review-definitions .definition-text {
    font-size: 1rem;
    color: #495057;
    margin-bottom: 0.5rem;
}

.review-definitions .example-item {
    background: none;
    border-left: 2px solid #ddc9bb;
    padding: 4px 0 4px 12px;
    margin-bottom: 0.5rem;
    border-radius: 0 4px 4px 0;
    font-style: italic;
    color: #856404;
}

/* Review Buttons */
.review-buttons {
    flex-shrink: 0;
    margin-top: auto;
    display: flex;
    flex-direction: column;
}

.review-buttons .row {
    flex: 1;
    margin: 0;
}

.review-btn {
    height: 60px;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    background: white;
    border: 2px solid;
}

/* Per-difficulty colors */
.review-btn[data-difficulty="again"] { color: #8b2e1e; border-color: #8b2e1e; }
.review-btn[data-difficulty="hard"]  { color: #9a5c1a; border-color: #9a5c1a; }
.review-btn[data-difficulty="good"]  { color: #4a6e44; border-color: #4a6e44; }
.review-btn[data-difficulty="easy"]  { color: #5a6e1a; border-color: #5a6e1a; }

.review-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.12); }
.review-btn[data-difficulty="again"]:hover:not(:disabled) { background-color: #8b2e1e; color: white; }
.review-btn[data-difficulty="hard"]:hover:not(:disabled)  { background-color: #9a5c1a; color: white; }
.review-btn[data-difficulty="good"]:hover:not(:disabled)  { background-color: #4a6e44; color: white; }
.review-btn[data-difficulty="easy"]:hover:not(:disabled)  { background-color: #5a6e1a; color: white; }

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

/* Selected state (pressed during countdown) */
.review-btn[data-difficulty="again"].selected { background-color: #8b2e1e; color: white; border-color: #8b2e1e; }
.review-btn[data-difficulty="hard"].selected  { background-color: #9a5c1a; color: white; border-color: #9a5c1a; }
.review-btn[data-difficulty="good"].selected  { background-color: #4a6e44; color: white; border-color: #4a6e44; }
.review-btn[data-difficulty="easy"].selected  { background-color: #5a6e1a; color: white; border-color: #5a6e1a; }

/* Dimmed state (non-selected during countdown) */
.review-btn.dimmed { opacity: 0.3; }

.review-btn i { font-size: 1rem; }

/* Countdown bar */
.review-countdown {
    height: 4px;
    background: #ece4db;
    border-radius: 2px;
    margin-top: 10px;
    overflow: hidden;
}

.review-countdown-bar {
    height: 100%;
    width: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, #c47d65, #9b5b46);
}

/* Review Complete State */
.review-complete {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.review-complete i {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    80% {
        transform: translateY(-5px);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .review-card {
        max-width: 100%;
        height: 300px;
    }
    
    .review-word {
        font-size: 2rem;
    }
    
    .review-word-back {
        font-size: 1.5rem;
    }
    
    .review-btn {
        height: 70px;
        font-size: 0.9rem;
    }
    
    .review-btn i {
        font-size: 1rem;
    }
}


/* Bottom Navigation Bar */
.bottom-navbar {
    background: linear-gradient(135deg, #c47d65 0%, #9b5b46 50%, #6b3b2d 100%);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    padding: 0;
}

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

.bottom-navbar .nav-item {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    min-width: 120px;
    backdrop-filter: blur(10px);
}

.bottom-navbar .nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.bottom-navbar .nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3),
                0 4px 16px rgba(0, 0, 0, 0.3);
}

.bottom-navbar .nav-item.active::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: white;
    border-radius: 2px;
}

.nav-icon {
    font-size: 1.4rem;
    margin-bottom: 0.3rem;
    transition: transform 0.3s ease;
}

.bottom-navbar .nav-item:hover .nav-icon,
.bottom-navbar .nav-item.active .nav-icon {
    transform: scale(1.1);
}

.nav-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Animation for switching between nav items */
.bottom-navbar .nav-item:active {
    transform: translateY(1px);
}

/* Ensure content doesn't get hidden behind the navbar */
body {
    padding-bottom: 80px;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .nav-container {
        gap: 1rem;
        padding: 0.5rem;
    }
    
    .bottom-navbar .nav-item {
        min-width: 100px;
        padding: 0.5rem 1rem;
    }
    
    .nav-icon {
        font-size: 1.2rem;
    }
    
    .nav-label {
        font-size: 0.7rem;
    }
    
    body {
        padding-bottom: 70px;
    }
}

/* Hamburger Dropdown Menu */
.dropdown-menu {
    background-color: #ece4db;
    border: 1px solid #ddc9bb;
    border-top: 3px solid #9b5b46;
    border-radius: 0 12px 12px 12px;
    box-shadow: 0 10px 28px rgba(107, 59, 45, 0.18);
    min-width: 210px;
    padding: 0.35rem 0 0.5rem;
    animation: dropdownSlideIn 0.15s ease-out;
}

@keyframes dropdownSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    color: #6b3b2d;
    padding: 9px 18px;
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 11px;
    background: none;
    transition: background-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.dropdown-item i {
    width: 16px;
    text-align: center;
    color: #9b5b46;
    font-size: 0.82rem;
    flex-shrink: 0;
    transition: transform 0.18s ease, color 0.18s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: #fae1dd;
    color: #6b3b2d;
    box-shadow: inset 3px 0 0 #9b5b46;
}

.dropdown-item:hover i,
.dropdown-item:focus i {
    transform: scale(1.2);
    color: #6b3b2d;
}

.dropdown-header {
    color: #9b5b46;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 8px 18px 3px;
}

.dropdown-divider {
    border-color: #ddc9bb;
    margin: 0.3rem 1rem;
    opacity: 1;
}

/* Dropdown Submenu Styles */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    position: absolute;
    top: 0;
    left: 100%;
    margin-top: 0;
    margin-left: 1px;
    min-width: 200px;
    display: none;
    border-top: 3px solid #9b5b46;
    border-radius: 0 12px 12px 12px;
    z-index: 1050;
    animation: none;
}

.dropdown-submenu:hover .dropdown-menu,
.dropdown-submenu.show .dropdown-menu {
    display: block;
}

.dropdown-submenu .dropdown-toggle::after {
    transform: rotate(-90deg);
    float: none;
    margin-left: auto;
    margin-top: 0;
    align-self: center;
}

/* Notebook submenu item styling */
.notebook-submenu-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 18px;
    color: #6b3b2d;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.notebook-submenu-item i {
    width: 16px;
    text-align: center;
    color: #9b5b46;
    font-size: 0.82rem;
    flex-shrink: 0;
    transition: transform 0.18s ease, color 0.18s ease;
}

/* Review Tab Styles */
.review-container {
    padding: 1rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.review-progress {
    flex-shrink: 0;
}

.review-stats {
    font-weight: 600;
    color: #495057;
}

.progress {
    background-color: #e9ecef;
    border-radius: 4px;
}

.progress-bar {
    background: linear-gradient(135deg, #28a745 0%, #20c997 50%, #198754 100%);
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* Review progress styling */
.progress.mt-2 {
    flex-direction: column;
    gap: 8px;
    height: auto;
}

.progress-segmented {
    height: 20px;
    border-radius: 4px;
    overflow: hidden;
    background-color: #f8f9fa;
}

.progress-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    font-weight: 500;
}

.progress-segment.learning {
    background-color: #6c757d;
}

.progress-segment.review {
    background-color: #198754;
}

.progress-segment.relearn {
    background-color: #fd7e14;
}

.progress-legend {
    font-size: 10px;
    color: #6c757d;
}

/* Notebook browser item styling */
.notebook-browser-item {
    border: 1px solid #e9ecef !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.notebook-browser-item:hover {
    border-color: #9b5b46 !important;
    box-shadow: 0 4px 12px rgba(155, 91, 70, 0.15);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.notebook-browser-item h6 {
    color: #2c3e50;
    font-weight: 600;
}

.notebook-browser-item .text-primary {
    color: #9b5b46 !important;
}

.notebook-browser-item:hover .fas.fa-chevron-right {
    color: #9b5b46 !important;
    transform: translateX(3px);
}

.notebook-submenu-item:hover {
    background-color: #fae1dd;
    color: #6b3b2d;
    text-decoration: none;
    box-shadow: inset 3px 0 0 #9b5b46;
}

.notebook-submenu-item:hover i {
    transform: scale(1.2);
    color: #6b3b2d;
}

.notebook-submenu-item .notebook-info {
    flex: 1;
}

.notebook-submenu-item .word-count {
    font-size: 0.72rem;
    color: #9b5b46;
    margin-left: auto;
    font-weight: 600;
    opacity: 0.7;
}

/* ============================================================
   TYPOGRAPHY SYSTEM
   ============================================================ */

/* Headword — serif face mirrors how print dictionaries set the entry word */
#searchedWord {
    font-family: Georgia, 'Palatino Linotype', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #3a2a1a;
    letter-spacing: 0.01em;
}

/* Pronunciation — phonetic context, keep monospace feel but tune size */
#pronunciation {
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    color: #6b3b2d;
}

/* Etymology section header — small caps label */
.etymology-toggle {
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
}

/* Badges — compact, tracked, authority of a stamp */
.badge {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

/* Global button refinement */
.btn {
    font-size: 0.82rem;
    letter-spacing: 0.03em;
}

/* Form labels — small, tracked, purposeful */
.form-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #6b3b2d;
}

/* Form inputs */
.form-control {
    font-size: 0.875rem;
}
.form-text {
    font-size: 0.72rem;
    letter-spacing: 0.02em;
}

/* Card header h4/h5 — modal titles, section heads */
.card-header h4,
.card-header h5,
.modal-title {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

/* Notebook selector items */
.notebook-item {
    font-size: 0.8rem;
    letter-spacing: 0.03em;
}

/* Review difficulty buttons */
.review-btn {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Review stats / progress labels */
.review-stats {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.progress-legend {
    font-size: 0.68rem;
    letter-spacing: 0.04em;
}

/* Empty state and muted helper text */
.empty-state,
.text-muted {
    font-size: 0.82rem;
}

/* Word wheel options */
.word-option {
    font-size: 0.8rem;
}

/* Toast notifications */
.toast-success { background-color: #6b3b2d; }
.toast-error   { background-color: #8b2e1e; }
.toast-warning { background-color: #9a5c1a; }
.toast-info    { background-color: #7a5547; }

/* History navigation arrows */
.history-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #c4a898;
    background: white;
    color: #7a5547;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    z-index: 10;
    padding: 0;
}

.history-nav-btn:hover:not(:disabled) {
    background-color: #9b5b46;
    border-color: #9b5b46;
    color: white;
}

.history-nav-btn:disabled {
    opacity: 0.25;
    cursor: default;
}

.history-nav-prev { left: 0; }
.history-nav-next { right: 0; }

/* Search suggestions */
.search-suggestion {
    font-size: 0.82rem;
    letter-spacing: 0.01em;
}

/* Login card header */
.login-card-header h4 {
    font-size: 1rem;
    letter-spacing: 0.04em;
}

/* Second input-group-lg override (duplicated selector lower in file) */
.input-group-lg .form-control {
    font-size: 0.95rem;
}

/* Profile Page */
.profile-info {
    margin: 0;
}

.profile-info dt {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #9b5b46;
    margin-top: 1rem;
    margin-bottom: 0.1rem;
}

.profile-info dt:first-child {
    margin-top: 0;
}

.profile-info dd {
    font-size: 0.875rem;
    color: #3a2a1a;
    margin: 0;
    font-weight: 400;
}

.profile-notebook-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 9px 12px;
    margin-bottom: 6px;
    border-radius: 8px;
    background-color: #fae1dd;
    border-left: 3px solid #9b5b46;
    transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.profile-notebook-item:hover {
    background-color: #fcd5ce;
    box-shadow: inset 3px 0 0 #6b3b2d;
}

.profile-notebook-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #3a2a1a;
    letter-spacing: 0.01em;
}

.profile-notebook-count {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #9b5b46;
    text-transform: uppercase;
}
