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

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333;
    transition: background-color 0.3s, color 0.3s;
}

/* === Dark Mode === */
body.dark-mode {
    background-color: #222;
    color: #f4f4f4;
}

.dark-mode .main-header,
.dark-mode .main-footer,
.dark-mode .project-card,
.dark-mode .skill-card,
.dark-mode .timeline-item {
    background-color: #333;
}

/* === Layout === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* === Header === */
.main-header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.nav-list a {
    color: white;
    text-decoration: none;
    padding: 0.5rem;
    transition: color 0.3s;
}

.nav-list a:hover,
.nav-list a.active {
    color: #3498db;
}

#theme-toggle {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    transition: transform 0.3s, background-color 0.3s;
}

#theme-toggle:hover {
    transform: scale(1.1);
    background-color: #2980b9;
}

/* === Hamburger Menu === */
.nav-toggle {
    display: none;
}

.nav-toggle-label {
    display: none;
    cursor: pointer;
}

.nav-toggle-label span {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    margin: 5px;
}

/* === Hero Section === */
.hero {
    background: linear-gradient(to right, #3498db, #8e44ad);
    color: white;
    text-align: center;
    padding: 4rem 0;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-button {
    display: inline-block;
    background: #e74c3c;
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 5px;
    transition: transform 0.3s, background-color 0.3s;
}

.cta-button:hover {
    transform: scale(1.1);
    background-color: #c0392b;
}

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

.filter-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.filter-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.filter-btn.active,
.filter-btn:hover {
    background-color: #2980b9;
}

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

.project-card {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s, opacity 0.3s;
    opacity: 0;
}

.project-card.visible {
    opacity: 1;
}

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

/* === Skills Section === */
.skills {
    padding: 2rem 0;
}

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

.skill-card {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s, opacity 0.3s;
    opacity: 0;
}

.skill-card.animate {
    opacity: 1;
    transform: translateY(0);
}

/* === About Section === */
.about {
    padding: 2rem 0;
}

.about-content {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: center;
}

.profile-img {
    max-width: 150px;
    border-radius: 50%;
}

.bio {
    flex: 1;
}

.skills-progress {
    margin: 2rem 0;
}

.progress-bar {
    background: #ddd;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 1rem;
    position: relative;
    height: 30px;
    line-height: 30px;
    padding-left: 10px;
}

.progress-bar::after {
    content: '';
    display: block;
    background: #3498db;
    height: 100%;
    width: 0;
    transition: width 1s ease;
}

.progress-bar.animate::after {
    width: var(--progress-width);
}

/* === Timeline === */
.timeline {
    margin-top: 2rem;
}

.timeline-item {
    background: white;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid #3498db;
    opacity: 0;
    transition: opacity 0.5s;
}

.timeline-item.animate {
    opacity: 1;
}

/* === Contact Section === */
.contact {
    padding: 2rem 0;
}

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

#contact-form input,
#contact-form textarea {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 5px;
}

#contact-form button {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.75rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

#contact-form button:hover {
    background-color: #2980b9;
}

.error {
    color: #e74c3c;
    font-size: 0.9rem;
}

#form-message {
    margin-top: 1rem;
    text-align: center;
}

/* === Back-to-Top Button === */
#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #3498db;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
}

#back-to-top.visible {
    opacity: 1;
}

/* === Footer === */
.main-footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 1rem 0;
}

.main-footer a {
    color: #3498db;
}

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

@keyframes progress {
    from { width: 0; }
    to { width: var(--progress-width); }
}

/* === Responsive Design === */
@media (max-width: 768px) {
    .nav-list {
        display: none;
        flex-direction: column;
        background: #2c3e50;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
    }

    .nav-toggle:checked ~ .nav-list {
        display: flex;
    }

    .nav-toggle-label {
        display: block;
    }

    .about-content {
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .hero h2 {
        font-size: 1.8rem;
    }
}