/* Cantonese Dictionary Styles - Light Theme */

/* Dictionary Loading Banner */
.dict-loading-banner {
    background: #f1f2f6;
    color: #2c3e50;
    padding: 16px 24px;
    margin: 0 -20px 20px;
    border-radius: 0;
    box-shadow: none;
    animation: fadeIn 0.3s ease;
    transition: opacity 0.3s ease;
}

.dict-loading-content {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 900px;
    margin: 0 auto;
}

.dict-loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #dcdfe6;
    border-top-color: #2c3e50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}

.dict-loading-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dict-loading-text strong {
    font-size: 15px;
    font-weight: 600;
}

.dict-loading-text span {
    font-size: 13px;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .dict-loading-banner {
        margin: 0 -16px 16px;
        padding: 12px 16px;
    }
    
    .dict-loading-content {
        gap: 12px;
    }
    
    .dict-loading-text strong {
        font-size: 14px;
    }
    
    .dict-loading-text span {
        font-size: 12px;
    }
}

.cantonese-container {
    min-height: calc(100vh - 80px);
    background: #F6FAFD;
    color: #2c3e50;
    padding: 10px 20px 60px;
}

.cantonese-title {
    font-size: 48px;
    font-weight: 700;
    color: #2c3e50;
    margin: 10px 0;
}

.cantonese-subtitle {
    font-size: 18px;
    color: #5a6c7d;
    margin: 0 0 8px 0;
    font-weight: 500;
}

.cantonese-description {
    font-size: 14px;
    color: #7f8c9a;
    margin: 0;
    line-height: 1.6;
}

/* Search Section */
.search-section {
    max-width: 900px;
    margin: 0 auto 16px;
}

.search-bar-container {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    margin-top: 10px;
}

.search-bar-wrapper {
    position: relative;
    flex: 1;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #949ba4;
    pointer-events: none;
}

.search-clear-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #949ba4;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.search-clear-btn:hover {
    color: #2c3e50;
}

.search-clear-btn.visible {
    display: flex;
}

.search-input {
    width: 100%;
    padding: 12px 80px 12px 48px;
    background: #ffffff;
    border: 2px solid #DBDCDF;
    border-radius: 99px;
    font-size: 16px;
    color: #2c3e50;
    transition: all 0.2s;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    background: #ffffff;
    border-color: #1D9BF0;
    box-shadow: 0 0 0 3px rgba(19, 91, 255, 0.1);
}

.search-input::placeholder {
    color: #95a5a6;
}

.search-history-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    margin-top: 4px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search-history-item {
    padding: 12px 16px;
    color: #2c3e50;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.search-history-item:hover {
    background: #f5f7fa;
}

.search-history-delete {
    color: #95a5a6;
    font-size: 18px;
    padding: 0 4px;
    transition: color 0.2s;
}

.search-history-delete:hover {
    color: #e74c3c;
}

.favorites-btn {
    padding: 10px 20px;
    background: #ffffff;
    border: 2px solid #1D9BF0;
    border-radius: 99px;
    color: #1D9BF0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.favorites-btn:hover {
    background: #1D9BF0;
    color: #ffffff;
}

.favorites-btn svg {
    width: 16px;
    height: 16px;
}

.favorites-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: #ffffff;
    border-left: 1px solid #e1e8ed;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.favorites-panel.active {
    right: 0;
}

.favorites-header {
    padding: 20px;
    border-bottom: 1px solid #e1e8ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.favorites-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.favorites-close {
    background: none;
    border: none;
    color: #949ba4;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.favorites-close:hover {
    color: #2c3e50;
}

.favorites-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.favorite-item {
    background: #f8fafb;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.favorite-item:hover {
    background: #edf2f7;
    border-color: #1D9BF0;
}

.favorite-word {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 4px;
}

.favorite-preview {
    font-size: 13px;
    color: #7f8c9a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.favorite-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    background: #f8fafb;
    border: none;
    border-radius: 50%;
    color: #85899E;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.favorite-btn:hover {
    background: #edf2f7;
    color: #2c3e50;
}

.favorite-btn.favorited {
    background: #edf2f7;
    color: #1D9BF0;
}

.favorite-btn svg {
    width: 20px;
    height: 20px;
}

/* Search Tabs */
.search-tabs {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.search-label {
    font-size: 14px;
    color: #b5bac1;
    font-weight: 600;
}

.search-tab {
    padding: 8px 16px;
    background: #ffffff;
    border: 1px solid #e1e8ed;
    border-radius: 99px;
    color: #5a6c7d;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.search-tab:hover {
    background: #f5f7fa;
    border-color: #1D9BF0;
    color: #2c3e50;
}

.search-tab.active {
    background: #1D9BF0;
    border-color: #1D9BF0;
    color: #ffffff;
}

/* Dictionary Content */
.dictionary-content {
    max-width: 1400px;
    margin: 16px auto 0;
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
    padding: 0 24px;
}

/* Results Panel */
.results-panel {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e1e8ed;
    overflow: hidden;
    box-shadow: none;
}

.results-list {
    padding: 12px;
    height: calc(100vh - 330px);
    overflow-y: auto;
}

.results-list::-webkit-scrollbar {
    width: 8px;
}

.results-list::-webkit-scrollbar-track {
    background: #f5f7fa;
}

.results-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.results-list::-webkit-scrollbar-thumb:hover {
    background: #1D9BF0;
}

.result-item {
    padding: 14px 16px;
    background: #f8fafb;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.result-item:hover {
    background: #edf2f7;
    border-color: #1D9BF0;
}

.result-item.active {
    background: #1D9BF0;
    border-color: #1D9BF0;
}

.result-item.active .result-word {
    color: #ffffff;
}

.result-item.active .result-pronunciation,
.result-item.active .result-preview {
    color: #ffffff;
    opacity: 1;
}

.result-item.active .result-pronunciation {
    font-size: 13px;
    font-weight: 600;
}

.result-item.active .sentence-word,
.result-item.active .sentence-label,
.result-item.active .sentence-preview {
    color: #ffffff !important;
}

.result-word {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 4px;
}

.result-word.traditional {
    color: #3ba55d;
}

.result-word.simplified {
    color: #faa81a;
}

.result-pronunciation {
    font-size: 12px;
    color: #5a6c7d;
    margin-bottom: 6px;
    font-family: 'Courier New', monospace;
}

.pronunciation-label {
    font-weight: 600;
    margin-right: 4px;
}

.result-preview {
    font-size: 13px;
    color: #7f8c9a;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c9a;
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    margin: 8px 0;
    font-size: 14px;
}

.empty-hint {
    font-size: 13px;
    color: #95a5a6;
}

/* Detail Panel */
.detail-panel {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e1e8ed;
    padding: 32px;
    overflow-y: auto;
    height: calc(100vh - 330px);
    box-shadow: none;
}

.detail-panel::-webkit-scrollbar {
    width: 8px;
}

.detail-panel::-webkit-scrollbar-track {
    background: #f5f7fa;
}

.detail-panel::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.detail-panel::-webkit-scrollbar-thumb:hover {
    background: #1D9BF0;
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 40px 20px;
}

.welcome-message h2 {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 16px;
}

.welcome-message p {
    font-size: 16px;
    color: #5a6c7d;
    margin-bottom: 24px;
}

.feature-list {
    text-align: left;
    max-width: 400px;
    margin: 0 auto 32px;
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 10px 0;
    font-size: 14px;
    color: #b5bac1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.feature-icon {
    color: #3ba55d;
    font-weight: 700;
    font-size: 16px;
}

.hint-text {
    font-size: 13px;
    color: #6d6f78;
    font-style: italic;
}

/* Word Detail */
.word-detail {
    animation: fadeIn 0.3s ease;
}

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

.word-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e1e8ed;
}

.word-main {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.word-chinese {
    font-size: 48px;
    font-weight: 700;
    color: #2c3e50;
}

.word-variants {
    margin-top: 12px;
    padding: 12px;
    background: #f8fafb;
    border-radius: 6px;
    font-size: 14px;
    color: #5a6c7d;
}

.variant-label {
    font-weight: 700;
    color: #7f8c9a;
    margin-right: 8px;
}

.word-pronunciation-section {
    background: #f8fafb;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    border: 1px solid #e1e8ed;
}

.pronunciation-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-family: 'Courier New', monospace;
}

.pronunciation-row:last-child {
    margin-bottom: 0;
}

.pronunciation-row .pronunciation-label {
    min-width: 50px;
    font-size: 12px;
    font-weight: 700;
    color: #7f8c9a;
    text-transform: uppercase;
}

.pronunciation-row .pronunciation-value {
    font-size: 16px;
    color: #2c3e50;
}

.pronunciation-audio {
    background: none;
    border: none;
    color: #5a6c7d;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.pronunciation-audio:hover {
    color: #1D9BF0;
}

.pronunciation-audio svg {
    width: 18px;
    height: 18px;
}

/* Definitions Section */
.definitions-section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: #949ba4;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.definition-group {
    background: #f8fafb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.definition-number {
    display: inline-block;
    min-width: 24px;
    height: 24px;
    background: #1D9BF0;
    color: #ffffff;
    border-radius: 12px;
    text-align: center;
    line-height: 24px;
    font-size: 13px;
    font-weight: 700;
    margin-right: 12px;
}

.definition-text {
    font-size: 15px;
    color: #2c3e50;
    line-height: 1.6;
}

.definition-source {
    font-size: 12px;
    color: #7f8c9a;
    margin-top: 8px;
    font-style: italic;
}

/* Sentences Section */
.sentences-section {
    margin-bottom: 32px;
}

.sentence-item {
    background: #f8fafb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    border-left: 3px solid #1D9BF0;
}

.sentence-lang-label {
    display: inline-block;
    padding: 2px 8px;
    background: #1D9BF0;
    color: #ffffff;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.sentence-text {
    font-size: 15px;
    color: #2c3e50;
    margin-bottom: 6px;
    line-height: 1.6;
}

.sentence-romanization {
    font-size: 13px;
    color: #5a6c7d;
    font-family: 'Courier New', monospace;
    margin-bottom: 6px;
}

.sentence-translation {
    font-size: 14px;
    color: #7f8c9a;
    font-style: italic;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e1e8ed;
}

.action-btn {
    padding: 10px 16px;
    background: #ffffff;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    color: #5a6c7d;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn:hover {
    background: #1D9BF0;
    border-color: #1D9BF0;
    color: #ffffff;
}

.action-btn svg {
    width: 16px;
    height: 16px;
}

/* Loading State */
.loading-spinner {
    text-align: center;
    padding: 40px;
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #e1e8ed;
    border-top-color: #1D9BF0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 1024px) {
    .dictionary-content {
        grid-template-columns: 320px 1fr;
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .cantonese-container {
        padding: 24px 16px 40px;
    }

    .cantonese-title {
        font-size: 24px;
    }

    .cantonese-subtitle {
        font-size: 16px;
    }

    .cantonese-description {
        font-size: 13px;
    }

    .dictionary-content {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .results-panel {
        max-height: 300px;
    }

    .results-list {
        max-height: 260px;
    }

    .detail-panel {
        padding: 20px;
        max-height: none;
    }

    .word-chinese {
        font-size: 36px;
    }

    .search-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .search-tab {
        flex-shrink: 0;
    }
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background-color: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}
