/* ===== GLOBAL STYLES ===== */
:root {
    --primary-color: rgb(255, 136, 0);
    --background-dark: rgba(0, 0, 0, 0.85);
}

body {
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 136, 0, 0.1) 0%, transparent 25%),
        radial-gradient(circle at 80% 70%, rgba(255, 136, 0, 0.1) 0%, transparent 25%),
        url(https://i.pinimg.com/originals/3a/44/3d/3a443d0538b33d910c6e701dd6423fb7.gif);
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    font-family: 'Arial', sans-serif;
}

/* ===== UTILITY CLASSES ===== */
.hidden {
    display: none;
}

/* ===== ANIMATIONS ===== */
@keyframes glow {
    from { text-shadow: 0 0 5px rgba(255, 136, 0, 0.5); }
    to { text-shadow: 0 0 15px rgba(255, 136, 0, 0.8); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== CARD STYLES ===== */
.card {
    background: var(--background-dark);
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    padding: 2.5rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 136, 0, 0.1) inset;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
    max-width: 450px;
    width: 100%;
}

/* ===== HEADER & TYPOGRAPHY ===== */
.logo-header {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 3rem;
    font-weight: bold;
    letter-spacing: 2px;
    animation: glow 2s infinite alternate;
}

.logo-p { color: var(--primary-color); }
.logo-type { color: #fff; }
.logo-2 { color: var(--primary-color); }

.title {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    position: relative;
}

.title::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--primary-color);
    margin: 0.5rem auto 0;
    border-radius: 3px;
}

.welcome-message {
    color: white;
    text-align: center;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* ===== FORM ELEMENTS ===== */
.form-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    position: relative;
    width: 100%;
}

.input-group input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 136, 0, 0.5);
    border-radius: 8px;
    color: var(--primary-color);
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 136, 0, 0.2);
}

.input-group label {
    position: absolute;
    left: 45px;
    top: 15px;
    color: rgba(255, 136, 0, 0.7);
    pointer-events: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
    top: -10px;
    left: 40px;
    font-size: 0.75rem;
    background: #000;
    padding: 0 5px;
    color: var(--primary-color);
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 136, 0, 0.7);
    font-size: 1.2rem;
}

/* ===== BUTTONS ===== */
.btn {
    background: linear-gradient(135deg, var(--primary-color), rgb(255, 100, 0));
    color: #000;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    margin: 0.5rem 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(255, 136, 0, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: rgba(255, 136, 0, 0.1);
}

.btn-icon {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: var(--primary-color);
    color: #000;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-icon:hover {
    transform: scale(1.1);
}

/* ===== DECORATIVE ELEMENTS ===== */
.corner-decor {
    position: absolute;
    width: 30px;
    height: 30px;
    border-color: var(--primary-color);
    border-style: solid;
    border-width: 0;
}

.corner-top-left {
    top: 0;
    left: 0;
    border-top-width: 3px;
    border-left-width: 3px;
    border-radius: 8px 0 0 0;
}

.corner-top-right {
    top: 0;
    right: 0;
    border-top-width: 3px;
    border-right-width: 3px;
    border-radius: 0 8px 0 0;
}

.corner-bottom-left {
    bottom: 0;
    left: 0;
    border-bottom-width: 3px;
    border-left-width: 3px;
    border-radius: 0 0 0 8px;
}

.corner-bottom-right {
    bottom: 0;
    right: 0;
    border-bottom-width: 3px;
    border-right-width: 3px;
    border-radius: 0 0 8px 0;
}

/* ===== STATUS MESSAGES ===== */
.status-message {
    padding: 15px;
    border-radius: 8px;
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    animation: fadeIn 0.5s ease-out;
}

.status-message.error {
    background: var(--error-color);
}

.status-message.success {
    background: var(--success-color);
}

.status-icon {
    margin-right: 10px;
    font-size: 1.2rem;
}

/* ===== FOOTER ===== */
.footer-link {
    text-align: center;
    margin-top: 1.5rem;
    color: rgba(255, 136, 0, 0.7);
    font-size: 0.9rem;
}

.footer-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    transition: opacity 0.3s ease;
}

.footer-link a:hover {
    opacity: 0.8;
}

/* ===== PROFILE PAGE ===== */
.profile-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.profile-picture {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 136, 0, 0.1);
}


.profile-picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-picture .emoji-avatar {
    font-size: 3rem;
    line-height: 1;
    text-align: center;
}

.profile-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    background: rgba(255, 136, 0, 0.1);
    border-radius: 8px;
}

.info-label {
    color: rgba(255, 255, 255, 0.8);
    font-weight: bold;
}

.info-value {
    color: var(--primary-color);
    font-weight: bold;
}

/* ===== LEVELS PAGE ===== */
.levels-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 1.5rem;
}

.level-btn {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: bold;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.level-btn.completed {
    background: rgba(255, 136, 0, 0.2);
}

.level-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 136, 0, 0.3);
}

.level-number {
    font-size: 1.8rem;
}

.level-status {
    font-size: 0.8rem;
    margin-top: 5px;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.level-btn.completed .level-status {
    color: #4CAF50;
}

.level-btn:not(.completed) .level-status[data-status="start"] {
    color: var(--primary-color);
    animation: pulse 1.5s infinite;
}

.level-btn .level-status[data-status="locked"] {
    color: #F44336;
}

/* ===== GAME PAGE ===== */
.game-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    background: rgba(255, 136, 0, 0.1);
    padding: 10px 15px;
    border-radius: 8px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    margin-bottom: 5px;
}

.stat-value {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.2rem;
}

#game-container {
    margin-top: 1rem;
}

#text-display {
    font-family: 'Roboto Mono', monospace;
    font-size: 1.4rem;
    line-height: 2rem;
    color: rgba(255, 255, 255, 0.7);
    padding: 15px;
    min-height: 150px;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    text-align: left;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.5);
    outline: none;
    tab-size: 2;
}

#text-input {
    font-family: 'Roboto Mono', monospace;
    font-size: 1.2rem;
    padding: 12px 15px;
}

#text-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 136, 0, 0.2);
}

#progress-bar {
    height: 5px;
    background: rgba(255, 136, 0, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

#progress-bar::after {
    content: '';
    display: block;
    height: 100%;
    width: 0%;
    background: var(--primary-color);
    transition: width 0.1s linear;
}

.text-line {
    display: block;
    margin-bottom: 0.5rem;
    line-height: 1.8rem;
}

.word {
    display: inline-block;
    margin: 0 5px 5px 0;
    position: relative;
}

.correct-word {
    color: rgba(255, 255, 255, 0.3);
}

.current-char {
    position: relative;
    background-color: rgba(255, 136, 0, 0.2);
    border-radius: 2px;
}

.current-char::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    animation: blink 1s infinite;
}

.correct-char {
    color: #4CAF50;
}

.incorrect-char {
    color: #F44336;
    text-decoration: underline;
}

/* ===== STATS POPUP ===== */
.stats-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.stats-content {
    background: var(--background-dark);
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.stats-content h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    background: rgba(255, 136, 0, 0.1);
    padding: 1rem;
    border-radius: 8px;
}

.unlocked-message {
    color: #4CAF50;
    font-weight: bold;
    margin: 1rem 0;
    animation: pulse 1.5s infinite;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 500px) {
    .card {
        padding: 1.5rem;
    }
    
    .logo-header {
        font-size: 2.5rem;
    }
    
    .page-container {
        padding: 1rem;
    }
    
    .levels-grid {
        grid-template-columns: 1fr;
    }
}

#progress-bar {
    --progress: 0%;
    height: 5px;
    background: rgba(255, 136, 0, 0.2);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 1rem;
}

#progress-bar::after {
    content: '';
    display: block;
    height: 100%;
    width: var(--progress);
    background: var(--primary-color);
    transition: width 0.1s linear;
}

/* Add these new styles */
.back-button-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 20px;
}

.back-btn {
    width: 200px;
    padding: 12px;
    font-size: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 136, 0, 0.3);
}

/* Make sure it's visible against the background */
.back-btn {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

/* Add some spacing between form and button */
#signup-page .card, #login-page .card {
    margin-bottom: 20px;
}

.page-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}