/* styles.css - TickSmart Flashcards Complete Styling with Logo Image */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-navy: #001f3f;
    --light-blue: #e0eeff;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 100%);
    min-height: 100vh;
    padding: 30px 20px;
    line-height: 1.6;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ========== HEADER ========== */

.header {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeInDown 0.6s ease-out;
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* ========== LOGO IMAGE ========== */

.logo-image {
    height: 80px;
    width: auto;
    object-fit: contain;
    animation: fadeIn 0.6s ease-out;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    flex-shrink: 0;
}

/* Retina/High DPI Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-image {
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    }
}

.header h1 {
    font-size: 3rem;
    color: var(--dark-navy);
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.trademark {
    font-size: 1.5rem;
    vertical-align: super;
    color: var(--primary-color);
    font-weight: 600;
}

/* ========== STEP CONTAINERS ========== */

.step-container {
    margin-bottom: 50px;
}

.step-title {
    text-align: center;
    color: var(--dark-navy);
    margin-bottom: 30px;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ========== MODE SELECTOR ========== */

.mode-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
    padding: 0 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.mode-btn {
    padding: 30px;
    border: 3px solid var(--dark-navy);
    border-radius: 20px;
    background: white;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-family: inherit;
}

.mode-btn .mode-icon {
    font-size: 2rem;
    display: block;
}

.mode-btn .mode-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark-navy);
    display: block;
}

.mode-btn .mode-subtitle {
    font-size: 0.95rem;
    color: var(--secondary-color);
    font-weight: 500;
    font-style: italic;
    display: block;
}

.mode-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-color);
}

.mode-btn:active {
    transform: translateY(-2px);
}

.mode-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.mode-btn.active .mode-name {
    color: white;
}

.mode-btn.active .mode-subtitle {
    color: rgba(255, 255, 255, 0.9);
}

/* ========== CATEGORY GRID ========== */

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
    padding: 0 20px;
}

.category-card {
    background: linear-gradient(135deg, var(--dark-navy) 0%, #003d7a 100%);
    color: white;
    padding: 40px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.25);
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    position: relative;
    overflow: hidden;
    font-family: inherit;
    font-family: 'Segoe UI', 'Apple Color Emoji', 'Noto Color Emoji', Tahoma, Geneva, Verdana, sans-serif;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    pointer-events: none;
    z-index: 0;
}

.category-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
    transition: all 0.5s ease-out;
    z-index: 0;
}

.category-card:hover::after {
    top: -10%;
    right: -10%;
}

.category-card > span,
.category-card > div {
    position: relative;
    z-index: 1;
}

.category-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 15px 40px rgba(37, 99, 235, 0.35);
}

.category-card:active {
    transform: translateY(-5px) scale(1.01);
}

.category-card div:first-child {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.4;
}

.category-card .card-count {
    display: block;
    font-size: 0.85rem;
    opacity: 0.85;
    font-weight: 500;
}

/* ========== QUICK ACTIONS ========== */

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    padding: 0 20px;
    margin-bottom: 40px;
}

.btn-action {
    padding: 18px 30px;
    border: 2px solid var(--dark-navy);
    border-radius: 12px;
    background: white;
    color: var(--dark-navy);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-family: inherit;
}

.btn-action:hover {
    background: var(--dark-navy);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.btn-action:active {
    transform: translateY(-1px);
}

/* ========== DASHBOARD ========== */

.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    padding: 0 20px;
    margin-top: 40px;
}

.stat-card {
    background: var(--light-blue);
    color: var(--dark-navy);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.2);
    transition: var(--transition);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.4);
}

.stat-number {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.95rem;
    opacity: 0.95;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--dark-navy);
}

/* ========== CATEGORY SECTION ========== */

.category-section {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

/* ========== FLASHCARD SECTION ========== */

.flashcard-section {
    animation: fadeInUp 0.6s ease-out;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

/* Progress Bar */
.progress-bar {
    background: white;
    height: 40px;
    border-radius: 20px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: 20px;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    color: var(--dark-navy);
    z-index: 1;
    font-size: 0.9rem;
}

/* ========== FLASHCARD CONTAINER ========== */

.flashcard-container {
    perspective: 1000px;
    margin-bottom: 30px;
}

.flashcard {
    width: 100%;
    min-height: 550px;
    position: relative;
    transition: var(--transition);
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    backface-visibility: hidden;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--card-shadow);
    min-height: 550px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.flashcard-back {
    transform: rotateY(180deg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.category-badge {
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.card-number {
    color: var(--secondary-color);
    font-size: 0.9rem;
    font-weight: 500;
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 20px;
}

.question-mark {
    font-size: 4rem;
    color: var(--primary-color);
    animation: pulse 2s ease-in-out infinite;
    line-height: 1;
}

.question-text {
    font-size: 1.5rem;
    color: #333;
    line-height: 1.8;
    max-width: 600px;
}

.question-image {
    max-width: 100%;
    max-height: 450px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    object-fit: contain;
    animation: fadeIn 0.5s ease-out;
}

/* Answer Section */
.answer-section {
    width: 100%;
}

.answer-section h3 {
    color: var(--success-color);
    margin-bottom: 15px;
    font-size: 1.3rem;
    font-weight: 700;
}

.answer-text {
    font-size: 1.2rem;
    color: #333;
    line-height: 1.9;
    margin-bottom: 20px;
    text-align: left;
}

/* Enhanced Image Container */
.image-container {
    margin-top: 30px;
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 280px;  /* Ensure space for larger images */
}

.image-container img {
    max-width: 90%;     /* Take up 90% of container */
    max-height: 450px;  /* Increased from 350px */
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    object-fit: contain;
}

/* Mobile adjustment */
@media (max-width: 768px) {
    .image-container img {
        max-height: 350px;  /* Smaller on mobile */
    }
}

/* Small phones */
@media (max-width: 480px) {
    .image-container img {
        max-height: 250px;
    }
}

/* ========== MARKDOWN FORMATTING SUPPORT ========== */

.question-text strong,
.answer-text strong {
    font-weight: 700;
    color: #1e293b;
}

.question-text em,
.answer-text em {
    font-style: italic;
    color: #334155;
}

.question-text u,
.answer-text u {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.question-text a,
.answer-text a {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s ease;
}

.question-text a:hover,
.answer-text a:hover {
    color: var(--primary-dark);
    text-decoration-thickness: 2px;
}

.answer-text br {
    display: block;
    content: "";
    margin: 8px 0;
}

/* ========== CENTERED TEXT ========== */

.centered-text {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 20px 0;
    padding: 15px;
    color: var(--primary-color);
    background: var(--light-blue);
    border-radius: 8px;
    letter-spacing: 0.5px;
}

/* Mobile adjustment */
@media (max-width: 768px) {
    .centered-text {
        font-size: 1.1rem;
        padding: 12px;
        margin: 15px 0;
    }
}

@media (max-width: 480px) {
    .centered-text {
        font-size: 1rem;
        padding: 10px;
        margin: 10px 0;
    }
}

/* ========== BUTTONS ========== */

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    font-family: inherit;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0px);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-flip {
    background: var(--primary-color);
    color: white;
    width: 100%;
    max-width: 300px;
    margin-top: 20px;
}

.btn-flip:hover {
    background: var(--primary-dark);
}

/* Difficulty Buttons */
.difficulty-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
    width: 100%;
}

.btn-difficulty {
    padding: 20px 15px;
    font-size: 0.95rem;
    line-height: 1.4;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-family: inherit;
}

.btn-difficulty:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.btn-difficulty small {
    font-size: 0.8rem;
    opacity: 0.95;
    display: block;
    font-weight: 500;
}

.btn-hard {
    background: var(--danger-color);
    color: white;
}

.btn-hard:hover {
    background: #dc2626;
}

.btn-good {
    background: var(--warning-color);
    color: white;
}

.btn-good:hover {
    background: #d97706;
}

.btn-easy {
    background: var(--success-color);
    color: white;
}

.btn-easy:hover {
    background: #059669;
}

/* Navigation Buttons */
.navigation-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* ========== COMPLETION SECTION ========== */

.completion-section {
    animation: fadeInUp 0.6s ease-out;
}

.completion-card {
    background: white;
    padding: 60px 40px;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.completion-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: bounce 1s ease-in-out infinite;
    display: inline-block;
}

.completion-card h2 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.completion-message {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 30px;
    line-height: 1.6;
}

.completion-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 40px;
}

.completion-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.completion-stat strong {
    font-size: 3rem;
    color: var(--success-color);
    font-weight: 700;
}

.completion-stat span {
    color: var(--secondary-color);
    font-size: 0.95rem;
    margin-top: 5px;
}

.completion-reminder {
    background: var(--light-blue);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    border-left: 5px solid var(--primary-color);
}

.completion-reminder h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.completion-reminder ul {
    list-style: none;
    text-align: left;
}

.completion-reminder li {
    padding: 10px 15px;
    margin-bottom: 8px;
    background: white;
    border-radius: 8px;
    color: #333;
    font-size: 0.95rem;
    border-left: 3px solid var(--primary-color);
}

/* ========== PRACTICE MODE BADGE ========== */

.practice-mode-badge {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 25px;
    font-weight: 600;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.practice-mode-badge .icon {
    font-size: 1.2rem;
    margin-right: 8px;
}

/* ========== UTILITY CLASSES ========== */

.hidden {
    display: none !important;
}

/* ========== ANIMATIONS ========== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.95;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ========== RESPONSIVE DESIGN ========== */

/* Tablets (1024px and below) */
@media (max-width: 1024px) {
    .header h1 {
        font-size: 2.5rem;
    }

    .logo-image {
        height: 70px;
    }

    .mode-selector {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .flashcard-front,
    .flashcard-back {
        min-height: 480px;
        padding: 30px;
    }

    .flashcard {
        min-height: 480px;
    }
}

/* Tablets (768px and below) */
@media (max-width: 768px) {
    body {
        padding: 20px 15px;
    }

    .header {
        margin-bottom: 35px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .logo-image {
        height: 60px;
    }

    .logo-section {
        flex-direction: column;
        gap: 10px;
    }

    .step-title {
        font-size: 1.2rem;
        margin-bottom: 20px;
    }

    .mode-selector {
        gap: 15px;
        padding: 0;
        margin-bottom: 30px;
    }

    .mode-btn {
        padding: 20px;
    }

    .mode-btn .mode-name {
        font-size: 1.1rem;
    }

    .mode-btn .mode-subtitle {
        font-size: 0.9rem;
    }

    .category-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0;
        margin-bottom: 30px;
    }

    .category-card {
        min-height: 160px;
        padding: 30px 15px;
        font-size: 1.1rem;
    }

    .quick-actions {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 0;
        margin-bottom: 30px;
    }

    .btn-action {
        padding: 15px 20px;
        font-size: 0.95rem;
    }

    .dashboard {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0;
    }

    .stat-card {
        padding: 15px;
        min-height: 100px;
    }

    .stat-number {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    .flashcard-front,
    .flashcard-back {
        min-height: 400px;
        padding: 25px;
    }

    .flashcard {
        min-height: 400px;
    }

    .question-mark {
        font-size: 3rem;
    }

    .question-text {
        font-size: 1.2rem;
    }

    .question-image {
        max-height: 350px;
    }

    .answer-text {
        font-size: 1rem;
    }

    .image-container img {
        max-height: 250px;
    }

    .btn-flip {
        max-width: 100%;
    }

    .difficulty-buttons {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .btn-difficulty {
        padding: 15px 10px;
        font-size: 0.9rem;
    }

    .navigation-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .navigation-buttons .btn {
        width: 100%;
    }

    .completion-card {
        padding: 40px 25px;
    }

    .completion-icon {
        font-size: 4rem;
    }

    .completion-card h2 {
        font-size: 2rem;
    }

    .completion-stats {
        gap: 20px;
    }

    .completion-stat strong {
        font-size: 2.2rem;
    }

    .completion-reminder {
        padding: 15px;
    }

    .practice-mode-badge {
        padding: 10px 15px;
        font-size: 0.95rem;
        margin-bottom: 15px;
    }
}

/* Small Phones (480px and below) */
@media (max-width: 480px) {
    body {
        padding: 15px 10px;
    }

    .container {
        padding: 0;
    }

    .header {
        margin-bottom: 25px;
    }

    .header h1 {
        font-size: 1.6rem;
        line-height: 1.3;
    }

    .logo-image {
        height: 50px;
    }

    .logo-section {
        gap: 8px;
    }

    .trademark {
        font-size: 1.2rem;
    }

    .step-title {
        font-size: 1rem;
        margin-bottom: 15px;
    }

    .mode-selector {
        gap: 12px;
        margin-bottom: 25px;
    }

    .mode-btn {
        padding: 15px;
        gap: 8px;
    }

    .mode-btn .mode-icon {
        font-size: 1.5rem;
    }

    .mode-btn .mode-name {
        font-size: 0.95rem;
    }

    .mode-btn .mode-subtitle {
        font-size: 0.8rem;
    }

    .category-grid {
        gap: 12px;
        margin-bottom: 25px;
    }

    .category-card {
        min-height: 140px;
        padding: 20px 10px;
        font-size: 1rem;
        gap: 10px;
    }
	.quick-actions {
        gap: 8px;
        margin-bottom: 25px;
    }

    .btn-action {
        padding: 12px 15px;
        font-size: 0.9rem;
        border-radius: 8px;
    }

    .dashboard {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-top: 25px;
    }

    .stat-card {
        padding: 12px;
        min-height: 90px;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .progress-bar {
        height: 35px;
        margin-bottom: 20px;
    }

    .progress-text {
        font-size: 0.8rem;
    }

    .flashcard-front,
    .flashcard-back {
        min-height: 350px;
        padding: 20px;
    }

    .flashcard {
        min-height: 350px;
    }

    .card-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
        margin-bottom: 15px;
    }

    .category-badge {
        font-size: 0.8rem;
        padding: 5px 12px;
    }

    .card-number {
        font-size: 0.8rem;
    }

    .question-mark {
        font-size: 2.5rem;
        margin-bottom: 10px;
    }

    .question-text {
        font-size: 1rem;
        line-height: 1.6;
        max-width: 100%;
    }

    .question-image {
        max-height: 280px;
    }

    .answer-section h3 {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }

    .answer-text {
        font-size: 0.95rem;
        line-height: 1.7;
        margin-bottom: 12px;
    }

    .image-container img {
        max-height: 200px;
    }

    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
        border-radius: 8px;
    }

    .btn-flip {
        max-width: 100%;
        padding: 12px 20px;
        margin-top: 12px;
    }

    .difficulty-buttons {
        gap: 8px;
        margin-top: 12px;
    }

    .btn-difficulty {
        padding: 12px 8px;
        font-size: 0.85rem;
    }

    .btn-difficulty small {
        font-size: 0.7rem;
    }

    .navigation-buttons {
        gap: 8px;
        margin-top: 20px;
    }

    .navigation-buttons .btn {
        font-size: 0.9rem;
        padding: 10px 15px;
    }

    .completion-card {
        padding: 30px 20px;
        border-radius: 15px;
    }

    .completion-icon {
        font-size: 3.5rem;
        margin-bottom: 15px;
    }

    .completion-card h2 {
        font-size: 1.6rem;
        margin-bottom: 12px;
    }

    .completion-message {
        font-size: 1rem;
        margin-bottom: 20px;
    }

    .completion-stats {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 25px;
    }

    .completion-stat strong {
        font-size: 2rem;
    }

    .completion-stat span {
        font-size: 0.85rem;
    }

    .completion-reminder {
        padding: 12px;
        margin-bottom: 20px;
    }

    .completion-reminder h3 {
        font-size: 1rem;
        margin-bottom: 10px;
    }

    .completion-reminder li {
        padding: 8px 10px;
        font-size: 0.9rem;
        margin-bottom: 6px;
    }

    .practice-mode-badge {
        padding: 8px 12px;
        font-size: 0.85rem;
        margin-bottom: 12px;
        border-radius: 8px;
    }

    .practice-mode-badge .icon {
        font-size: 1rem;
        margin-right: 6px;
    }
}

/* Extra Small Phones (less than 360px) */
@media (max-width: 360px) {
    .header h1 {
        font-size: 1.4rem;
    }

    .logo-image {
        height: 45px;
    }

    .step-title {
        font-size: 0.95rem;
    }

    .mode-btn .mode-name {
        font-size: 0.9rem;
    }

    .mode-btn .mode-subtitle {
        font-size: 0.75rem;
    }

    .category-card {
        min-height: 130px;
        font-size: 0.95rem;
        padding: 15px 8px;
    }

    .dashboard {
        gap: 6px;
    }

    .stat-card {
        padding: 10px;
        min-height: 80px;
    }

    .stat-number {
        font-size: 1.6rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .question-text {
        font-size: 0.95rem;
    }

    .answer-text {
        font-size: 0.9rem;
    }

    .btn-difficulty {
        padding: 10px 6px;
        font-size: 0.8rem;
    }

    .completion-card h2 {
        font-size: 1.4rem;
    }
}

/* ========== PRINT STYLES ========== */

@media print {
    body {
        background: white;
        padding: 0;
    }

    .header,
    .dashboard,
    .navigation-buttons,
    .practice-mode-badge,
    .quick-actions {
        display: none !important;
    }

    .flashcard-front,
    .flashcard-back {
        box-shadow: none;
        page-break-inside: avoid;
        border: 1px solid #ccc;
    }

    .flashcard {
        page-break-after: always;
    }
}

/* ========== HIGH CONTRAST MODE ========== */

@media (prefers-contrast: more) {
    :root {
        --primary-color: #0052cc;
        --dark-navy: #000000;
    }

    .category-card {
        border: 2px solid white;
    }

    .btn {
        border: 1px solid rgba(0, 0, 0, 0.3);
        text-decoration: underline;
    }

    .flashcard-front,
    .flashcard-back {
        border: 2px solid var(--dark-navy);
    }
}

/* ========== REDUCED MOTION ========== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .flashcard-inner {
        transition: none;
    }

    .progress-fill {
        transition: none;
    }

    .logo-image {
        animation: none;
    }

    .question-mark {
        animation: none;
    }

    .completion-icon {
        animation: none;
    }
}

/* ========== DARK MODE SUPPORT ========== */

@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
        color: #e0e0e0;
    }

    .header h1 {
        color: #e0eeff;
    }

    .step-title {
        color: #e0eeff;
    }

    .mode-btn {
        background: #2d3561;
        border-color: #e0eeff;
        color: #e0eeff;
    }

    .mode-btn .mode-name {
        color: #e0eeff;
    }

    .mode-btn .mode-subtitle {
        color: #b0b0b0;
    }

    .mode-btn:hover {
        background: #3d4571;
    }

    .flashcard-front,
    .flashcard-back {
        background: #2d3561;
        color: #e0e0e0;
    }

    .question-text,
    .answer-text {
        color: #e0e0e0;
    }

    .question-text strong,
    .answer-text strong {
        color: #f0f0f0;
    }

    .question-text a,
    .answer-text a {
        color: #64b5f6;
    }

    .answer-section h3 {
        color: #66bb6a;
    }

    .btn-action {
        background: #2d3561;
        border-color: #e0eeff;
        color: #e0eeff;
    }

    .btn-action:hover {
        background: #e0eeff;
        color: #2d3561;
    }

    .completion-card {
        background: #2d3561;
        color: #e0e0e0;
    }

    .completion-reminder {
        background: #1e2a3a;
        border-color: var(--primary-color);
    }

    .completion-reminder h3 {
        color: #64b5f6;
    }

    .completion-reminder li {
        background: #3d4571;
        color: #e0e0e0;
    }

    .practice-mode-badge {
        background: linear-gradient(135deg, #ff8a50, #ff6b6b);
    }

    .progress-bar {
        background: #3d4571;
    }

    .category-badge {
        background: var(--primary-color);
    }

    .card-number {
        color: #b0b0b0;
    }

    .progress-text {
        color: #e0e0e0;
    }
}

/* ========== FOCUS VISIBLE FOR ACCESSIBILITY ========== */

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* ========== TOUCH-FRIENDLY ADJUSTMENTS ========== */

@media (hover: none) and (pointer: coarse) {
    .btn,
    .mode-btn,
    .category-card,
    .btn-action {
        min-height: 48px;
        min-width: 48px;
        padding: 12px 20px;
    }

    .btn-difficulty {
        min-height: 44px;
    }

    .category-card {
        min-height: 140px;
    }

    /* Remove hover effects on touch devices */
    .btn:hover,
    .mode-btn:hover,
    .category-card:hover {
        transform: none;
    }

    .btn:active,
    .mode-btn:active,
    .category-card:active {
        transform: scale(0.98);
    }
}

/* ========== SCROLLBAR STYLING ========== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Firefox scrollbar */
* {
    scrollbar-color: var(--primary-color) #f1f5f9;
    scrollbar-width: thin;
}

/* ========== SELECTION STYLING ========== */

::selection {
    background: var(--primary-color);
    color: white;
}

::-moz-selection {
    background: var(--primary-color);
    color: white;
}

/* ========== FORM ELEMENTS ========== */

input,
textarea,
select {
    font-family: inherit;
    font-size: 1rem;
}

input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ========== PLACEHOLDER TEXT ========== */

::placeholder {
    color: var(--secondary-color);
    opacity: 0.7;
}

:-ms-input-placeholder {
    color: var(--secondary-color);
}

::-ms-input-placeholder {
    color: var(--secondary-color);
}

/* ========== LINK STYLING ========== */

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    text-decoration: underline;
}

a:active {
    opacity: 0.8;
}

/* ========== CUSTOM PROPERTIES FOR EASY ADJUSTMENT ========== */

:root {
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 15px;
    --radius-xl: 20px;

    /* Font Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.25rem;
    --text-xl: 1.5rem;
    --text-2xl: 1.875rem;
    --text-3rem: 2.25rem;

    /* Font Weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;

    /* Z-index Scale */
    --z-hide: -1;
    --z-auto: auto;
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
}

/* ========== THEME VARIATIONS ========== */

/* Blue Theme (default) */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
}

/* Alternative: Green Theme */
.theme-green {
    --primary-color: #10b981;
    --primary-dark: #059669;
}

/* Alternative: Purple Theme */
.theme-purple {
    --primary-color: #8b5cf6;
    --primary-dark: #7c3aed;
}

/* ========== UTILITY MARGIN/PADDING CLASSES ========== */

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mt-4 { margin-top: var(--spacing-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.mb-4 { margin-bottom: var(--spacing-xl); }

.p-1 { padding: var(--spacing-sm); }
.p-2 { padding: var(--spacing-md); }
.p-3 { padding: var(--spacing-lg); }
.p-4 { padding: var(--spacing-xl); }

/* ========== TEXT UTILITY CLASSES ========== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.italic { font-style: italic; }
.underline { text-decoration: underline; }
.line-through { text-decoration: line-through; }

/* ========== FLEXBOX UTILITIES ========== */

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-1 { gap: var(--spacing-sm); }
.gap-2 { gap: var(--spacing-md); }
.gap-3 { gap: var(--spacing-lg); }
.gap-4 { gap: var(--spacing-xl); }

/* ========== DISPLAY UTILITIES ========== */

.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }
.grid { display: grid; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.max-w-full { max-width: 100%; }
.max-h-full { max-height: 100%; }

/* ========== OVERFLOW UTILITIES ========== */

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* ========== OPACITY UTILITIES ========== */

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-100 { opacity: 1; }

/* ========== CURSOR UTILITIES ========== */

.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.cursor-not-allowed { cursor: not-allowed; }

/* ========== BORDER UTILITIES ========== */

.border { border: 1px solid #e5e7eb; }
.border-top { border-top: 1px solid #e5e7eb; }
.border-bottom { border-bottom: 1px solid #e5e7eb; }
.border-left { border-left: 1px solid #e5e7eb; }
.border-right { border-right: 1px solid #e5e7eb; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: 9999px; }

/* ========== SHADOW UTILITIES ========== */

.shadow { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); }

/* ========== BACKGROUND UTILITIES ========== */

.bg-primary {
    background-color: var(--primary-color);
    color: white;
}

.bg-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.bg-success {
    background-color: var(--success-color);
    color: white;
}

.bg-warning {
    background-color: var(--warning-color);
    color: white;
}

.bg-danger {
    background-color: var(--danger-color);
    color: white;
}

.bg-light-blue {
    background-color: var(--light-blue);
    color: var(--dark-navy);
}

/* ========== TEXT COLOR UTILITIES ========== */

.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--secondary-color); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-danger { color: var(--danger-color); }
.text-white { color: white; }
.text-dark { color: var(--dark-navy); }

/* ========== LOADER STYLES (For future use) ========== */

.loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1000;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.spinner {
    border: 4px solid rgba(37, 99, 235, 0.2);
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loader-text {
    color: var(--dark-navy);
    font-weight: 600;
    font-size: 1.1rem;
}

/* ========== RESPONSIVE IMAGE HANDLING ========== */

img {
    max-width: 100%;
    height: auto;
    display: block;
}

picture {
    display: contents;
}

/* ========== SVG STYLING ========== */

svg {
    max-width: 100%;
    height: auto;
}

/* ========== TABLE STYLES (If needed) ========== */

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

th {
    background-color: var(--primary-color);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

tr:hover {
    background-color: #f5f5f5;
}

/* ========== CODE BLOCK STYLES (If needed) ========== */

code {
    background-color: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #d63384;
}

pre {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
}

pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
}

/* ========== BLOCKQUOTE STYLES ========== */

blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 15px;
    margin: 20px 0;
    color: var(--secondary-color);
    font-style: italic;
}

/* ========== HR STYLES ========== */

hr {
    border: none;
    border-top: 2px solid #e5e7eb;
    margin: 30px 0;
}

/* ========== LIST STYLES ========== */

ol,
ul {
    margin: 15px 0;
    padding-left: 25px;
}

li {
    margin: 8px 0;
    line-height: 1.6;
}

ol li {
    list-style-type: decimal;
}

ul li {
    list-style-type: disc;
}

/* ========== FIELDSET STYLES ========== */

fieldset {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

legend {
    padding: 0 10px;
    font-weight: 600;
    color: var(--dark-navy);
}

/* ========== LABEL STYLES ========== */

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

/* End of styles.css */