/* Enhanced Flashcard Study Styles - Consistent with app design system */

/* Study Header */
.study-header {
    text-align: center;
    margin-bottom: 30px;
}

.study-header .page-title {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--medium-black);
    margin-bottom: 10px;
}

.study-instruction {
    font-size: 1.1rem;
    color: var(--medium-gray);
    margin-bottom: 25px;
    font-family: var(--font-sans);
}

/* Study Progress Overview */
.study-progress-overview {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.2);
}

.progress-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 15px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 5px;
    font-family: var(--font-sans);
}

.stat-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    font-family: var(--font-serif);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.progress-bar-wrapper {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFE066, #FF6B6B);
    border-radius: 4px;
    transition: width 0.4s ease;
    width: 0%;
    box-shadow: 0 0 10px rgba(255, 224, 102, 0.5);
}

/* Study Area */
.study-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

/* Flashcard Container */
.flashcard-container {
    width: 100%;
    max-width: 600px;
    width: min(90vw, 600px);
    min-height: 400px;
    height: min(70vh, 500px);
    max-height: 500px;
    perspective: 1200px;
    margin: 30px auto;
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.3);
}

/* Flashcard */
.flashcard {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    background: transparent;
}

.flashcard:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    transform: translateY(-3px);
}

.flashcard.flipped {
    transform: rotateY(180deg);
}

/* Card Face */
.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--medium-lighter-gray);
}

.card-content {
    /* padding: 30px; */
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

/* Card Front - Using app's color scheme */
.card-front {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: var(--medium-black);
}

.word-section {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.flashcard-word {
    font-family: var(--font-serif);
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    font-weight: 700;
    color: var(--medium-blue);
    margin-bottom: 15px;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pronunciation-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.pronunciation-btn {
    background: var(--medium-blue);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.pronunciation-btn:hover {
    background: var(--medium-dark-gray);
    transform: scale(1.1);
}

.pronunciation-btn.speaking {
    background: var(--medium-green) !important;
    animation: pulse 1s infinite;
    transform: scale(1.1);
}

@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);
    }
}

.flashcard-pronunciation {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: var(--medium-gray);
    margin: 0;
}

/* Card Hint */
.card-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: auto;
    padding: 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.hint-icon {
    animation: pulse 2s infinite;
    color: var(--medium-blue);
}

.hint-text {
    font-size: 0.95rem;
    color: var(--medium-gray);
    font-family: var(--font-sans);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
}

/* Card Back - Enhanced with app's green theme */
.card-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: var(--medium-black);
}

.card-back .card-content {
    justify-content: flex-start;
    gap: 15px;
    overflow-y: auto;
    max-height: 100%;
    padding-right: 25px; /* Account for scrollbar space */
}

/* Custom scrollbar styling for card back */
.card-back .card-content::-webkit-scrollbar {
    width: 6px;
}

.card-back .card-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.card-back .card-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.card-back .card-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* For Firefox */
.card-back .card-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
}

/* Section Styling */
.definition-section,
.example-section {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    /* padding: 15px; */
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--medium-black);
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-content {
    font-family: var(--font-sans);
}

.flashcard-definition-text,
.flashcard-example-text {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 8px;
}

.flashcard-example-text em {
    font-style: normal;
    font-weight: 600;
    background: rgba(255, 224, 102, 0.3);
    padding: 2px 4px;
    border-radius: 4px;
    color: var(--medium-black);
}

.flashcard-example-translation {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
}

.back-hint {
    margin-top: auto;
    color: var(--medium-black);
}

/* Card Number Indicator */
.card-number-indicator {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 10;
}

/* Enhanced Card Navigation - Using app's button styles */
.card-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 600px;
    margin: 30px auto;
    gap: 20px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-family: var(--font-sans);
}

.nav-btn:hover {
    transform: translateY(-2px);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Card Counter */
.card-counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: 200px;
}

.counter-display {
    text-align: center;
    font-family: var(--font-sans);
}

.current-card {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--medium-blue);
    margin-bottom: 3px;
}

.total-cards {
    display: block;
    font-size: 0.9rem;
    color: var(--medium-gray);
}

/* Mini Progress Dots */
.mini-progress-dots {
    display: flex;
    gap: 6px;
    max-width: 180px;
    overflow-x: auto;
    padding: 3px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.mini-progress-dots::-webkit-scrollbar {
    display: none;
}

.progress-dot {
    min-width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--medium-lighter-gray);
    transition: all 0.3s ease;
    cursor: pointer;
}

.progress-dot.active {
    background: var(--medium-blue);
    transform: scale(1.3);
}

.progress-dot:hover {
    background: var(--medium-light-blue);
    transform: scale(1.2);
}

/* Enhanced Study Controls */
.study-controls-enhanced {
    width: 100%;
    max-width: 600px;
    margin: 25px auto;
}

.control-group {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.control-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-family: var(--font-sans);
}

.control-btn:hover {
    transform: translateY(-2px);
}

/* Settings Panel */
.study-settings-panel {
    background: linear-gradient(135deg, #3381c5 0%, #04b0b9 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin: 20px auto;
    max-width: 600px;
    display: none !important; /* Add !important */
    box-shadow: 0 8px 32px rgba(79, 172, 254, 0.3);
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.study-settings-panel.show {
    display: block !important; /* Add !important */
    opacity: 1 !important;
    transform: translateY(0) !important;
    animation: slideDown 0.3s ease;
}

/* Alternative - use visibility instead of display */
.study-settings-panel.hidden {
    visibility: hidden !important;
    opacity: 0 !important;
    transform: translateY(-10px) !important;
    pointer-events: none !important;
}

.study-settings-panel.visible {
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

.settings-content h3 {
    font-family: var(--font-serif);
    color: white;
    margin-bottom: 20px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    font-family: var(--font-sans);
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 16px;
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

.setting-item label {
    color: white;
    font-weight: 500;
}

.setting-value {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    color: white;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
}

/* Enhanced input styling for settings */
.setting-item input[type="range"] {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    height: 6px;
    outline: none;
    -webkit-appearance: none;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.setting-item input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.setting-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: white;
}

/* Animations */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes fadeOutScale {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes slideOutUp {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-100%);
    }
}

/* Smooth transitions for all fullscreen elements */
body.fullscreen-mode * {
    transition: all 0.3s ease !important;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .flashcard,
    .nav-btn,
    .control-btn,
    .progress-fill,
    .hint-icon {
        transition: none;
        animation: none;
    }
    
    .flashcard:hover {
        transform: none;
    }
}
