/* CSS Variables for easy theming */
:root {
    --primary-color: #3b82f6;
    --bg-color: #000000;
    --card-bg: #111111;
    --text-color: #ffffff;
    --text-secondary: #a3a3a3;
    --transition: all 0.3s ease;
    /* New Glassmorphism variables */
    --glass-bg: rgba(20, 20, 20, 0.3);
    --glass-blur: blur(15px);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

[data-theme="light"] {
    --primary-color: #2563eb;
    --bg-color: #ffffff;
    --card-bg: #f3f4f6;
    --text-color: #1f2937;
    --text-secondary: #4b5563;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: 1px solid rgba(0, 0, 0, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

[data-theme="light"] #particles-canvas {
    display: none;
}

#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color); /* Changed for glassmorphism */
    color: var(--text-color);
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }



/* Glassmorphism styles for components */
.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
}

/* Navigation */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: var(--glass-border);
    transition: var(--transition);
}

.navbar.scrolled {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    padding: 1rem 2rem;
    box-shadow: var(--glass-shadow);
}

.logo { font-size: 1.5rem; font-weight: bold; color: var(--primary-color); }

.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a:hover { color: var(--primary-color); transition: var(--transition); }

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle:hover {
    color: var(--primary-color);
    transform: rotate(15deg);
}

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

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 1rem;
    overflow: hidden;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    z-index: 2;
    gap: 2rem;
    text-align: left;
}

#hero-3d-container {
    flex: 1;
    height: 500px;
    min-width: 300px;
    position: relative;
}

.hero-content {
    max-width: 800px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.highlight { color: var(--primary-color); }
.hero p { font-size: 1.2rem; color: var(--text-secondary); margin-bottom: 2rem; }

.hero .btn {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(243, 9, 9, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: var(--primary-color);
    color: white;
    border-radius: 5px;
    font-weight: bold;
    transition: var(--transition);
    border: none;
}
.btn:hover { transform: translateY(-3px); opacity: 0.9; }

.btn-outline {
    display: inline-block;
    border: 1px solid var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    color: var(--primary-color);
    transition: var(--transition);
}

.btn-outline:hover { background: rgba(59, 130, 246, 0.1); }

/* General Layout */
.container {
    padding: 5rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

/* Skills */
.about-content p { margin-bottom: 1.5rem; }
.skills-container {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.skill-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: var(--transition);
}

.skill-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.05);
}

.skill-card i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.skill-card span {
    font-weight: 600;
    font-size: 1rem;
}

/* Certifications */
.certifications-section { margin-top: 3rem; }
.certifications-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Timeline */
.timeline-section { margin-top: 3rem; }
.section-subtitle { font-size: 1.5rem; margin-bottom: 1.5rem; }

.timeline {
    border-left: 2px solid var(--primary-color);
    padding-left: 2rem;
    margin-left: 0.5rem;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s ease-out;
}

.timeline-item.slide-in {
    opacity: 1;
    transform: translateX(0);
}

.timeline-item:last-child { margin-bottom: 0; }

.timeline-dot {
    position: absolute;
    left: -2.6rem; /* Aligns dot with the border line */
    top: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-color);
    border: 2px solid var(--primary-color);
}

.timeline-date {
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.timeline-content h3 { font-size: 1.1rem; margin-bottom: 0.2rem; }
.timeline-content p { color: var(--text-secondary); font-size: 0.9rem; }

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

.service-card {
    background-color: transparent;
    perspective: 1000px;
    height: 300px;
}

.service-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.service-card:hover .service-card-inner {
    transform: rotateY(180deg);
}

.service-card-front, .service-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 10px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.service-card-front {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.service-card-back {
    background: var(--primary-color);
    color: white;
    transform: rotateY(180deg);
}

.service-card-back p {
    color: #f1f5f9;
}

.service-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--text-color);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    font-size: 0.9rem;
}

.filter-btn.active, .filter-btn:hover {
    background: var(--primary-color);
    color: white;
}

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

.card {
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.6s ease;
    opacity: 0;
    transform: translateY(50px);
}

.card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.card.show {
    opacity: 1;
    transform: translateY(0);
}

.card:nth-child(2) { transition-delay: 0.2s; }
.card:nth-child(3) { transition-delay: 0.4s; }

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

.card-image {
    height: 200px;
    background-color: rgba(34, 34, 34, 0.5); /* Placeholder color */
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-info { padding: 1.5rem; }
.card-info h3 { margin-bottom: 0.5rem; }
.card-info p { color: var(--text-secondary); margin-bottom: 1rem; font-size: 0.9rem; }
.link { color: var(--primary-color); font-weight: bold; }

/* Reset button styles for link look */
button.link {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    padding: 0;
}

.post-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.5rem;
}

/* Contact & Footer */
.contact-section {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 100px;
    margin: 0 auto 4rem;
}
.contact-section .sub-title {
    color: var(--primary-color);
    font-family: monospace;
    font-size: 1rem;
    margin-bottom: 1rem;
}
.contact-section .title {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    border-bottom: none;
    display: block;
}
.contact-section .description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}
.socials { margin-top: 2rem; font-size: 1.5rem; display: flex; gap: 1.5rem; justify-content: center; }

/* Contact Form */
.contact-form {
    width: 100%;
    text-align: left;
    margin-bottom: 2rem;
    
}

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

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    border-radius: 5px;
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
}

.contact-form button {
    width: 100%;
    cursor: pointer;
    font-size: 1rem;
}

footer { text-align: center; padding: 2rem; color: var(--text-secondary); font-size: 0.9rem; background: rgba(0,0,0,0.5);}
footer {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-top: var(--glass-border);
    padding-top: -10rem;
}

footer .socials { margin-top: 0; margin-bottom: 1.5rem; }
footer .socials {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    
}

footer .socials a {
    color: var(--text-color);
    font-size: 1.5rem;
    transition: var(--transition);
}

footer .socials a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* Mobile Responsiveness for Hero 3D */
@media (max-width: 768px) {
    .hero-container {
        flex-direction: column-reverse;
        text-align: center;
        padding-top: 80px;
    }
    .hero-content {
        text-align: center;
    }
    #hero-3d-container {
        height: 300px;
        width: 100%;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .nav-links {
        display: none; /* Hidden by default on mobile */
        position: absolute;
        top: 70px;
        right: 0;
        width: 100%;
        flex-direction: column;
        text-align: center;
        padding: 2rem;
        background: var(--glass-bg);
        backdrop-filter: var(--glass-blur);
        -webkit-backdrop-filter: var(--glass-blur);
        border: var(--glass-border);
        border-top: none;
    }
    
    .nav-links.active { display: flex; }
    .hamburger { display: block; }
    .contact-section .title { font-size: 2.5rem; }

    /* Stack grids on mobile */
    .project-grid, .services-grid {
        grid-template-columns: 1fr;
    }

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

    .terminal-window {
        min-width: auto;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.8rem; }
    h2 { font-size: 2rem; }
    .btn { width: 100%; text-align: center; }
}

/* Typing Animation Cursor */
.typing-cursor::after {
    content: '|';
    margin-left: 5px;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5); /* Dark overlay */
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal.active { display: flex; }

.modal-content {
    padding: 2.5rem;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: slideUp 0.3s ease;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
}

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

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
}

.close-modal:hover { color: var(--primary-color); }
.modal-title { font-size: 1.8rem; margin-bottom: 1rem; color: var(--primary-color); }
.modal-desc { color: var(--text-color); line-height: 1.6; margin-bottom: 2rem; }

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Terminal Window */
.about-content {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: center;
    justify-content: center;
}

.terminal-window {
    flex: 1;
    min-width: 280px;
    border-radius: 8px;
    font-family: 'Fira Code', 'Courier New', monospace;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    position: relative;
    z-index: 1;
}

.terminal-header {
    background: rgba(51, 51, 51, 0.5);
    padding: 0.5rem;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: var(--glass-border);
    cursor: grab;
}

.terminal-button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.terminal-button.red { background: #ff5f56; }
.terminal-button.yellow { background: #ffbd2e; }
.terminal-button.green { background: #27c93f; }

.terminal-body {
    padding: 1.5rem;
    font-size: 0.9rem;
    height: 250px;
    overflow-y: auto;
}

.terminal-line {
    margin-bottom: 0.5rem;
}

.prompt {
    color: #4f85e6;
    font-weight: bold;
}

.cmd {
    color: #e0e0e0;
}

.output {
    color: var(--text-secondary);
    padding-left: 1rem;
}

.cursor {
    display: inline-block;
    width: 8px;
    height: 1.2em;
    background: #e0e0e0;
    margin-left: 4px;
    animation: blink 1s step-end infinite;
}

.about-text {
    flex: 0 0 100%;
    text-align: left;
    margin-top: 1rem;
}

.about-image {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 0;
}

.about-image img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    box-shadow: var(--glass-shadow);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary-color);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--glass-bg);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-3px);
}
