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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg,
        #ff9a9e 0%,     /* Soft Pink */
        #feca57 14%,    /* Golden Yellow */
        #48cae4 28%,    /* Sky Blue */
        #54a0ff 42%,    /* Bright Blue */
        #5f27cd 57%,    /* Purple */
        #00d2d3 71%,    /* Turquoise */
        #ff9ff3 85%,    /* Light Purple */
        #54a0ff 100%);  /* Back to Blue */
    min-height: 100vh;
    padding: 2rem 0;
    color: #333;
    animation: rainbowShift 12s ease-in-out infinite;
}

.main-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    background: rgba(255, 255, 255, 0.95);
    padding: 3rem 2rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    margin-bottom: 2rem;
    text-align: center;
}

/* Hero Section */
.hero-section {
    animation: fadeInUp 0.8s ease-out;
}

h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: -1px;
}

.welcome-message {
    font-size: 1.5rem;
    color: #555;
    margin-bottom: 2rem;
    font-weight: 300;
    line-height: 1.6;
}

.profile-card {
    background: linear-gradient(45deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    margin-top: 2rem;
    box-shadow: 0 10px 30px rgba(240, 147, 251, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(240, 147, 251, 0.4);
}

.profile-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.profile-subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

.decorative-line {
    width: 80px;
    height: 4px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    margin: 1.5rem auto;
    border-radius: 2px;
}

/* About Me Section */
.about-section {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.about-card {
    background: linear-gradient(45deg, #ffeaa7 0%, #fab1a0 100%);
    color: #2d3436;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(255, 234, 167, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.about-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(255, 234, 167, 0.4);
}

.about-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #2d3436;
}

.bio-card {
    background: linear-gradient(45deg, #74b9ff 0%, #0984e3 100%);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    margin-top: 1.5rem;
    box-shadow: 0 10px 30px rgba(116, 185, 255, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bio-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(116, 185, 255, 0.4);
}

/* Coding Journey Section */
.journey-section {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.timeline-item {
    background: linear-gradient(45deg, #fd79a8 0%, #fdcb6e 100%);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(253, 121, 168, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.timeline-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 50px rgba(253, 121, 168, 0.4);
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #00b894, #00cec9, #74b9ff);
}

.timeline-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2d3436;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timeline-content {
    color: #2d3436;
    line-height: 1.6;
}

.coding-goals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.goal-badge {
    background: linear-gradient(45deg, #00b894 0%, #00cec9 100%);
    color: white;
    padding: 1rem;
    border-radius: 50px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 184, 148, 0.3);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.goal-badge:hover {
    transform: scale(1.05);
}

.goal-badge.active {
    background: linear-gradient(45deg, #fd79a8, #fdcb6e) !important;
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(253, 121, 168, 0.4);
}

/* Icons */
.icon {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

/* Games Section */
.games-section {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.game-card {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--card-gradient);
}

.game-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

/* Game card color themes */
.game-card.space { --card-gradient: linear-gradient(90deg, #667eea, #764ba2); }
.game-card.animal { --card-gradient: linear-gradient(90deg, #11998e, #38ef7d); }
.game-card.math { --card-gradient: linear-gradient(90deg, #fc466b, #3f5efb); }
.game-card.memory { --card-gradient: linear-gradient(90deg, #fdbb2d, #22c1c3); }
.game-card.ocean { --card-gradient: linear-gradient(90deg, #2980b9, #6bb6ff); }
.game-card.dragon { --card-gradient: linear-gradient(90deg, #c31432, #240b36); }
.game-card.superhero { --card-gradient: linear-gradient(90deg, #ff9a9e, #fecfef); }
.game-card.robot { --card-gradient: linear-gradient(90deg, #667eea, #764ba2); }
.game-card.magic { --card-gradient: linear-gradient(90deg, #8360c3, #2ebf91); }
.game-card.treasure { --card-gradient: linear-gradient(90deg, #fdcb6e, #e17055); }

.game-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    text-align: center;
}

.game-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2d3436;
    margin-bottom: 0.5rem;
    text-align: center;
}

.game-status {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
    width: 100%;
}

.game-status.play-now {
    background: linear-gradient(45deg, #00b894, #00cec9);
    color: white;
}

.game-description {
    color: #636e72;
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: center;
    margin-top: 0.5rem;
}

/* Memory Game Modal */
.memory-game-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.memory-game-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 25px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalSlideIn 0.4s ease-out;
}

.memory-game-header {
    text-align: center;
    color: white;
    margin-bottom: 1.5rem;
}

.memory-game-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1.5rem;
}

.stat {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.8rem 1.2rem;
    border-radius: 15px;
    color: white;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.3rem;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
}

.memory-game-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.memory-card {
    aspect-ratio: 1;
    background: linear-gradient(45deg, #fdcb6e, #e17055);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    min-height: 80px;
}

.memory-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.3);
}

.memory-card.flipped {
    transform: rotateY(180deg);
}

.memory-card.matched {
    background: linear-gradient(45deg, #00b894, #00cec9);
    animation: matchPulse 0.6s ease;
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.card-front {
    background: linear-gradient(45deg, #fdcb6e, #e17055);
    color: white;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.card-back {
    background: linear-gradient(45deg, #74b9ff, #0984e3);
    transform: rotateY(180deg);
    font-size: 2.5rem;
}

.memory-game-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.restart-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    background: linear-gradient(45deg, #ff7675, #fd79a8);
    color: white;
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Coding Environment Styles */
.coding-environment {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(10px);
}

.coding-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 25px;
    padding: 2rem;
    width: 95%;
    height: 95%;
    max-width: 1400px;
    max-height: 900px;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: modalSlideIn 0.4s ease-out;
    display: flex;
    flex-direction: column;
}

.coding-header {
    text-align: center;
    color: white;
    margin-bottom: 1.5rem;
    position: relative;
}

.coding-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.coding-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.close-coding-btn {
    position: absolute;
    top: -1rem;
    right: -1rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.close-coding-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.coding-content {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    min-height: 0;
}

.html-layout {
    grid-template-columns: 1fr 1fr;
}

.code-editor-section,
.output-section,
.preview-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
}

.editor-header,
.output-header,
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    color: white;
}

.editor-controls {
    display: flex;
    gap: 0.5rem;
}

.run-btn,
.clear-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.run-btn {
    background: linear-gradient(45deg, #00b894, #00cec9);
    color: white;
}

.clear-btn {
    background: linear-gradient(45deg, #ff7675, #fd79a8);
    color: white;
}

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

.code-editor {
    flex: 1;
    background: #2d3748;
    color: #e2e8f0;
    border: none;
    border-radius: 10px;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    outline: none;
    min-height: 300px;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow: auto;
    box-sizing: border-box;
}

.code-editor:focus {
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);
}

.code-output {
    flex: 1;
    background: #1a202c;
    color: #00ff00;
    border-radius: 10px;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    overflow-y: auto;
    white-space: pre-wrap;
    min-height: 300px;
    border: 2px solid #2d3748;
}

.html-preview {
    flex: 1;
    background: white;
    border: none;
    border-radius: 10px;
    min-height: 300px;
    width: 100%;
}

.coding-examples {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.coding-examples h3 {
    color: white;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.2rem;
}

.example-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.8rem;
}

.example-btn {
    background: linear-gradient(45deg, #6c5ce7, #a29bfe);
    color: white;
    border: none;
    padding: 0.8rem 1rem;
    border-radius: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.example-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #5f3dc4, #9775fa);
}

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

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes matchPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Additional animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Game-specific animations */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes explode {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

@keyframes zap {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.3); filter: brightness(2); }
    100% { transform: scale(0); opacity: 0; }
}

@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.5); }
    100% { box-shadow: 0 0 20px rgba(255, 215, 0, 1); }
}

@keyframes collect {
    0% { transform: scale(1) rotate(0deg); opacity: 1; }
    100% { transform: scale(0.1) rotate(360deg); opacity: 0; }
}

@keyframes sparkle {
    0% { transform: scale(0) rotate(0deg); opacity: 1; }
    50% { transform: scale(1.2) rotate(180deg); opacity: 0.8; }
    100% { transform: scale(0) rotate(360deg); opacity: 0; }
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .welcome-message {
        font-size: 1.25rem;
    }

    .section-title {
        font-size: 2rem;
    }

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

    .coding-goals {
        grid-template-columns: 1fr;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
    }

    .main-container {
        padding: 0 15px;
    }

    .section {
        padding: 2rem 1.5rem;
    }

    .coding-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .html-layout {
        grid-template-columns: 1fr;
    }

    .coding-container {
        padding: 1rem;
        width: 98%;
        height: 98%;
    }

    .coding-title {
        font-size: 2rem;
    }

    .editor-controls {
        flex-direction: column;
        gap: 0.3rem;
    }

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

    .code-editor,
    .code-output {
        min-height: 200px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }

    .welcome-message {
        font-size: 1.1rem;
    }

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

    .game-card {
        padding: 1.2rem;
    }

    .memory-game-container {
        padding: 1.5rem;
        width: 95%;
    }

    .memory-game-stats {
        flex-direction: column;
        gap: 0.5rem;
    }

    .memory-game-board {
        gap: 8px;
        padding: 0.8rem;
    }

    .memory-card {
        min-height: 60px;
    }

    .card-face {
        font-size: 1.5rem;
    }

    .card-back {
        font-size: 2rem;
    }

    .coding-examples h3 {
        font-size: 1rem;
    }

    .example-btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }

    .editor-header,
    .output-header,
    .preview-header {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Rainbow Animation */
@keyframes rainbowShift {
    0% {
        background: linear-gradient(135deg,
            #ff0000 0%, #ff8000 14%, #ffff00 28%, #80ff00 42%,
            #00ff00 57%, #00ffff 71%, #0080ff 85%, #8000ff 100%);
    }
    25% {
        background: linear-gradient(135deg,
            #8000ff 0%, #ff0000 14%, #ff8000 28%, #ffff00 42%,
            #80ff00 57%, #00ff00 71%, #00ffff 85%, #0080ff 100%);
    }
    50% {
        background: linear-gradient(135deg,
            #0080ff 0%, #8000ff 14%, #ff0000 28%, #ff8000 42%,
            #ffff00 57%, #80ff00 71%, #00ff00 85%, #00ffff 100%);
    }
    75% {
        background: linear-gradient(135deg,
            #00ffff 0%, #0080ff 14%, #8000ff 28%, #ff0000 42%,
            #ff8000 57%, #ffff00 71%, #80ff00 85%, #00ff00 100%);
    }
    100% {
        background: linear-gradient(135deg,
            #ff0000 0%, #ff8000 14%, #ffff00 28%, #80ff00 42%,
            #00ff00 57%, #00ffff 71%, #0080ff 85%, #8000ff 100%);
    }
}