/* Common styles for all learn pages */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: #1a1a1a;
    /* Dark background */
    position: relative;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 1rem;
    line-height: 1.6;
    color: #fff;
    /* Light text for dark background */
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(90deg, rgba(0, 188, 212, 0.15) 1px, transparent 1px),
        linear-gradient(rgba(0, 188, 212, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px, 50px 50px, 25px 25px, 25px 25px;
    animation: gridMove 20s linear infinite;
    z-index: -1;
    pointer-events: none;
}

@keyframes gridMove {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(50px);
    }
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 0%, rgba(26, 26, 26, 0.9) 100%);
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1400px;
    width: 100%;
    background: rgba(26, 26, 26, 0.95);
    border-radius: 15px;
    padding: 3rem;
    box-shadow: 0 10px 40px rgba(0, 188, 212, 0.15);
    text-align: center;
    border: 1px solid rgba(0, 188, 212, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: visible;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(45deg, rgba(0, 188, 212, 0.05) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(0, 188, 212, 0.05) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(0, 188, 212, 0.05) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(0, 188, 212, 0.05) 75%);
    background-size: 40px 40px;
    background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
    z-index: -1;
    animation: containerGridMove 20s linear infinite;
}

@keyframes containerGridMove {
    0% {
        background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
    }

    100% {
        background-position: 40px 40px, 40px 60px, 60px 20px, 20px 40px;
    }
}

.instruction-box {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(26, 26, 26, 0.8);
    border-radius: 10px;
    border-left: 4px solid #00bcd4;
    color: #fff;
}

.instruction-box h2 {
    color: #00bcd4;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(0, 188, 212, 0.3);
}

.instruction-box ul {
    list-style-position: inside;
    margin: 1rem 0;
    color: #fff;
}

.keyboard {
    margin: 1rem 0;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.hand-label {
    position: absolute;
    top: -25px;
    font-size: 0.9rem;
    color: #00bcd4;
    text-shadow: 0 0 10px rgba(0, 188, 212, 0.3);
    font-weight: bold;
}

.left-hand-label {
    left: 20%;
}

.right-hand-label {
    right: 20%;
}

/* Space Bar Row Styles */
.space-row {
    margin-top: 1rem;
}

.space-key {
    width: 300px !important;
    height: 50px !important;
    font-size: 1.2rem !important;
    background: rgba(26, 26, 26, 0.8);
    border: 1px solid rgba(0, 187, 212, 0.344);
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 188, 212, 0.1);
    color: #fff;
}

.space-key:hover {
    background: rgba(0, 188, 212, 0.1);
    border-color: rgba(0, 188, 212, 0.3);
}

.space-key.active {
    background: #00d420;
    color: #a10e0e;
    text-shadow: 0 0 5px red;
    transform: translateY(2px);
    box-shadow: 0 0 25px rgba(0, 187, 212, 0.724);
}

/* Row-specific space key styles */
.home-row.active ~ .space-row .space-key {
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.top-row.active ~ .space-row .space-key {
    border-color: #ff00ff;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.3);
}

.bottom-row.active ~ .space-row .space-key {
    border-color: #00ff00;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
}

.number-row.active ~ .space-row .space-key {
    border-color: #ff9900;
    box-shadow: 0 0 15px rgba(255, 153, 0, 0.3);
}

.symbol-row.active ~ .space-row .space-key {
    border-color: #9900ff;
    box-shadow: 0 0 15px rgba(153, 0, 255, 0.3);
}

.key {
    width: 50px;
    height: 50px;
    background: rgba(26, 26, 26, 0.8);
    border: 1px solid rgba(0, 187, 212, 0.344);
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 188, 212, 0.1);
    color: #fff;
}

.key:hover {
    background: rgba(0, 188, 212, 0.1);
    border-color: rgba(0, 188, 212, 0.3);
}

.key.active {
    background: #00d420;
    color: #a10e0e;
    text-shadow: 0 0 5px red;
    transform: translateY(2px);
    box-shadow: 0 0 25px rgba(0, 187, 212, 0.724);
}

.stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(26, 26, 26, 0.8);
    border-radius: 10px;
    border: 1px solid rgba(0, 188, 212, 0.1);
    color: #fff;
}

.stats-row {
    display: flex;
    justify-content: space-around;
    gap: 2rem;
}

.stat-item {
    text-align: center;
    padding: 0.5rem 1rem;
    background: rgba(0, 188, 212, 0.1);
    border-radius: 5px;
    min-width: 150px;
}

.stat-item span {
    color: #00bcd4;
    font-weight: bold;
}

/* Responsive styles for stats */
@media (max-width: 768px) {
    .stats {
        padding: 0.8rem;
        margin-top: 1.5rem;
    }

    .stats-row {
        gap: 1rem;
        flex-wrap: wrap;
    }

    .stat-item {
        min-width: 120px;
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 500px) {
    .stats {
        padding: 0.6rem;
        margin-top: 1rem;
    }

    .stats-row {
        gap: 0.5rem;
    }

    .stat-item {
        min-width: 100px;
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
}

/* Exercise Modal Styles */

.exercise-button {
    padding: 1rem 2rem;
    background: #00bcd4;
    margin-right: 1rem;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.3rem;
    box-shadow: 0 2px 10px rgba(0, 188, 212, 0.2);
    transition: all 0.2s;
}

.exercise-button:hover {
    background: rgba(0, 188, 212, 0.8);
    border-radius: 35px;
    box-shadow: 0 4px 15px rgba(0, 188, 212, 0.3);
}

.exercise-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.exercise-modal.active {
    opacity: 1;
    visibility: visible;
}

.exercise-content {
    background: rgba(26, 26, 26, 0.95);
    padding: 1.5rem;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    position: relative;
    border: 1px solid rgba(0, 188, 212, 0.1);
    box-shadow: 0 10px 40px rgba(0, 188, 212, 0.15);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.exercise-modal.active .exercise-content {
    transform: scale(1);
}

.close-exercise {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #00bcd4;
}

.exercise-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 15px;
    max-width: 600px;
    margin: 0 auto;
}

/* Progress Bar Styles */
.progress-container {
    width: 100%;
    max-width: 300px;
    margin-bottom: 8px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(26, 26, 26, 0.8);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.4rem;
    border: 1px solid rgba(0, 188, 212, 0.1);
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: #00bcd4;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 188, 212, 0.3);
}

.progress-text {
    color: #00bcd4;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.next-button {
    padding: 1rem 2rem;
    background: #00bcd4;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.3rem;
    box-shadow: 0 2px 10px rgba(0, 188, 212, 0.2);
    transition: all 0.2s;
    text-decoration: none;
}

.next-button:hover {
    background: rgba(0, 188, 212, 0.8);
    border-radius: 35px;
    box-shadow: 0 4px 15px rgba(0, 188, 212, 0.3);
}

.word-display {
    font-size: 3rem;
    margin: 5px 0;
    min-height: 30px;
    text-align: center;
    color: #fff;
}

.word-display .letter {
    display: inline-block;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.word-input {
    width: 100%;
    max-width: 350px;
    padding: 10px;
    font-size: 1.1em;
    background: rgba(26, 26, 26, 0.8);
    border: 2px solid rgba(0, 188, 212, 0.2);
    border-radius: 8px;
    text-align: center;
    margin-bottom: 10px;
    color: #fff;
}

.word-input:focus {
    outline: none;
    border-color: #00bcd4;
    box-shadow: 0 0 10px rgba(0, 188, 212, 0.2);
}

.stats-display {
    display: flex;
    justify-content: space-around;
    padding: 0.8rem;
    background: rgba(26, 26, 26, 0.8);
    border-radius: 10px;
    border: 1px solid rgba(0, 188, 212, 0.1);
    color: #fff;
    font-size: 0.9rem;
}

.stats-display div {
    text-align: center;
}

/* Back button */
.back-button {
    position: fixed;
    bottom: 20px;
    right: 30px;
    padding: 10px 20px;
    background: #00bcd4;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 188, 212, 0.2);
}

.back-button:hover {
    background: rgba(0, 188, 212, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 188, 212, 0.3);
}

/* Hand Guide Styles */
.hand-guide {
    position: absolute;
    bottom: 5rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 1000;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Hide hand guide when modal is active */
.exercise-modal.active ~ .hand-guide,
.exercise-modal.active ~ .back-button {
    opacity: 0;
    visibility: hidden;
}

.hand {
    display: flex;
    gap: 10px;
    height: 100px;
    position: relative;
    pointer-events: none;
    background: rgba(26, 26, 26, 0.8);
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0, 188, 212, 0.2);
}

/* Left hand palm */
.hand.left-hand::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: -5px;
    width: 40px;
    height: 20px;
    background: rgba(26, 26, 26, 0.8);
    border: 1px solid rgba(0, 188, 212, 0.1);
    border-radius: 50% 0 0 50%;
    z-index: -1;
}

/* Right hand palm */
.hand.right-hand::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: -5px;
    width: 40px;
    height: 20px;
    background: rgba(26, 26, 26, 0.8);
    border: 1px solid rgba(0, 188, 212, 0.1);
    border-radius: 0 50% 50% 0;
    z-index: -1;
}

.finger {
    width: 30px;
    background: #00bcd4;
    border: 1px solid rgba(0, 188, 212, 0.1);
    border-radius: 15px 15px 0 0;
    position: relative;
    transition: all 0.3s ease;
    pointer-events: none;
}

.finger.active {
    background: #d40000;
    box-shadow: 0 0 15px rgba(0, 188, 212, 0.3);
}

.finger-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: #00bcd4;
    white-space: nowrap;
    pointer-events: none;
}

/* Finger heights */
.finger.pinky {
    height: 50px;
}

.finger.ring {
    height: 55px;
}

.finger.middle {
    height: 60px;
}

.finger.index {
    height: 55px;
}

.finger.thumb {
    height: 40px;
    width: 25px;
    margin-left: 10px;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .hand-guide {
        bottom: 3rem;
        padding: 0 1.5rem;
    }

    .hand {
        gap: 7px;
        height: 80px;
    }
    .finger{
        width: 20px;
    }
}

@media (max-width: 768px) {
    .hand-guide {
        bottom: 2rem;
        padding: 0 1rem;
    }

    .hand {
        padding: 10px;
    }

    .finger {
        width: 20px;
    }

    .finger.pinky {
        height: 35px;
    }

    .finger.ring {
        height: 38px;
    }

    .finger.middle {
        height: 40px;
    }

    .finger.index {
        height: 38px;
    }

    .finger.thumb {
        height: 30px;
        width: 18px;
        margin-left: 5px;
    }

    .finger-label {
        font-size: 0.7rem;
        bottom: -20px;
    }

    /* Adjust palm sizes for mobile */
    .hand.left-hand::after,
    .hand.right-hand::after {
        width: 30px;
        height: 15px;
        bottom: -8px;
    }
}
@media (max-width: 500px) {
    .hand-guide {
        bottom: 3rem;
        padding: 0 0.5rem;
    }

    .hand {
        gap: 7px;
        height: 50px;
    }
    .finger{
        width: 10px;
    }
}
/* Row-specific styles */
.home-row .key {
    background-color: #2a2a2a;
    border-color: #00ffff;
}

.top-row .key {
    background-color: #2a2a2a;
    border-color: #ff00ff;
}

.bottom-row .key {
    background-color: #2a2a2a;
    border-color: #00ff00;
}

.number-row .key {
    background-color: #2a2a2a;
    border-color: #ff9900;
}

.symbol-row .key {
    background-color: #2a2a2a;
    border-color: #9900ff;
    font-size: 1em;
    height: 70px;
}

.symbol-row .key br {
    margin: 4px 0;
}

/* Row-specific active styles */
.home-row.active .key {
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.top-row.active .key {
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.bottom-row.active .key {
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.number-row.active .key {
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.symbol-row.active .key {
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

/* Ensure keyboard is clickable */
.keyboard-container {
    position: relative;
}

.key {
    position: relative;
}

.target-key {
    font-size: 1.5rem;
    margin: 1rem 0;
    color: #00bcd4;
    text-shadow: 0 0 10px rgba(0, 188, 212, 0.3);
}

.finger-info {
    font-size: 1.2rem;
    margin: 0.5rem 0 1.5rem;
    color: #fff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

.finger-info .hand-info,
.finger-info .finger-type {
    color: #00bcd4;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 188, 212, 0.3);
}

.exercise-stats {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
    padding: 10px;
    background: rgba(26, 26, 26, 0.8);
    border-radius: 8px;
    width: 100%;
    max-width: 350px;
    border: 1px solid rgba(0, 188, 212, 0.1);
}

.stat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(0, 188, 212, 0.1);
    border-radius: 6px;
    white-space: nowrap;
    color: #fff;
}

.stat-label {
    color: #00bcd4;
    font-weight: 500;
    font-size: 0.9em;
}

.time-display {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    background: rgba(0, 188, 212, 0.1);
    white-space: nowrap;
}

.time-display i {
    color: #00bcd4;
}

.time-display .best-time {
    color: #00bcd4;
    margin-left: 12px;
    font-weight: 500;
    padding-left: 12px;
    border-left: 2px solid rgba(0, 188, 212, 0.2);
}

.info-box {
    background-color: rgba(26, 26, 26, 0.8);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 188, 212, 0.1);
    border: 1px solid rgba(0, 188, 212, 0.1);
}

.info-box h3 {
    color: #00bcd4;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2em;
    text-shadow: 0 0 10px rgba(0, 188, 212, 0.3);
}

.info-box p {
    color: #fff;
    margin-bottom: 15px;
    line-height: 1.5;
}

.info-box ul {
    margin-bottom: 15px;
    padding-left: 20px;
}

.info-box li {
    color: #fff;
    margin-bottom: 8px;
    line-height: 1.4;
}

.info-box li strong {
    color: #00bcd4;
    text-shadow: 0 0 5px rgba(0, 188, 212, 0.3);
}

.exercise-note {
    background-color: rgba(0, 188, 212, 0.1);
    border-left: 4px solid #00bcd4;
    padding: 12px 15px;
    margin-top: 20px;
    border-radius: 0 4px 4px 0;
}

.exercise-note strong {
    color: #00bcd4;
    text-shadow: 0 0 5px rgba(0, 188, 212, 0.3);
}