/* Base Styles */
:root {
    --primary-color: #00d4ff;
    --secondary-color: #00a0cc;
    --accent-color: #4ecdc4;
    --background-color: #1a1a2e;
    --card-bg: rgba(255, 255, 255, 0.1);
    --text-color: #eee;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --border-color: rgba(0, 212, 255, 0.3);
    --gradient-start: #00d4ff;
    --gradient-end: #0f3460;
}

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

h1, h1 * {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Loading state */
body.loading {
    position: relative;
    overflow: hidden;
}

body.loading::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 46, 0.8);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
    visibility: visible;
    backdrop-filter: blur(5px);
}

body.loaded::before {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-message {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-top: 1rem;
    text-align: center;
    z-index: 10000;
    position: relative;
}

.loading-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    font-size: 1.2em;
    font-weight: 500;
    color: var(--text-color);
    opacity: 1;
    transition: opacity 0.3s ease-out;
}

body.loading .loading-message {
    opacity: 1;
}

body.loaded .loading-message {
    opacity: 0;
    pointer-events: none;
}


/* Body styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background: #f0f4f8; /* Soothing light blue-gray */
    color: var(--text-color);
    min-height: 100vh;
    line-height: 1.6;
    padding: 0;
    margin: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.01em;
}

body.loaded {
    opacity: 1;
}

.container {
    max-width: 900px;
    width: 90%;
    margin: 2rem auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: relative;
    z-index: 1;
}

h1 {
    color: white;
    margin: 20px 0 30px;
    font-size: 2.2em;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    padding: 15px 25px;
    border-radius: 10px;
    width: 100%;
    max-width: 800px;
    box-sizing: border-box;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* Selected Categories */
.selected-categories {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.selected-categories-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.selected-categories-list {
    min-height: 60px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.selected-categories-list .no-categories {
    color: #718096;
    font-style: italic;
    margin: 0;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    background: var(--category-color, rgba(0, 180, 216, 0.95));
    color: white !important;
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    transition: all 0.2s ease;
    margin: 0.1rem 0.25rem;
    backdrop-filter: blur(2px);
    text-transform: capitalize;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    z-index: 1;
}

.category-chip .remove-chip {
    background: rgba(0, 0, 0, 0.2);
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    margin-left: 0.25rem;
    width: 16px;
    height: 16px;
    font-size: 0.7rem;
    line-height: 1;
}

.category-chip .remove-chip:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: scale(1.1);
}

.category-chip .remove-chip:active {
    transform: scale(0.95);
}

/* Category Picker Modal */
#categoryPickerModal .modal-content {
    max-width: 600px;
    padding: 0;
    overflow: hidden;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #edf2f7;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #2d3748;
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #edf2f7;
    display: flex;
    justify-content: space-between;
    background: #f8fafc;
}

.category-management {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #edf2f7;
}

.add-category-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.add-category-form .form-control {
    flex: 1;
}

.category-import {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-outline {
    background: white;
    border: 1px solid #e2e8f0;
    color: #4a5568;
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e0;
}

/* Category List */
.category-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 0 0.5rem;
}

.category-item {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-item:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.category-item input[type="checkbox"] {
    margin-right: 0.8rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.category-item label {
    cursor: pointer;
    flex: 1;
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-color);
}

/* Flashcard styles */
.flashcard {
    font-size: 1.3em;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    perspective: 1000px;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    cursor: pointer;
    width: 100%;
    max-width: 800px;
    margin: 0 auto 20px;
}

.category-btn, .select-all-btn {
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Navigation buttons - ensure they stay circular and match other buttons */
.card-controls .nav-btn {
    all: unset;
    background: var(--primary-color) !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-size: 1.1rem !important;
    padding: 0 !important;
    margin: 0 5px !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
    flex-shrink: 0 !important;
    line-height: 1 !important;
}

.card-controls .nav-btn i {
    color: white !important;
    font-size: 1.1rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.card-controls .nav-btn:not(:disabled):hover {
    background: var(--primary-hover) !important;
    transform: translateY(-2px) scale(1.05) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

.card-controls .nav-btn:active {
    background: var(--primary-active) !important;
    transform: translateY(0) scale(0.98) !important;
}

.card-controls .nav-btn:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5) !important;
}

.card-controls .nav-btn:disabled {
    background: #9ca3af !important;
    opacity: 0.7 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

.category-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.category-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.category-btn.active {
    background: linear-gradient(135deg, #ff9a56 0%, var(--accent-color) 100%);
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

.select-all-btn {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
    padding: 12px 25px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    min-width: 130px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.select-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* Flashcard Container */
.flashcard-container {
    perspective: 1000px;
    -webkit-perspective: 1000px;
    -moz-perspective: 1000px;
    width: 100%;
    height: calc(100vh - 220px);
    max-height: 650px;
    min-height: 350px;
    background: transparent;
    padding: 1rem 0;
    margin: 0;
    border: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Flashcard */
.flashcard {
    width: 100%;
    height: 400px;
    max-width: 800px;
    margin: 0 auto 30px;
    position: relative;
    perspective: 1500px;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

.flashcard.flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    padding: 30px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.card-face.back {
    transform: rotateY(180deg);
}

/* Flashcard Text Styles */
.german-text-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.german-text {
    font-size: 2.2em;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
    margin: 0;
}

.audio-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    font-size: 1.1em;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    outline: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
    margin-left: 8px;
}

.audio-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.audio-btn:active {
    background: var(--primary-active);
    transform: translateY(0) scale(0.98);
}

.audio-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

.audio-btn.playing {
    animation: pulse 1.5s infinite;
    background: var(--primary-hover);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 193, 7, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
    }
}

.audio-btn.playing {
    color: var(--accent-color);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.article {
    font-size: 1.5em;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.pronunciation {
    font-size: 1em;
    color: #95a5a6;
    font-style: italic;
    margin-bottom: 20px;
}

.category-tag {
    background: rgba(0, 0, 0, 0.1);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.75em;
    color: #555;
    font-weight: 500;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

#flashcard.flipped {
    transform: rotateY(180deg);
    -webkit-transform: rotateY(180deg);
    -moz-transform: rotateY(180deg);
    -ms-transform: rotateY(180deg);
    -o-transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border-radius: 15px;
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    box-sizing: border-box;
}

.front {
    background: linear-gradient(145deg, rgba(26, 26, 46, 0.9), rgba(21, 29, 59, 0.9));
    transform: rotateY(0);
}

.back {
    background: linear-gradient(145deg, rgba(21, 29, 59, 0.9), rgba(15, 23, 42, 0.9));
    transform: rotateY(180deg);
}

#flashcard.flipped {
    transform: rotateY(180deg);
}

.back-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Ensure front and back are properly positioned */
.front, .back {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.german-text {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0.5rem 0;
    color: var(--text-color);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
}

.sentence .german-text {
    font-size: 1.8rem;
}

.word-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 10px 0;
}

.word-controls .article {
    margin: 0;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-color);
}

.english-text {
    font-size: 1.6rem;
    color: var(--text-color);
    margin: 1.5rem 0;
    opacity: 0.9;
    font-weight: 400;
    line-height: 1.6;
}

.sentence .english-text {
    font-size: 1.4rem;
}

.article {
    font-size: 2rem;
    margin-right: 0.5rem;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
    font-weight: 500;
}

.pronunciation {
    font-style: italic;
    color: rgba(255, 255, 255, 0.7);
    margin: 1rem 0;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.category-tag {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: rgba(0, 212, 255, 0.2);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    border: 1px solid var(--primary-color);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    z-index: 1; /* Reduced from 2 to 1 */
}

.category-tag:hover {
    background: rgba(0, 212, 255, 0.3);
    transform: translateY(-2px);
}

.hint {
    position: absolute;
    bottom: 15px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Card Controls */
.card-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 25px 0;
    flex-wrap: wrap;
}

/* Base styles for all circular buttons */
.nav-btn, .flip-btn, .shuffle-btn, .btn, .btn-icon, .btn-outline-light, .btn-primary,
#prevBtn, #nextBtn, #flipBtn, #shuffleBtn,
.audio-btn, #clearAllBtn, #selectAllBtn, #addCategoryBtn,
#importBtn, #exportBtn {
    all: unset;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem;
    padding: 0;
    margin: 0 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    line-height: 1;
}

/* Icon styles */
.nav-btn i, .flip-btn i, .shuffle-btn i, .btn i, .btn-icon i, .btn-outline-light i, .btn-primary i,
#prevBtn i, #nextBtn i, #flipBtn i, #shuffleBtn i,
.audio-btn i, #clearAllBtn i, #selectAllBtn i, #addCategoryBtn i,
#importBtn i, #exportBtn i {
    color: white;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Hover state */
.nav-btn:not(:disabled):hover, .flip-btn:not(:disabled):hover, .shuffle-btn:not(:disabled):hover, 
.btn:not(:disabled):hover, .btn-icon:not(:disabled):hover, .btn-outline-light:not(:disabled):hover, .btn-primary:not(:disabled):hover,
#prevBtn:not(:disabled):hover, #nextBtn:not(:disabled):hover, #flipBtn:not(:disabled):hover, #shuffleBtn:not(:disabled):hover,
.audio-btn:not(:disabled):hover, #clearAllBtn:not(:disabled):hover, #selectAllBtn:not(:disabled):hover, #addCategoryBtn:not(:disabled):hover,
#importBtn:not(:disabled):hover, #exportBtn:not(:disabled):hover {
    background: var(--primary-hover);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Active state */
.nav-btn:active, .flip-btn:active, .shuffle-btn:active, 
.btn:active, .btn-icon:active, .btn-outline-light:active, .btn-primary:active,
#prevBtn:active, #nextBtn:active, #flipBtn:active, #shuffleBtn:active,
.audio-btn:active, #clearAllBtn:active, #selectAllBtn:active, #addCategoryBtn:active,
#importBtn:active, #exportBtn:active {
    background: var(--primary-active);
    transform: translateY(0) scale(0.98);
}

/* Focus state */
.nav-btn:focus, .flip-btn:focus, .shuffle-btn:focus, 
.btn:focus, .btn-icon:focus, .btn-outline-light:focus, .btn-primary:focus,
#prevBtn:focus, #nextBtn:focus, #flipBtn:focus, #shuffleBtn:focus,
.audio-btn:focus, #clearAllBtn:focus, #selectAllBtn:focus, #addCategoryBtn:focus,
#importBtn:focus, #exportBtn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

/* Disabled state */
.nav-btn:disabled, .flip-btn:disabled, .shuffle-btn:disabled, 
.btn:disabled, .btn-icon:disabled, .btn-outline-light:disabled, .btn-primary:disabled,
#prevBtn:disabled, #nextBtn:disabled, #flipBtn:disabled, #shuffleBtn:disabled,
.audio-btn:disabled, #clearAllBtn:disabled, #selectAllBtn:disabled {
    background: #9ca3af !important;
    opacity: 0.7 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Icon styles for all buttons */
.audio-btn i,
.nav-btn i, .flip-btn i, .shuffle-btn i,
#prevBtn i, #nextBtn i, #flipBtn i, #shuffleBtn i,
#clearAllBtn i, #selectAllBtn i, #addCategoryBtn i,
#importBtn i, #exportBtn i, .btn-icon i, .btn-outline-light i {
    color: white;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.nav-btn:hover, .flip-btn:hover, .shuffle-btn:hover,
#prevBtn:hover, #nextBtn:hover, #flipBtn:hover, #shuffleBtn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Active state for all buttons */
.nav-btn:active, .flip-btn:active, .shuffle-btn:active,
#prevBtn:active, #nextBtn:active, #flipBtn:active, #shuffleBtn:active {
    background: var(--primary-active);
    transform: translateY(0) scale(0.98);
}

/* Flip button - purple accent */
.flip-btn {
    background: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
}

.flip-btn:hover {
    background: rgba(155, 89, 182, 0.3);
}

/* Shuffle button - teal accent */
.shuffle-btn {
    background: rgba(46, 204, 113, 0.2);
    border-color: #2ecc71;
    color: #2ecc71;
}

.shuffle-btn:hover {
    background: rgba(46, 204, 113, 0.3);
}

/* Active state for shuffle button */
.shuffle-btn.active {
    background: #2ecc71;
    color: white;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2ecc71;
    animation: pulse 2s infinite;
}

.shuffle-btn.active {
    background-color: #4CAF50; /* Green background when active */
    color: white;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #4CAF50; /* Double border effect */
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* Remove duplicate button styles */
.controls {
    display: none; /* Hide the duplicate controls */
}

/* Progress Bar */
.progress-container {
    width: 90%;
    max-width: 600px;
    margin: 1.5rem auto;
    padding: 0.5rem 1rem;
    text-align: center;
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Progress Text - Ensure it's always visible */
.progress-container .progress-text {
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    margin: 0 0 8px 0 !important;
    padding: 0 0.25rem !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.progress-container .progress-text > span:first-child {
    color: #ffffff !important;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.progress-container .progress-count {
    background: #00d4ff !important;
    color: #000000 !important;
    padding: 6px 14px !important;
    border-radius: 20px !important;
    font-size: 0.9em !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    text-shadow: none !important;
    margin-left: 10px !important;
    display: inline-block !important;
    min-width: 60px;
    text-align: center;
}

/* Ensure high contrast for better visibility */
#progressText {
    color: #ffffff !important;
    text-shadow: 0 1px 2px #000000 !important;
}

#progressText .progress-count {
    background: #00d4ff !important;
    color: #000000 !important;
    font-weight: 700 !important;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 0.5rem 0 0.5rem 0;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    width: 0%; /* Start with 0 width */
    min-width: 0.5%; /* Ensure it's always visible when there's progress */
}

/* Add a subtle shine effect to the progress bar */
.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
    padding: 0 1rem;
}

/* Navigation buttons */
.nav-btn {
    all: unset;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem;
    padding: 0;
    margin: 0 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    line-height: 1;
}

.nav-btn i {
    color: white;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

.nav-btn:not(:disabled):hover {
    background: var(--primary-hover);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.nav-btn:active {
    background: var(--primary-active);
    transform: translateY(0) scale(0.98);
}

.nav-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

.nav-btn:disabled {
    background: #9ca3af !important;
    opacity: 0.7 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

.nav-btn:disabled i {
    opacity: 0.7;
}

/* Category Actions */
.category-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 8px 0 !important;
    width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
}

.category-actions > * {
    flex: 0 0 auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Reset any conflicting styles */
.category-actions .btn-icon,
#selectAllBtn,
#clearAllBtn,
#toggleHiddenNotesBtn {
    float: none !important;
    clear: none !important;
    margin: 0 !important;
}

/* Hide scrollbar for Webkit browsers */
.category-actions::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for Firefox */
.category-actions {
    scrollbar-width: none;
}

/* Force category actions to display in a single row */
.categories-section .section-header .category-actions {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    overflow: visible !important;
    width: auto !important;
    max-width: none !important;
}

/* Force category actions to display in a single row */
.categories-section .section-header .category-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    overflow: visible !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 8px !important;
}

/* Force category actions to display in a single row */
.category-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 8px 0 !important;
    width: 100% !important;
    overflow: visible !important;
}

.category-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 8px 0 !important;
    width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
}

.category-actions::-webkit-scrollbar {
    display: none !important;
}

/* Force all direct children to be in a single row */
.category-actions > * {
    flex: 0 0 auto !important;
    display: inline-block !important;
    float: none !important;
    clear: none !important;
}

.category-actions > * {
    flex: 0 0 auto !important;
    display: inline-block !important;
    float: none !important;
    clear: none !important;
}

/* Category action buttons */
.category-actions .btn-icon {
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.category-actions .btn-icon:not(:disabled):hover {
    background: var(--secondary-color);
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.category-actions .btn-icon:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.category-actions .btn-icon:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.5);
}

.category-actions .btn-icon i {
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.category-actions .btn-icon:not(:disabled):hover i {
    transform: scale(1.1);
}

.category-actions .btn-icon:disabled {
    background: rgba(0, 0, 0, 0.1) !important;
    color: rgba(255, 255, 255, 0.3) !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.category-actions .btn-icon:disabled i {
    opacity: 0.5;
}

/* Specific styles for the toggle hidden notes button */
#toggleHiddenNotesBtn {
    background: var(--primary-color);
}

#toggleHiddenNotesBtn i {
    color: #ffffff !important;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.7);
}

#toggleHiddenNotesBtn:hover i {
    color: #ffffff !important;
    text-shadow: 0 0 5px rgba(255, 255, 255, 1);
}

#toggleHiddenNotesBtn.active {
    background: var(--accent-color);
}

#toggleHiddenNotesBtn.active:not(:disabled):hover {
    background: #3db8b1;
}

/* Ensure consistent button spacing in category actions */
.category-actions .btn-icon {
    margin: 0;
}

#hideNoteBtn {
    all: unset;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem;
    padding: 0;
    margin: 0 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    line-height: 1;
}

#hideNoteBtn i {
    color: white;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

#hideNoteBtn:not(:disabled):hover {
    background: var(--primary-hover);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#hideNoteBtn:active {
    background: var(--primary-active);
    transform: translateY(0) scale(0.98);
}

#hideNoteBtn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

#hideNoteBtn:disabled {
    background: #9ca3af !important;
    opacity: 0.7 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

#hideNoteBtn:hover i {
    transform: scale(1.1);
}

.import-export-btn {
    background: linear-gradient(135deg, #5a7fb8 0%, #4a6fa5 100%);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.import-export-btn:hover {
    background: linear-gradient(135deg, #4a6fa5 0%, #3a5a8c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(-20px);
    transition: transform 0.3s ease-in-out;
    overflow: hidden;
}

.modal.show .modal-content {
    transform: translateY(0);
}

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

.modal-header h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.5rem;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #777;
    padding: 5px;
    line-height: 1;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #333;
}

/* Category List */
.category-list {
    margin-top: 20px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.select-all-container {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.select-all-container .btn-sm {
    padding: 4px 10px;
    font-size: 0.85rem;
}

.category-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    transition: background-color 0.2s;
}

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

.category-item:hover {
    background-color: #f9f9f9;
}

.category-checkbox {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.category-label {
    flex: 1;
    cursor: pointer;
    padding: 5px 0;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.card-count {
    color: #777;
    font-size: 0.9em;
    margin-left: 5px;
}

/* Selected Categories */
.selected-categories {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.section-header {
    margin-bottom: 15px;
    width: 100%;
    display: block !important;
}

/* Ensure the category actions stay in a single row */
.section-header > .category-actions {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 8px;
    margin: 0 !important;
    padding: 8px 0 !important;
    width: auto !important;
    max-width: 100% !important;
    overflow: visible !important;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap !important;
    position: relative;
    z-index: 1;
}

/* Hide scrollbar for Webkit browsers */
.section-header > .category-actions::-webkit-scrollbar {
    display: none;
}

/* Ensure buttons don't shrink */
.section-header > .category-actions .btn-icon {
    flex: 0 0 auto !important;
    display: inline-flex !important;
}

.selected-categories-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.selected-categories-header h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.3rem;
}

.selected-categories-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
    padding: 5px 0;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    background-color: #e8f4fd;
    border: 1px solid #bbdefb;
    border-radius: 16px;
    padding: 6px 12px 6px 8px;
    font-size: 14px;
    color: #0d47a1;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.3s ease-out forwards;
}

.empty-state i {
    font-size: 2.5rem;
    color: #cbd5e1;
    margin-bottom: 15px;
}

.empty-state h3 {
    margin: 10px 0 5px;
    color: #334155;
}

.empty-state p {
    margin-bottom: 20px;
    color: #64748b;
}

.no-categories-selected {
    color: #666;
    font-style: italic;
    padding: 10px;
    text-align: center;
    background-color: #f9f9f9;
    border-radius: 4px;
    border: 1px dashed #ddd;
    margin: 10px 0;
}

.empty-state i {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #94a3b8;
}

/* Animation for category chips */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .selected-categories-chips {
        justify-content: center;
    }
    
    .category-chip {
        font-size: 13px;
        padding: 4px 10px 4px 8px;
    }
    
    .chip-count {
        font-size: 10px;
        padding: 1px 4px;
    }
}

/* Base Button Styles */
:root {
    --primary-color: #3b82f6;  /* Blue-500 */
    --primary-hover: #2563eb;  /* Blue-600 */
    --primary-active: #1d4ed8; /* Blue-700 */
    --button-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    --button-hover-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Base button styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--primary-color);
    color: white;
    width: 42px;
    height: 42px;
    padding: 0;
    font-size: 1.1rem;
    box-shadow: var(--button-shadow);
}

/* Icon Buttons */
.btn-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
}

/* Primary Buttons */
.btn-primary {
    background: var(--primary-color);
    color: white;
}

/* Outline Buttons - styles now in main button group */
.btn-outline-light {
    background: var(--primary-color);
    color: white;
    border: none;
}

/* Hover States */
.btn:hover, 
.btn-icon:hover,
.btn-primary:hover,
.btn-outline-light:hover {
    background: var(--primary-hover);
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--button-hover-shadow);
}

/* Active States */
.btn:active, 
.btn-icon:active,
.btn-primary:active,
.btn-outline-light:active {
    background: var(--primary-active);
    transform: translateY(0) scale(0.98);
    box-shadow: var(--button-shadow);
}

/* Focus States */
.btn:focus,
.btn-icon:focus,
.btn-primary:focus,
.btn-outline-light:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

/* Disabled State */
.btn:disabled,
.btn-icon:disabled,
.btn-primary:disabled,
.nav-btn:disabled, .flip-btn:disabled, .shuffle-btn:disabled,
#prevBtn:disabled, #nextBtn:disabled, #flipBtn:disabled, #shuffleBtn:disabled {
    background: #9ca3af;
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    color: white;
}

/* Sidebar Panel Buttons */
.side-panel .btn {
    margin: 0 2px;
}

/* Category Action Buttons */
.category-actions .btn {
    margin: 0 2px;
}

/* Add Category Button - styles are in the main button group */

/* Import/Export Buttons */
.import-export-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    align-items: center;
    justify-content: center;
}

/* Import/Export Buttons */
#importBtn, #exportBtn {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

/* Hover state */
#importBtn:hover, #exportBtn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Active state */
#importBtn:active, #exportBtn:active {
    background: var(--primary-active);
    transform: translateY(0) scale(0.98);
}

/* Hide text in buttons */
#importBtn span,
#exportBtn span {
    display: none;
}

/* Style icons */
#importBtn i,
#exportBtn i {
    margin: 0;
    font-size: 1.1rem;
    color: white;
}

/* Focus state */
#importBtn:focus, #exportBtn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

/* Disabled state */
#importBtn:disabled, #exportBtn:disabled {
    background: #9ca3af;
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .import-export-actions {
        flex-direction: column;
    }
    
    .import-export-actions .btn {
        width: 100%;
        margin: 3px 0;
    }
}

/* Form Controls */
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 111, 165, 0.2);
}

/* Category Management */
.category-management {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.add-category-form {
    display: flex;
    gap: 10px;
}

.add-category-form .form-control {
    flex: 1;
}

.category-import {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 25px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5em;
    cursor: pointer;
    color: #666;
}

.close-btn:hover {
    color: #333;
}

.modal h3 {
    margin-top: 0;
    color: var(--text-color);
    font-size: 1.4em;
    margin-bottom: 20px;
    text-align: center;
}

.export-categories {
    margin: 15px 0;
    max-height: 300px;
    overflow-y: auto;
}

.export-category-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

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

.export-category-item input[type="checkbox"] {
    margin-right: 10px;
}

.word-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 10px 0 5px 0;
}

.audio-controls {
    display: flex;
    justify-content: center;
    margin: 5px 0 10px 0;
}

.modal-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.audio-btn {
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.audio-btn.playing {
    background-color: var(--primary-color);
    color: white;
    animation: pulse 1.5s infinite;
}

.audio-btn:hover:not(.playing) {
    background-color: rgba(var(--primary-rgb), 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.audio-btn:active {
    transform: scale(0.95) translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.audio-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.3);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(var(--primary-rgb), 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0);
    }
}

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

.modal-btn.primary:hover {
    background-color: #3a5a8c;
}

.modal-btn:hover {
    background-color: #f0f0f0;
}

/* Progress Bar */
.progress {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

#progressText {
    display: block;
    margin-bottom: 8px;
    color: white;
    font-weight: 500;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4ecdc4, #44a08d);
    border-radius: 5px;
    transition: width 0.3s ease;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 12px 20px;
    border-radius: 4px;
    color: white;
    background-color: #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s, transform 0.3s;
    max-width: 300px;
    word-break: break-word;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    background-color: #4caf50;
}

.toast-error {
    background-color: #f44336;
}

.toast-info {
    background-color: #2196f3;
}

.toast-warning {
    background-color: #ff9800;
}

/* Responsive Design */
@media (max-width: 992px) {
    .app-layout {
        position: relative;
        overflow-x: hidden;
    }
    
    .side-panel {
        position: fixed;
        top: 0;
        left: 0;
        width: 85%;
        max-width: 400px;
        height: 100vh;
        z-index: 1000;
        transition: transform 0.3s ease-in-out;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
        background: var(--background-color);
        display: flex;
        flex-direction: column;
        transform: translateX(-100%);
    }
    
    .side-panel.collapsed {
        transform: translateX(-100%);
    }
    
    .side-panel:not(.collapsed) {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        transition: transform 0.3s ease-in-out;
    }
    
    .side-panel:not(.collapsed) + .main-content {
        transform: translateX(85%);
    }
    
    .panel-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s ease-in-out;
    }
    
    .side-panel:not(.collapsed) + .main-content + .panel-overlay {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }
    
    .main-header {
        position: relative;
        padding: 1rem;
    }
    
    #toggleSidePanelBtn {
        position: fixed;
        top: 20px;
        left: 0;
        z-index: 1000;
        width: 22px;
        height: 82px;
        padding: 0;
        margin: 0;
        border: none;
        background: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: left 0.3s ease-in-out;
    }
    
    #toggleSidePanelBtn svg {
        width: 22px;
        height: 82px;
        color: #ffffff;
        border-radius: 4px;
        background: var(--background-color);
        stroke: #ffffff;
        transition: transform 0.3s ease;
    }
    
    #toggleSidePanelBtn:hover svg {
        opacity: 0.9;
    }
    
    .side-panel:not(.collapsed) + .main-content #toggleSidePanelBtn {
        left: 320px;
    }
    
    .side-panel:not(.collapsed) + .main-content #toggleSidePanelBtn svg {
        transform: rotate(180deg);
    }
    
    .app-title {
        padding: 0.5rem 1rem;
        font-size: 1.25rem;
        margin-left: 0;
        text-align: center;
    }
    
    .container {
        width: 95%;
        gap: 1.5rem;
        margin-top: 1rem;
    }
    
    .flashcard-container,
    .selected-categories {
        padding: 1.25rem;
    }
    
    h1 {
        font-size: 1.8em;
        margin: 10px 0 20px;
    }
    
    .category-input {
        width: 100%;
        box-sizing: border-box;
    }
    
    .category-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .category-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .flashcard {
        height: 250px;
        margin: 15px 0;
    }
    
    .card-text {
        font-size: 1.3em;
        padding: 20px;
    }
    
    .card-controls {
        margin: 15px 0;
    }
    
    .nav-btn, .flip-btn, .shuffle-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1em;
    }
    
    .flip-btn {
        width: 50px;
        height: 50px;
    }
    
    .progress-container {
        margin: 0 auto 20px;
    }
    
    .progress-text {
        font-size: 0.8em;
    }
}

/* Tablet Styles */
@media (min-width: 481px) and (max-width: 1024px) {
    .container {
        max-width: 95%;
    }
    
    .flashcard {
        height: 300px;
    }
    
    .card-text {
        font-size: 1.6em;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    h1 {
        font-size: 1.5em;
    }
    
    .flashcard-container {
        height: calc(100vh - 200px);
        max-height: 400px;
        min-height: 220px;
        padding: 0.5rem 0;
    }
    
    .flashcard {
        height: 100%;
        min-height: 200px;
        margin: 10px 0;
    }
    
    .card-text {
        font-size: 1.1em;
        padding: 10px;
    }
    
    .nav-btn, .flip-btn, .shuffle-btn {
        width: 40px;
        height: 40px;
        font-size: 1em;
    }
    
    .flip-btn {
        width: 45px;
        height: 45px;
    }
    
    .category-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .german-text {
        font-size: 1.6em;
    }
    
    .english-text {
        font-size: 1.3em;
    }
    
    .card-face {
        padding: 20px 15px;
    }
    
    .controls {
        gap: 10px;
    }
    
    .nav-btn {
        padding: 8px 12px;
        min-width: auto;
        font-size: 0.85em;
    }
    
    .select-all-btn {
        width: 100%;
    }
}

/* App Layout */
:root {
    --primary-color: #3498db;
    --primary-hover: #2980b9;
    --background-light: #f5f7fa;
    --text-dark: #2c3e50;
    --text-light: #ecf0f1;
    --border-color: rgba(0, 0, 0, 0.1);
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.2s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: transparent;
    margin: 0;
    padding: 0;
}

.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    background: transparent;
    margin: 0;
    padding: 0;
}

/* Side Panel */
.side-panel {
    width: 320px;
    background: #2c3e50;
    color: var(--text-light);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    transition: transform 0.3s ease-in-out, width 0.3s ease-in-out;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.side-panel.collapsed {
    transform: translateX(calc(-100% + 22px));
    width: 22px;
    overflow: hidden;
    background: #2c3e50;
    cursor: pointer;
    padding-top: 0;
    transition: transform 0.3s ease, width 0.3s ease;
    height: 82px;
    border-radius: 0 5px 5px 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1001;
}

/* Hide all panel content when collapsed */
.side-panel.collapsed .panel-header,
.side-panel.collapsed .panel-content {
    display: none;
}

.side-panel.collapsed::before {
    content: '';
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%) rotate(-45deg);
    width: 8px;
    height: 8px;
    border-right: 2px solid white;
    border-bottom: 2px solid white;
    pointer-events: none;
    z-index: 1002;
    opacity: 1;
}

/* Ensure the flashcard container is not affected by the side panel */
.flashcard-container {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
}

.panel-header {
    padding: 1rem 1.25rem;
    background: #1a252f;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Show h2 and button only when panel is expanded */
.side-panel:not(.collapsed) .panel-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #fff;
    font-weight: 600;
}

/* Hide h2 when panel is collapsed */
.side-panel.collapsed .panel-header h2 {
    display: none;
}

/* Hide panel header when panel is collapsed */
.side-panel.collapsed .panel-header {
    display: none;
}

.panel-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Categories Section */
.categories-section {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1rem;
}

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

.section-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-light);
    font-weight: 500;
}

.category-actions {
    display: flex;
    gap: 0.5rem;
}

/* Categories List */
.categories-list {
    flex: 1;
    overflow-y: auto;
    margin: 1rem 0;
    padding-right: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.category-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.category-item.selected {
    background: rgba(52, 152, 219, 0.2);
    border-color: var(--primary-color);
}

.category-item .category-name {
    flex: 1;
    color: var(--text-light);
}

.category-item .category-count {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Search and Add Category */
.categories-search {
    margin-bottom: 1rem;
}

/* Form Controls */
.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-light);
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.3);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

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

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

.btn-outline-light {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-light);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-block {
    display: block;
    width: 100%;
}

/* Input Groups */
.input-group {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.input-group .form-control {
    flex: 1;
}

.input-group .btn {
    flex-shrink: 0;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 9999;
    max-width: 320px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background-color: #27ae60;
}

.toast-error {
    background-color: #e74c3c;
}

.toast-info {
    background-color: #3498db;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .side-panel {
        width: 280px;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .main-content.expanded {
        margin-left: 0;
    }
    
    #toggleSidePanelBtn {
        display: flex;
    }
    
    .side-panel.collapsed + .main-content {
        margin-left: 0;
    }
    
    .flashcard {
        height: 500px;
    }
    
    .german-text, .translation-text {
        font-size: 1.75rem;
    }
    
    .ipa, .translation-ipa {
        font-size: 1rem;
    }
    
    .card-face {
        padding: 1.5rem;
    }
    
    .example-container, .translation-example {
        padding: 0.75rem;
    }
    
    .toast {
        left: 20px;
        right: 20px;
        max-width: none;
        text-align: center;
    }
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 320px;
    transition: margin 0.3s ease-in-out, width 0.3s ease-in-out;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: calc(100% - 320px);
    position: relative;
    left: 0;
}

.main-content.expanded {
    margin-left: 0;
}

.main-header {
    padding: 0;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    border: none;
    box-shadow: none;
    width: 100%;
}

.app-title {
    font-size: 3rem;
    font-weight: 800;
    color: #2d3748; /* Darker color for better visibility */
    margin: 0 0 2rem 0;
    padding: 0;
    flex: 1;
    text-align: center;
    line-height: 1.1;
    background: transparent;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.app-title .highlight {
    background: linear-gradient(135deg, #00d4ff, #6a11cb);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.app-title .highlight:hover {
    transform: translateY(-2px);
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Flip Animation */
.flip-container {
    perspective: 1000px;
    display: inline-block;
    width: 1.2em;
    height: 1.2em;
    position: relative;
    vertical-align: middle;
}

.flip-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.flip-container:hover .flip-card {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flip-card-back {
    transform: rotateY(180deg);
}

.flashcard-icon {
    width: 100%;
    height: 100%;
    color: var(--primary-color);
    filter: drop-shadow(0 2px 6px rgba(0, 180, 255, 0.4));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    perspective: 1000px;
}

.flip-container:hover .flashcard-icon {
    transform: rotateY(180deg) scale(1.05);
    filter: drop-shadow(0 4px 12px rgba(0, 180, 255, 0.6));
}

.flip-card-front .flashcard-icon {
    color: var(--primary-color);
}

.flip-card-back .flashcard-icon {
    color: var(--accent-color);
}

/* Make eye-slash icon white to match other buttons and prevent color change on hover/focus */
#toggleHiddenNotesBtn .fa-eye-slash,
#toggleHiddenNotesBtn .fa-eye-slash:focus,
#toggleHiddenNotesBtn .fa-eye-slash:active,
#toggleHiddenNotesBtn .fa-eye-slash:hover,
.fa-eye-slash,
.fa-eye-slash:focus,
.fa-eye-slash:active,
.fa-eye-slash:hover {
    color: white !important;
    opacity: 1 !important;
}

.app-title .subtitle {
    display: block;
    font-size: 1.1rem;
    font-weight: 400;
    color: #64748b;
    margin-top: 0.25rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 500;
}

.content-container {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Toggle Buttons */
#toggleSidePanelBtn {
    display: none;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    width: 22px;
    height: 82px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    position: fixed;
    top: 1rem;
    z-index: 1001;
}

#toggleSidePanelBtn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

#toggleP.audio-btn {
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #555;
    font-size: 0.9em;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#togglePanelBtn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

#togglePanelBtn:hover {
    background: rgba(255, 255, 255, 0.1);
}

#togglePanelBtn i {
    transition: transform 0.3s ease;
}

.side-panel.collapsed #togglePanelBtn i {
    transform: rotate(180deg);
}

/* Responsive styles */
@media (max-width: 992px) {
    .side-panel {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .side-panel.expanded {
        transform: translateX(0);
        width: 280px;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    #toggleSidePanelBtn {
        display: flex;
    }
    
    .side-panel.collapsed {
        transform: translateX(-100%);
        width: 0;
    }
}

/* Custom scrollbar for the side panel */
.panel-content::-webkit-scrollbar {
    width: 6px;
}

.panel-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.panel-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.panel-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Selected categories container */
.selected-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

/* Toggle button */
#toggleCategoriesBtn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9em;
    transition: background-color 0.2s ease, transform 0.1s ease;
    margin: 0.5rem 0;
}

#toggleCategoriesBtn:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
}

#toggleCategoriesBtn:active {
    transform: translateY(0);
}

#toggleCategoriesBtn i {
    transition: transform 0.3s ease;
}

#toggleCategoriesBtn[title="Collapse categories"] i {
    transform: rotate(0deg);
}

#toggleCategoriesBtn[title="Expand categories"] i {
    transform: rotate(-180deg);
}

/* Ensure flashcard is clickable even when panel is expanded */
.flashcard {
    position: relative;
    z-index: 1;
}

/* Hide note button */
.hide-note-btn {
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    margin: 0 5px;
}

.hide-note-btn:not(:disabled):hover {
    background: var(--secondary-color);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.hide-note-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.hide-note-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.5);
}

/* Audio button styles */
#audioBtn {
    transition: all 0.3s ease;
    background: transparent;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#audioBtn:hover {
    background: rgba(0, 212, 255, 0.1);
    transform: scale(1.1);
}

#audioBtn:active {
    transform: scale(0.95);
}

#audioBtn.speaking {
    color: #00ff9d;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 255, 157, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 255, 157, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 157, 0);
    }
}

.hide-note-btn i {
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.hide-note-btn:not(:disabled):hover i {
    transform: scale(1.1);
}

.hide-note-btn:disabled {
    background: rgba(0, 0, 0, 0.1) !important;
    color: rgba(255, 255, 255, 0.3) !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.hide-note-btn:disabled i {
    opacity: 0.5;
}

/* Panel actions */
.panel-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.panel-actions .btn-icon {
    background: var(--primary-color);
    border: none;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.panel-actions .btn-icon:not(:disabled):hover {
    background: var(--secondary-color);
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.panel-actions .btn-icon:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.panel-actions .btn-icon:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.5);
}

.panel-actions .btn-icon i {
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.panel-actions .btn-icon:not(:disabled):hover i {
    transform: scale(1.1);
}

.panel-actions .btn-icon:disabled {
    background: rgba(0, 0, 0, 0.1) !important;
    color: rgba(255, 255, 255, 0.3) !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.panel-actions .btn-icon:disabled i {
    opacity: 0.5;
}

#toggleHiddenNotesBtn {
    all: unset;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem;
    padding: 0;
    margin: 0 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    line-height: 1;
}

#toggleHiddenNotesBtn i {
    color: white;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    transition: transform 0.2s ease;
}

#toggleHiddenNotesBtn:not(:disabled):hover {
    background: var(--primary-hover);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#toggleHiddenNotesBtn:active {
    background: var(--primary-active);
    transform: translateY(0) scale(0.98);
}

#toggleHiddenNotesBtn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

#toggleHiddenNotesBtn:not(:disabled):hover i {
    transform: scale(1.1);
}

#toggleHiddenNotesBtn:disabled {
    background: rgba(0, 0, 0, 0.1) !important;
    color: rgba(255, 255, 255, 0.3) !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

#toggleHiddenNotesBtn:disabled i {
    opacity: 0.5;
}

/* Active state for toggle hidden notes */
#toggleHiddenNotesBtn.active {
    background: var(--accent-color);
    color: white;
}

#toggleHiddenNotesBtn.active:not(:disabled):hover {
    background: #3db8b1;
}
