.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 12px 20px;

    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);

    cursor: pointer;
    user-select: none;
    transition: transform 0.15s ease;

    position: sticky;
    top: 0;
    z-index: 1000;
}

.app-header h1:hover {
    transform: scale(1.05);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

body.dark .app-header {
    background: #1b1f2a;
}

.app-header h1 {
    font-size: 24px;
    margin: 0;
}

.lang-deck {
    background: linear-gradient(135deg, #ffffff, #f2f6ff);
    color: #1a1a1a;
    border: 2px solid transparent;
}

.lang-deck:hover {
    border-color: #2f80ed;
}

#darkToggle {
    font-size: 18px;
    padding: 8px 12px;
}

body {
    font-family: "Poppins", sans-serif;
    background: linear-gradient(135deg, #f5f7fa, #e4ecf5);
    margin: 0;
    text-align: center;
    color: #222;
}

/* Dark Mode */
body.dark {
    background: #0f1115;
    color: #e6e6e6;
}

body.dark #dashboard,
body.dark #lessonSelect,
body.dark #studyMode {
    background: #0f1115;
}

body.dark .lang-deck {
    background: #1b1f2a;
    color: #ffffff;
}

body.dark .lesson {
    background: #1b1f2a !important;
    color: white;
}

body.dark .deck,
body.dark .card {
    background: #1b1f2a !important;
    color: #6c6c6c !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.6);
}

body.dark button {
    background: #2c2f3a;
    color: white;
}

body.dark .progress-bar {
    background: #2a2a2a;
}

/* Dashboard cards */
@media (min-width: 700px) {
    #dashboard {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        justify-items: center;
    }
}

.lang-deck {
    background: linear-gradient(135deg, #ffffff, #f4f7ff);
    color: #1a1a1a;

    width: 280px;
    margin: 20px auto;
    padding: 25px;

    border-radius: 16px;
    cursor: pointer;

    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    transition: 0.25s ease;

    border: 2px solid transparent;
}

.lang-deck:hover {
    transform: translateY(-5px);
    border-color: #2f80ed;
}

/* Flashcard */
.card {
    width: 340px;
    height: 200px;
    margin: 30px auto;
    perspective: 1000px;
    position: relative;
    transition: transform 0.2s ease;
}

#cardInner {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

#cardInner.flipped {
    transform: rotateY(180deg);
}

#cardFront, #cardBack {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 18px;
    font-size: 40px;
}

body.dark #cardFront,
body.dark #cardBack {
    color: #000000;
}

#cardBack {
    transform: rotateY(180deg);
    font-size: 30px;
}

.card:active {
    transform: scale(0.97);
}

button {
    margin: 6px;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: #2f80ed;
    color: white;
    font-weight: bold;
    transition: 0.2s ease;
}

button:hover {
    background: #256bd1;
    transform: scale(1.05);
}

/* Progress Bars*/
.progress-bar {
    width: 100%;
    height: 10px;
    background: #e9e9e9;
    margin-top: 12px;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar div {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4caf50, #81c784);
    transition: width 0.4s ease;
}

#lessonList {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

#lessonSelect {
    text-align: center;
}

.lesson {
    background: white;
    width: 260px;
    margin: 15px auto;
    padding: 18px;
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    transition: 0.2s ease;
}

.deck:hover,
.lesson:hover {
    transform: translateY(-5px) scale(1.02);
}

/* GLOBAL APP LAYOUT */
#dashboard,
#lessonSelect,
#studyMode {
    max-width: 900px;
    margin: auto;
    padding: 40px 20px;
}


h1 {
    font-size: 28px;
    margin-bottom: 20px;
}

h2, h3 {
    margin: 10px 0;
}

address {
    text-align: center;
    margin-top: 40px;
    font-size: 14px;
    color: #999;

    justify-content: space-evenly;
    align-items: center;

    padding: 12px 20px;

    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);

    position: sticky;
    top: 0;
    z-index: 1000;
}

body.dark address {
    background: #2c2f3a;
    color: white;
}

#typingInput {
    width: 80%;
    max-width: 400px;

    padding: 12px;

    font-size: 22px;

    border-radius: 10px;
    border: 2px solid #ccc;

    text-align: center;
}

#typingResult {
    font-size: 20px;
    font-weight: bold;
    margin-top: 10px;
}

/* Mobile Responsive Layout */
@media (max-width: 600px) {
    body {
        font-size: 18px;
    }

    .card {
        width: 95%;
        height: 220px;
    }

    #cardFront, #cardBack, #cardBreak {
        font-size: 28px;
    }

    button {
        width: 90%;
        font-size: 16px;
    }
}

#indexView {
    padding: 20px;
}

.index-section {
    margin-bottom: 30px;
}

.index-section h2 {
    margin-bottom: 10px;
    font-size: 20px;
}

/* grid layout */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

/* individual card */
.word-card {
    background: white;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
}

.word-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.12);
}

/* text styling */
.word-front {
    font-size: 18px;
    font-weight: 600;
}

.word-back {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 4px;
}

.word-break {
    font-size: 12px;
    opacity: 0.5;
    margin-top: 6px;
}

.dark .word-card {
    background: #1e1e1e;
    color: white;
}


