/* Flashcards Page Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f0;
    color: #2c3e50;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
}

/* Global Content Wrapper */
.content-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Navigation Styles are now inherited from styles.css */

/* Main Content */
.flashcards-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 20px;
    flex: 1;
}

.flashcards-header {
    text-align: center;
    margin-bottom: 2.5rem;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(41, 128, 185, 0.1) 100%);
    padding: 2rem 1.5rem;
    border-radius: 12px;
    border: 2px solid rgba(52, 152, 219, 0.2);
}

.flashcards-header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.flashcards-subtitle {
    font-size: 1.1rem;
    color: #2c3e50; /* stronger, high-contrast color */
    opacity: 1; /* ensure fully opaque */
    font-weight: 600;
}

/* Controls */
.flashcards-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.control-btn {
    padding: 10px 22px;
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    border: 2px solid #229954;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.control-btn:hover {
    background: linear-gradient(135deg, #229954 0%, #1a5f3e 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
    border-color: #1a5f3e;
}

.control-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
}

.card-counter {
    background: linear-gradient(135deg, #f8f9fa 0%, #ecf0f1 100%);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    color: #2c3e50;
    border: 2px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Flashcard Wrapper */
.flashcard-wrapper {
    perspective: 1000px;
    margin-bottom: 2rem;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Flashcard */
.flashcard {
    width: 100%;
    max-width: 600px;
    height: 400px;
    position: relative;
    cursor: pointer;
    margin: 0 auto;
}

.flashcard:focus {
    outline: 3px solid #3498db;
    outline-offset: 5px;
    border-radius: 12px;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.flashcard-front {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.flashcard-back {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    transform: rotateY(180deg);
}

.card-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.9;
    margin-bottom: 1rem;
    font-weight: 600;
}

.card-term {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    word-wrap: break-word;
}

.card-hint {
    font-size: 0.9rem;
    opacity: 0.8;
    font-style: italic;
    margin-top: auto;
}

.card-definition {
    font-size: 1.3rem;
    text-align: center;
    line-height: 1.8;
    word-wrap: break-word;
}

/* Navigation Buttons */
.flashcards-navigation {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 12px 28px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border: 2px solid #2980b9;
    border-radius: 8px;
    color: white;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-family: inherit;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.nav-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #2980b9 0%, #1f618d 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
    border-color: #1f618d;
}

.nav-btn:active:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.3);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Card List Section */
.card-list-section {
    margin-top: 3rem;
}

.card-list-section h2 {
    font-size: 2rem;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 0.5rem;
}

.card-list-subtitle {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 2rem;
}

.card-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.card-list-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #2c3e50;
}

.card-list-item:hover {
    border-color: #3498db;
    background: #f0f7ff;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.card-list-item.active {
    border-color: #3498db;
    background: #e8f4f8;
    color: #3498db;
}

/* Footer */
.main-footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: auto;
}

.main-footer p {
    margin-bottom: 0.5rem;
}

.main-footer strong {
    color: #3498db;
}

.main-footer b {
    color: #0de546;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 60px;
        flex-direction: column;
        background: #2c3e50;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
        gap: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a {
        display: block;
        padding: 1rem;
        width: 100%;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .flashcards-container {
        padding: 2rem 15px;
    }

    .flashcards-header h1 {
        font-size: 2rem;
    }

    .flashcard {
        height: 350px;
    }

    .card-term {
        font-size: 2rem;
    }

    .card-definition {
        font-size: 1.1rem;
    }

    .flashcards-navigation {
        flex-direction: column;
    }

    .nav-btn {
        width: 100%;
    }

    .card-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 480px) {
    .flashcards-header h1 {
        font-size: 1.75rem;
    }

    .flashcard {
        height: 300px;
    }

    .card-term {
        font-size: 1.5rem;
    }

    .card-definition {
        font-size: 1rem;
    }

    .flashcard-front,
    .flashcard-back {
        padding: 1.5rem;
    }
}

/* Dark Mode Styles for Flashcards */
body.dark-mode {
    background: #0d1117;
    color: #e0e6ed;
}

body.dark-mode .content-wrapper {
    background: #0d1117;
}

body.dark-mode .flashcards-header {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    padding: 2rem 1rem;
}

body.dark-mode .flashcards-header h1 {
    color: #e0e6ed;
}

body.dark-mode .flashcards-subtitle {
    color: #c9d1d9; /* brighter for dark background */
    opacity: 1;
    font-weight: 600;
}

body.dark-mode .control-btn {
    background: linear-gradient(135deg, #0969da 0%, #033d8b 100%);
    border-color: #033d8b;
    color: #e0e6ed;
}

body.dark-mode .control-btn:hover {
    background: linear-gradient(135deg, #033d8b 0%, #022663 100%);
    border-color: #022663;
}

body.dark-mode .card-counter {
    background: linear-gradient(135deg, #161b22 0%, #0d1117 100%);
    color: #e0e6ed;
    border-color: #30363d;
}

body.dark-mode .flashcard-front {
    background: linear-gradient(135deg, #0969da 0%, #033d8b 100%);
}

body.dark-mode .flashcard-back {
    background: linear-gradient(135deg, #238636 0%, #1f6feb 100%);
}

body.dark-mode .card-label {
    color: #e0e6ed;
    opacity: 0.95;
}

body.dark-mode .card-term {
    color: #e0e6ed;
}

body.dark-mode .card-definition {
    color: #e0e6ed;
}

body.dark-mode .card-hint {
    color: #c9d1d9;
    opacity: 0.85;
}

body.dark-mode .nav-btn {
    background: linear-gradient(135deg, #0969da 0%, #033d8b 100%);
    border-color: #033d8b;
    color: #e0e6ed;
}

body.dark-mode .nav-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #033d8b 0%, #022663 100%);
    border-color: #022663;
    box-shadow: 0 6px 20px rgba(9, 105, 218, 0.3);
}

body.dark-mode .nav-btn:disabled {
    background: linear-gradient(135deg, #30363d 0%, #21262d 100%);
    border-color: #21262d;
    color: #6e7681;
}

body.dark-mode .card-list-section {
    background: #0d1117;
    padding: 2rem 1rem;
}

body.dark-mode .card-list-section h2 {
    color: #e0e6ed;
}

body.dark-mode .card-list-subtitle {
    color: #8b949e;
}

body.dark-mode .card-list-item {
    background: linear-gradient(135deg, #161b22 0%, #0d1117 100%);
    border-color: #30363d;
    color: #e0e6ed;
}

body.dark-mode .card-list-item:hover {
    background: linear-gradient(135deg, #21262d 0%, #161b22 100%);
    border-color: #58a6ff;
}

body.dark-mode .main-footer {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    border-top-color: #58a6ff;
    color: #e0e6ed;
}