/* Import Google Fonts for fancy fonts */
@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&family=Cinzel:wght@400;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
    font-family: 'Cinzel', serif;
}

body {
    line-height: 1.6;
    color: #D4CDCD;
    background: #181716;
}

/* Navigation */
nav {
    background: #201E1D;
    color: #C27867;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(194, 120, 103, 0.2);
}

.logo {
    font-family: 'Great Vibes', cursive;
    font-size: 2.2rem;
    font-weight: 700;
    color: #C27867;
    text-shadow: 0 0 1px rgba(194, 120, 103, 0.5), 0 0 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    color: #D4CDCD;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.2s ease;
}

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

/* Theme Toggle Button Style */
.theme-btn {
    background: transparent;
    border: 1px solid rgba(194, 120, 103, 0.4);
    color: #C27867;
    padding: 0.4rem 0.6rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.theme-btn:hover {
    background: #C27867;
    color: #181716;
}

.hamburger {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #C27867;
}

/* Home Section */
#home {
    height: 100vh;
    background: linear-gradient(135deg, #181716, #262322);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #D4CDCD;
    padding: 0 20px;
    position: relative;
}

.hero {
    max-width: 900px;
    margin: 0 auto;
}

/* Scroll Down Indicator Styling */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: #C27867;
    font-size: 1.2rem;
    animation: bounce 2s infinite;
    text-decoration: none;
    transition: color 0.2s ease;
}

.scroll-indicator:hover {
    color: #F5F2EC;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translate(-50%, 0);
    }
    40% {
        transform: translate(-50%, -10px);
    }
    60% {
        transform: translate(-50%, -5px);
    }
}

.hero h1 {
    font-family: 'Great Vibes', cursive;
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #C27867;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #B5ABAB;
}

.cta-button {
    background: #C27867;
    color: #181716;
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    display: inline-block;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.cta-button:hover {
    background: #A86455;
    transform: translateY(-2px);
    color: #F5F2EC;
}

/* About Section */
#about {
    padding: 5rem 2rem;
    background: #201E1D;
    text-align: center;
    color: #D4CDCD;
}

#about h2 {
    font-family: 'Great Vibes', cursive;
    font-size: 2.5rem;
    color: #C27867;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.about-content img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #C27867;
}

.about-content p {
    font-size: 1.1rem;
    text-align: left;
}

/* Projects Section */
#projects {
    padding: 5rem 2rem;
    background: #181716;
    text-align: center;
}

#projects h2 {
    font-family: 'Great Vibes', cursive;
    font-size: 2.5rem;
    color: #C27867;
}

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

.project-card {
    background: rgba(38, 35, 34, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #D4CDCD;
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid rgba(194, 120, 103, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(194, 120, 103, 0.15);
}

.project-card img {
    width: 100%;
    border-radius: 8px;
    transition: transform 0.4s ease;
    cursor: pointer;
}

.project-card h3 {
    margin: 1rem 0;
    color: #C27867;
}

.project-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: #C27867;
    text-decoration: none;
    font-weight: bold;
}

.project-link:hover {
    text-decoration: underline;
}

/* Contact Section */
#contact {
    padding: 5rem 2rem;
    background: #201E1D;
    text-align: center;
}

#contact h2 {
    font-family: 'Great Vibes', cursive;
    font-size: 2.5rem;
    color: #C27867;
}

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

#contact-form input,
#contact-form textarea {
    padding: 0.8rem;
    background: #181716;
    border: 1px solid #363331;
    color: #D4CDCD;
    border-radius: 5px;
    font-family: sans-serif;
    font-size: 1rem;
}

#contact-form input:focus,
#contact-form textarea:focus {
    outline: none;
    border-color: #C27867;
}

#contact-form button {
    background: #C27867;
    color: #181716;
    padding: 0.8rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

#contact-form button:hover {
    background: #A86455;
    transform: translateY(-1px);
    color: #F5F2EC;
}

/* Perfectly Centered 2-Column Social Links Grid */
.social-links {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, 180px));
    justify-content: center;
    gap: 1rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.social-btn {
    background: #181716;
    color: #C27867;
    border: 1px solid rgba(194, 120, 103, 0.3);
    padding: 0.6rem 1.2rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    transition: background-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.social-btn:hover {
    background: #C27867;
    color: #181716;
    transform: translateY(-2px);
}

.social-links .social-btn:nth-child(5) {
    grid-column: span 2;
    max-width: 220px;
    margin: 0 auto;
}

/* Footer */
footer {
    background: #181716;
    color: #B5ABAB;
    text-align: center;
    padding: 1rem;
    border-top: 1px solid rgba(194, 120, 103, 0.15);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        background: #201E1D;
        width: 100%;
        padding: 1rem;
        border-bottom: 1px solid rgba(194, 120, 103, 0.2);
    }

    .nav-links.active {
        display: flex;
        align-items: center;
    }

    .hamburger {
        display: block;
    }

    .about-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .about-content p {
        text-align: center;
    }

    .hero h1 {
        font-size: 2.5rem;
    }
}

/* Preloader Styles */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #181716;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-content {
    text-align: center;
}

.loader-logo {
    font-family: 'Great Vibes', cursive;
    font-size: 3rem;
    color: #C27867;
    margin-bottom: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #2B2826;
    border-top: 4px solid #C27867;
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.preload-finished {
    opacity: 0;
    visibility: hidden;
}

/* Skills Section Styles */
#skills {
    padding: 5rem 2rem;
    background: #181716;
    text-align: center;
}

#skills h2 {
    font-family: 'Great Vibes', cursive;
    font-size: 2.5rem;
    color: #C27867;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-button-secondary {
    background: #201E1D;
    color: #F5F2EC;
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    border: 1px solid #C27867;
    display: inline-block;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.cta-button-secondary:hover {
    background: #C27867;
    color: #181716;
    transform: translateY(-2px);
}

.notification-toast {
    visibility: hidden;
    opacity: 0;
    max-width: 400px;
    margin: 1.5rem auto 0 auto;
    background: #262322;
    color: #D4CDCD;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border: 1px solid #C27867;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    text-align: center;
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s ease;
    transform: translateY(15px);
}

.notification-toast.show {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.freelance-badge {
    display: inline-block;
    background: rgba(194, 120, 103, 0.1);
    color: #D4CDCD;
    border: 1px solid rgba(194, 120, 103, 0.3);
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    font-size: 0.9rem;
    font-family: 'Cinzel', serif;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.tag {
    background: #181716;
    color: #C27867;
    border: 1px solid rgba(194, 120, 103, 0.25);
    padding: 0.25rem 0.65rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    font-family: 'Cinzel', serif;
    letter-spacing: 0.5px;
}

.mobile-hire-item {
    display: none;
}

.mobile-hire-btn {
    background: #C27867;
    color: #181716 !important;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-align: center;
    display: inline-block;
    font-weight: bold;
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    .mobile-hire-item {
        display: block;
        text-align: center;
        width: 100%;
    }
}

/* --- Fullscreen Image Modal Viewer Styles --- */
.modal-viewer {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(24, 23, 22, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
}

.modal-content {
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    border: 2px solid rgba(194, 120, 103, 0.4);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    animation: zoomIn 0.3s ease;
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #D4CDCD;
    font-size: 45px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
    z-index: 2010;
}

.modal-close-btn:hover {
    color: #C27867;
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.scroll-fade {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-fade.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Force Dark Mode Override Class --- */
body.dark-override {
    background: #181716 !important;
    color: #D4CDCD !important;
}

body.dark-override nav,
body.dark-override #about,
body.dark-override #contact,
body.dark-override #preloader {
    background: #201E1D !important;
    color: #D4CDCD !important;
}

body.dark-override #projects,
body.dark-override #skills,
body.dark-override footer {
    background: #181716 !important;
    color: #D4CDCD !important;
}

body.dark-override #home {
    background: linear-gradient(135deg, #181716, #262322) !important;
    color: #D4CDCD !important;
}

body.dark-override .hero p, 
body.dark-override .about-content p, 
body.dark-override .project-card p, 
body.dark-override footer p {
    color: #B5ABAB !important;
}

body.dark-override .project-card {
    background: rgba(38, 35, 34, 0.75) !important;
    border: 1px solid rgba(194, 120, 103, 0.25) !important;
    color: #D4CDCD !important;
}

body.dark-override #contact-form input,
body.dark-override #contact-form textarea {
    background: #181716 !important;
    border: 1px solid #363331 !important;
    color: #D4CDCD !important;
}

body.dark-override .tag,
body.dark-override .social-btn {
    background: #181716 !important;
    color: #C27867 !important;
    border: 1px solid rgba(194, 120, 103, 0.3) !important;
}

body.dark-override .hamburger {
    color: #C27867 !important;
}

/* --- Guaranteed Automatic Light Mode with Manual Override Support --- */
@media (prefers-color-scheme: light) {
    :root {
        color-scheme: light;
    }

    body:not(.dark-override) {
        background: #F4F1EA !important;
        color: #2C2825 !important;
    }

    body:not(.dark-override) nav {
        background: #EAE5DC !important;
        border-bottom: 1px solid rgba(194, 120, 103, 0.15) !important;
    }

    body:not(.dark-override) .nav-links a {
        color: #2C2825 !important;
    }

    body:not(.dark-override) .nav-links a:hover {
        color: #C27867 !important;
    }

    body:not(.dark-override) #home {
        background: linear-gradient(135deg, #F4F1EA, #E2DDD5) !important;
        color: #2C2825 !important;
    }

    body:not(.dark-override) .hero p, 
    body:not(.dark-override) .about-content p, 
    body:not(.dark-override) .project-card p, 
    body:not(.dark-override) footer p {
        color: #4A4540 !important;
    }

    body:not(.dark-override) #about,
    body:not(.dark-override) #contact,
    body:not(.dark-override) #preloader,
    body:not(.dark-override) #projects,
    body:not(.dark-override) #skills,
    body:not(.dark-override) footer {
        background: #F4F1EA !important;
        color: #2C2825 !important;
    }

    body:not(.dark-override) .project-card {
        background: rgba(255, 255, 255, 0.85) !important;
        border: 1px solid rgba(194, 120, 103, 0.3) !important;
        color: #2C2825 !important;
    }

    body:not(.dark-override) #contact-form input,
    body:not(.dark-override) #contact-form textarea {
        background: #FFFFFF !important;
        border: 1px solid #D5CEC1 !important;
        color: #2C2825 !important;
    }

    body:not(.dark-override) .tag,
    body:not(.dark-override) .social-btn {
        background: #FFFFFF !important;
        color: #A86455 !important;
        border: 1px solid rgba(194, 120, 103, 0.4) !important;
    }

    body:not(.dark-override) .freelance-badge {
        background: rgba(194, 120, 103, 0.15) !important;
        color: #4A4540 !important;
        border: 1px solid rgba(194, 120, 103, 0.4) !important;
    }

    body:not(.dark-override) .hamburger {
        color: #2C2825 !important;
    }

    body:not(.dark-override) .nav-links.active {
        background: #EAE5DC !important;
        border-bottom: 1px solid rgba(194, 120, 103, 0.3) !important;
    }
}
