/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #fff;
    transition: background 0.3s, color 0.3s;
}

body.dark-mode {
    background: #1a1a1a;
    color: #e0e0e0;
}

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

/* Navigation */
.navbar {
    background: #2c3e50;
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #3498db;
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s;
}

.theme-toggle:hover {
    transform: scale(1.2);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 6rem 2rem;
}

body.dark-mode .hero {
    background: linear-gradient(135deg, #4a5f8f 0%, #5a3a7a 100%);
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: slideInDown 0.8s ease;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    animation: slideInUp 0.8s ease;
}

.cta-button {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}

.cta-button:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* About Section */
.about {
    padding: 4rem 2rem;
    background: #f8f9fa;
}

body.dark-mode .about {
    background: #2a2a2a;
}

.about h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.about p {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

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

.skill {
    background: white;
    padding: 2rem;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s;
}

body.dark-mode .skill {
    background: #333;
}

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

.skill h3 {
    margin-bottom: 1rem;
    color: #3498db;
}

/* Projects Section */
.projects {
    padding: 4rem 2rem;
}

.projects h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2rem;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background: white;
    padding: 2rem;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

body.dark-mode .project-card {
    background: #333;
}

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

.project-card h3 {
    color: #3498db;
    margin-bottom: 1rem;
}

.project-link {
    display: inline-block;
    color: #3498db;
    text-decoration: none;
    margin-top: 1rem;
    transition: color 0.3s;
}

.project-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Games Section */
.games {
    padding: 4rem 2rem;
    background: #f8f9fa;
}

body.dark-mode .games {
    background: #2a2a2a;
}

.games h2 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.games > .container > p {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

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

.game-card {
    background: white;
    padding: 2rem;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

body.dark-mode .game-card {
    background: #333;
}

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

.game-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

.game-card h3 {
    color: #3498db;
    margin-bottom: 1rem;
}

.play-button {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.3s;
}

.play-button:hover {
    background: #2980b9;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 10px;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

body.dark-mode .modal-content {
    background-color: #333;
}

.close {
    color: #aaa;
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #000;
}

body.dark-mode .close:hover {
    color: #fff;
}

/* Game Container Styles */
#gameContainer {
    font-size: 1rem;
    line-height: 1.8;
}

.game-text {
    margin-bottom: 1.5rem;
    white-space: pre-wrap;
}

.game-choices {
    display: grid;
    gap: 1rem;
}

.choice-button {
    background: #3498db;
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
    text-align: left;
}

.choice-button:hover {
    background: #2980b9;
}

/* Contact Section */
.contact {
    background: #2c3e50;
    color: white;
    padding: 4rem 2rem;
    text-align: center;
}

body.dark-mode .contact {
    background: #1a1a1a;
}

.contact h2 {
    margin-bottom: 1rem;
    font-size: 2rem;
}

.contact p {
    margin-bottom: 2rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    max-width: 500px;
    margin: 0 auto;
    gap: 1rem;
}

.contact-form input,
.contact-form textarea {
    padding: 0.8rem;
    border: none;
    border-radius: 5px;
    font-family: inherit;
    background: #f0f0f0;
    color: #333;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    box-shadow: 0 0 5px #3498db;
}

.submit-button {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.submit-button:hover {
    background: #2980b9;
}

/* Footer */
footer {
    background: #1a252f;
    color: white;
    text-align: center;
    padding: 2rem;
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.social-links a:hover {
    color: #3498db;
}

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

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

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

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

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

    .nav-links {
        flex-direction: column;
        gap: 1rem;
    }

    footer .container {
        flex-direction: column;
        gap: 1rem;
    }

    .navbar .container {
        flex-wrap: wrap;
    }
}