/* Math Adventures - Adaptive Learning System Styles */
/* Gold & Olive Green Theme */

/* CSS Variables for Easy Theming */
:root {
    --color-gold: #daa520;
    --color-gold-dark: #b8860b;
    --color-gold-light: #ffd700;
    --color-olive: #556b2f;
    --color-olive-dark: #2d5016;
    --color-olive-light: #6b8e23;
    --color-white: #ffffff;
    --color-bg-light: #f8f8f8;
    --color-text-dark: #2d5016;
    --color-correct: #32cd32;
    --color-incorrect: #ee5a24;
    --color-shadow: rgba(0, 0, 0, 0.3);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-image: 
        linear-gradient(45deg, var(--color-olive) 25%, transparent 25%),
        linear-gradient(-45deg, var(--color-olive) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--color-olive) 75%),
        linear-gradient(-45deg, transparent 75%, var(--color-olive) 75%);
    background-size: 60px 60px;
    background-position: 0 0, 0 30px, 30px -30px, -30px 0px;
    background-color: var(--color-gold);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Main Container */
.container {
    background: linear-gradient(145deg, var(--color-white), var(--color-bg-light));
    border-radius: 30px;
    box-shadow: 0 20px 60px var(--color-shadow);
    max-width: 700px;
    width: 100%;
    padding: 50px;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.5s ease-in;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--color-gold), var(--color-olive), var(--color-gold));
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    box-shadow: 0 5px 15px rgba(218, 165, 32, 0.4);
    animation: bounce 2s infinite;
}

h1 {
    color: var(--color-text-dark);
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    color: var(--color-olive);
    font-size: 1.1em;
    font-weight: 500;
}

/* Form Elements */
.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    color: var(--color-text-dark);
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 1em;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid var(--color-gold);
    border-radius: 15px;
    font-size: 1.1em;
    transition: all 0.3s ease;
    background: var(--color-white);
}

input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: var(--color-olive);
    box-shadow: 0 0 0 4px rgba(85, 107, 47, 0.1);
    transform: translateY(-2px);
}

.input-hint {
    font-size: 0.85em;
    color: var(--color-olive);
    margin-top: 5px;
    font-style: italic;
}

/* Difficulty Buttons */
.difficulty-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 10px;
}

.diff-btn {
    padding: 15px;
    border: 2px solid var(--color-gold);
    background: var(--color-white);
    border-radius: 15px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--color-text-dark);
}

.diff-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.diff-btn.active {
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark));
    color: var(--color-white);
    border-color: var(--color-gold-dark);
}

/* Primary Button */
.primary-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--color-olive), var(--color-olive-dark));
    color: var(--color-white);
    border: none;
    border-radius: 15px;
    font-size: 1.2em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 5px 20px rgba(85, 107, 47, 0.3);
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(85, 107, 47, 0.4);
}

.primary-btn:active {
    transform: translateY(-1px);
}

/* Puzzle Display */
.puzzle-display {
    text-align: center;
    margin: 50px 0;
}

.puzzle-text {
    font-size: 4em;
    font-weight: bold;
    color: var(--color-text-dark);
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.5s ease;
}

.answer-input {
    text-align: center;
    font-size: 2em;
    width: 200px;
    margin: 0 auto;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    background: linear-gradient(135deg, #f0f0f0, #e8e8e8);
    border-radius: 15px;
    margin-bottom: 30px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    color: var(--color-olive);
    font-size: 0.9em;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--color-text-dark);
}

.stat-correct {
    color: var(--color-correct);
}

.stat-incorrect {
    color: var(--color-incorrect);
}

.stat-accuracy {
    color: var(--color-gold);
}

/* Progress Info */
.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, var(--color-bg-light), #e8e8e8);
    border-radius: 15px;
}

.info-text {
    color: var(--color-text-dark);
    font-weight: 600;
}

/* Difficulty Badge */
.difficulty-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
}

.badge-easy {
    background: linear-gradient(135deg, #90ee90, var(--color-correct));
    color: #1a5c1a;
}

.badge-medium {
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-light));
    color: #8b6914;
}

.badge-hard {
    background: linear-gradient(135deg, #ff6b6b, var(--color-incorrect));
    color: var(--color-white);
}

/* Feedback Messages */
.feedback {
    text-align: center;
    padding: 40px;
    border-radius: 20px;
    font-size: 2em;
    font-weight: bold;
    margin: 30px 0;
    animation: popIn 0.3s ease;
}

.feedback-correct {
    background: linear-gradient(135deg, #d4f4dd, #a8e6cf);
    color: #1a5c1a;
}

.feedback-incorrect {
    background: linear-gradient(135deg, #ffe5e5, #ffcccc);
    color: #c41e3a;
}

/* Summary Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.summary-card {
    padding: 25px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-5px);
}

.card-green {
    background: linear-gradient(135deg, #d4f4dd, #a8e6cf);
}

.card-gold {
    background: linear-gradient(135deg, #fff4cc, #ffe699);
}

.card-olive {
    background: linear-gradient(135deg, #e8f0d8, #d5e5b8);
}

.card-label {
    color: var(--color-text-dark);
    font-size: 0.9em;
    margin-bottom: 10px;
    font-weight: 600;
}

.card-value {
    font-size: 2.5em;
    font-weight: bold;
    color: var(--color-text-dark);
}

.card-value-small {
    font-size: 1.8em;
}

/* Circular Progress Bar */
.circle-progress-container {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.circle-progress {
    transform: rotate(-90deg);
}

.circle-bg {
    fill: none;
    stroke: #e8e8e8;
    stroke-width: 12;
}

.circle-fill {
    fill: none;
    stroke: var(--color-gold);
    stroke-width: 12;
    stroke-linecap: round;
    stroke-dasharray: 534;
    stroke-dashoffset: 534;
    transition: stroke-dashoffset 1.5s ease-in-out;
}

.circle-text-large {
    font-size: 36px;
    font-weight: bold;
    fill: var(--color-text-dark);
    text-anchor: middle;
    transform: rotate(90deg);
    transform-origin: center;
}

.circle-text-small {
    font-size: 14px;
    fill: var(--color-olive);
    text-anchor: middle;
    transform: rotate(90deg);
    transform-origin: center;
}

/* Progress Bars */
.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    margin-top: 15px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 1s ease-in-out;
    width: 0;
}

.progress-correct {
    background: linear-gradient(90deg, var(--color-correct), #90ee90);
}

/* Time Indicator */
.time-indicator {
    margin-top: 15px;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.time-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--color-gold), var(--color-gold-light));
    border-radius: 10px;
    transition: width 1s ease-in-out;
}

/* Difficulty Dots */
.difficulty-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.dot.active {
    background: var(--color-olive);
    transform: scale(1.2);
    box-shadow: 0 0 10px var(--color-olive);
}

/* Star Rating */
.star-rating {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 15px;
    font-size: 24px;
}

.star {
    color: #ddd;
    transition: all 0.3s ease;
}

.star.filled {
    color: var(--color-gold);
    animation: starPop 0.5s ease;
}

@keyframes starPop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Trophy */
.trophy {
    font-size: 80px;
    margin: 20px 0;
    animation: rotate 2s infinite;
}

/* Adaptive Path Display */
.adaptive-path {
    background: linear-gradient(135deg, var(--color-bg-light), #e8e8e8);
    padding: 25px;
    border-radius: 20px;
    margin: 20px 0;
}

.path-title {
    color: var(--color-text-dark);
    font-weight: bold;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.path-item {
    padding: 10px;
    margin: 8px 0;
    background: var(--color-white);
    border-radius: 10px;
    border-left: 4px solid var(--color-gold);
    transition: all 0.3s ease;
}

.path-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Recommendation Box */
.recommendation {
    background: linear-gradient(135deg, #e8f0d8, #d5e5b8);
    border: 2px solid var(--color-olive);
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    text-align: center;
}

.recommendation-text {
    color: var(--color-text-dark);
    font-weight: 600;
    font-size: 1.1em;
}

/* Utility Classes */
.hidden {
    display: none;
}

/* Google Sign-In Styles */
.google-signin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    padding: 12px 24px;
    background: white;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #3c4043;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
        
.google-signin-btn:hover {
    background: #f8f9fa;
    border-color: #d2d3d4;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}
        
.google-signin-btn:active {
    background: #f1f3f4;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
        
.google-signin-btn svg {
    flex-shrink: 0;
}
.auth-section {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f8f8, #e8e8e8);
    border-radius: 15px;
}

.google-signin-container {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.auth-message {
    color: var(--color-olive);
    font-size: 0.9em;
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #e8f0d8, #d5e5b8);
    border-radius: 15px;
    margin-bottom: 25px;
}

.user-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid var(--color-gold);
}

.user-details {
    flex: 1;
    text-align: left;
}

.user-name-display {
    font-weight: bold;
    color: var(--color-text-dark);
    margin: 0 0 5px 0;
}

.user-rating {
    color: var(--color-olive);
    font-size: 0.9em;
    margin: 0;
}

.sign-out-btn {
    padding: 8px 16px;
    background: white;
    border: 2px solid var(--color-olive);
    border-radius: 10px;
    color: var(--color-olive);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sign-out-btn:hover {
    background: var(--color-olive);
    color: white;
}

/* Leaderboard Preview */
.leaderboard-preview {
    margin-top: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #fff4cc, #ffe699);
    border-radius: 15px;
}

.leaderboard-preview h3 {
    color: var(--color-text-dark);
    margin-bottom: 15px;
    text-align: center;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: white;
    border-radius: 10px;
    margin-bottom: 8px;
}

.leaderboard-rank {
    width: 30px;
    height: 30px;
    background: var(--color-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

.leaderboard-photo {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid var(--color-gold);
}

.leaderboard-initial {
    background: linear-gradient(135deg, var(--color-gold), var(--color-olive));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
}

.leaderboard-info {
    flex: 1;
}

.leaderboard-name {
    font-weight: 600;
    color: var(--color-text-dark);
    margin: 0;
}

.leaderboard-rating {
    font-size: 0.9em;
    color: var(--color-olive);
}

/* Rating Change Indicator */
.rating-change {
    margin-top: 10px;
    font-size: 1.2em;
    font-weight: bold;
}

.rating-up {
    color: #32cd32;
}

.rating-down {
    color: #ee5a24;
}

.rating-neutral {
    color: var(--color-gold);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes rotate {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-10deg);
    }
    75% {
        transform: rotate(10deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 30px;
    }

    h1 {
        font-size: 2em;
    }

    .puzzle-text {
        font-size: 3em;
    }

    .answer-input {
        font-size: 1.5em;
        width: 150px;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .stats-bar {
        flex-direction: column;
        gap: 15px;
    }

    .difficulty-buttons {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.5em;
    }

    .puzzle-text {
        font-size: 2.5em;
    }

    .logo {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }

    .card-value {
        font-size: 2em;
    }
}