* {
    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;
}

/* HEADER */
header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    text-align: center;
    padding: 3rem 2rem;
}

#themeToggle {
    margin-top: 1rem;
    padding: 0.6rem 1.4rem;
    border: none;
    border-radius: 20px;
    cursor: pointer;
}

/* NAV */
nav {
    background: #2c3e50;
    padding: 1rem;
}

nav ul {
    display: flex;
    justify-content: center;
    gap: 2rem;
    list-style: none;
}

nav a {
    color: white;
    text-decoration: none;
}

/* SECTIONS */
section {
    max-width: 1200px;
    margin: auto;
    padding: 4rem 2rem;
}

h2 {
    text-align: center;
    margin-bottom: 2rem;
}

/* ABOUT */
.about-content {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
    align-items: center;
}

.about-image img {
    width: 100%;
    border-radius: 10px;
}

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

.stat-box {
    background: #f4f4f4;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
}

/* RESUME DOWNLOAD */
.resume-download {
    text-align: center;
    margin: 3rem 0 2rem 0;
}

.resume-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.resume-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

/* PROJECTS */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 1rem;
    background: rgba(0,0,0,0.7);
    color: white;
}

.project-links button {
    margin-top: 0.5rem;
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* CONTACT */
.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.contact-card {
    background: #f4f4f4;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    border: 2px solid #e0e0e0;
    transition: transform 0.3s, box-shadow 0.3s;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.contact-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.contact-card p {
    color: #666;
}

.contact-card a {
    color: #667eea;
    text-decoration: none;
    word-break: break-all;
}

.contact-card a:hover {
    text-decoration: underline;
}

/* SOCIAL LINKS */
.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s;
}

.social-btn:hover {
    background: #5568d3;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.contact-form {
    max-width: 600px;
    margin: auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

input, textarea {
    width: 100%;
    padding: 0.7rem;
}

/* FOOTER */
footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem;
}

footer a {
    color: #667eea;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
}

.modal-content {
    background: white;
    max-width: 500px;
    margin: 10% auto;
    padding: 2rem;
    border-radius: 10px;
}

.close {
    float: right;
    font-size: 1.5rem;
    cursor: pointer;
}

/* =======================
   DARK MODE (FINAL)
======================= */

body.dark {
    background: #0f0f0f;
    color: #e6e6e6;
}

body.dark header {
    background: #1a1a1a;
}

body.dark nav,
body.dark footer {
    background: #111;
}

body.dark section {
    background: #0f0f0f;
}

body.dark .stat-box,
body.dark .modal-content {
    background: #1c1c1c;
    color: #e6e6e6;
}

body.dark input,
body.dark textarea {
    background: #1c1c1c;
    color: white;
    border-color: #444;
}

/* Dark mode for new elements */
body.dark .contact-card {
    background: #1c1c1c;
    border-color: #333;
}

body.dark .contact-card h3 {
    color: #e6e6e6;
}

body.dark .contact-card p {
    color: #aaa;
}

body.dark .contact-card a {
    color: #667eea;
}

body.dark footer a {
    color: #667eea;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .social-links {
        flex-direction: column;
        align-items: center;
    }
    
    .about-content {
        flex-direction: column;
    }
}