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

:root {
    --bg-body: #f4f7f9;
    --text-main: #333;
    --text-light: #64748b;
    --bg-section: #ffffff;
    --bg-section-light: #f1f5f9;
    --bg-nav: #ffffff;
    --bg-card: #ffffff;
    --bg-footer: #1e293b;
    --input-bg: #f8fafc;
    --border-color: #cbd5e1;
    --heading-color: #1e293b;
}

body.dark-mode {
    --bg-body: #0f172a;
    --text-main: #e2e8f0;
    --text-light: #94a3b8;
    --bg-section: #1e293b;
    --bg-section-light: #0f172a;
    --bg-nav: #1e293b;
    --bg-card: #334155;
    --bg-footer: #020617;
    --input-bg: #1e293b;
    --border-color: #475569;
    --heading-color: #f1f5f9;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    font-family: 'Poppins', sans-serif;
    scroll-behavior: smooth;
    transition: background-color 0.3s, color 0.3s;
}

.section {
    padding: 80px 10%;
    background: var(--bg-section);
    position: relative; /* Ensures content is above the particle background */
    transition: background-color 0.3s;
}

/* Navigation */
nav {
    background: var(--bg-nav);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    transition: background-color 0.3s;
}

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

.logo a {
    text-decoration: none;
    color: #2563eb;
}

.nav-links {
    display: flex;
    gap: 30px;
    margin-left: auto;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

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

/* Theme Toggle Button */
.theme-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-main);
    margin-left: 20px;
    transition: color 0.3s;
}
.theme-btn:hover {
    color: #2563eb;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 100px 10%;
    position: relative; /* Ensures content is above the particle background */
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 10px;
}

.hero .highlight {
    color: #38bdf8;
}

.hero .subtitle {
    font-size: 1.5rem;
    color: #94a3b8;
    max-width: 700px;
    margin: 0 auto 30px;
}

.hero #typed-element {
    color: #e2e8f0;
}

.btn-hero {
    background: #38bdf8;
    color: #0f172a;
}

/* General Components */
.section-title {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.5rem;
    color: var(--heading-color);
}

.section-light {
    background: var(--bg-section-light);
}

.section-cta {
    text-align: center;
    margin-top: 50px;
}

/* Grid Container */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

/* App Card */
.app-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.app-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.app-card-logo {
    width: 80px;
    height: 80px;
    border-radius: 15px;
    margin-bottom: 15px;
}

.app-card h3 {
    margin-bottom: 10px;
}

.app-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 30px;
    flex-grow: 1;
}

.app-card-link {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

.app-card--placeholder {
    border: 2px dashed #cbd5e1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 250px;
}

.app-card--placeholder h3 {
    color: #94a3b8;
}

.app-card--placeholder p {
    color: #cbd5e1;
}

.app-card--placeholder:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

/* Buttons */
.btn-download {
    background: #2563eb;
    color: white;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: 0.3s;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-download:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

/* App Ads Link Section */
.ads-verification {
    margin-top: 20px;
    font-size: 0.9rem;
}

.ads-link {
    color: #2563eb;
    text-decoration: none;
}

/* About Me Section */
.about-me-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 50px;
    max-width: 900px;
    margin: 0 auto;
}

.about-me-img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.about-me-content {
    max-width: 500px;
}

.about-me-content h3 {
    font-size: 1.8rem;
    color: var(--heading-color);
    margin-bottom: 15px;
}

.about-me-content p {
    color: var(--text-light);
    margin-bottom: 15px;
}

/* Footer */
footer {
    text-align: center;
    padding: 60px 10% 20px;
    position: relative; /* Ensures content is above the particle background */
    background: var(--bg-footer);
    color: white;
}

.footer-content {
    margin-bottom: 30px;
}

.footer-content h2 {
    color: #fff;
    margin-bottom: 15px;
}

.footer-content p {
    color: #cbd5e1;
    max-width: 500px;
    margin: 0 auto;
}

footer hr {
    border: 0;
    border-top: 1px solid #334155;
    margin-bottom: 20px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-links a {
    color: #cbd5e1;
    text-decoration: none;
}

.copyright {
    font-size: 0.9rem;
    color: #94a3b8;
}

/* --- Social Media Links --- */
.social-links {
    margin-bottom: 30px;
}

.social-links a {
    color: white;
    font-size: 1.5rem;
    margin: 0 15px;
    text-decoration: none;
    transition: color 0.3s, transform 0.3s;
    display: inline-block;
}

.social-links a:hover {
    color: #38bdf8;
    transform: scale(1.2);
}

/* --- Blog Post Page --- */
.blog-post-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-card);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.blog-post-container h1 {
    font-size: 2.8rem;
    color: var(--heading-color);
    margin-bottom: 20px;
    line-height: 1.3;
}

.blog-post-header {
    margin-top: 30px;
}

.blog-post-header img {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 30px;
}

.blog-post-content h3 {
    font-size: 1.5rem;
    color: var(--heading-color);
    margin-top: 30px;
    margin-bottom: 15px;
}

.blog-post-content p {
    color: var(--text-main);
    line-height: 1.8;
    margin-bottom: 20px;
}

.blog-post-content ul {
    list-style-position: inside;
    padding-left: 20px;
    margin-bottom: 20px;
}

.blog-post-content li {
    margin-bottom: 10px;
    color: var(--text-main);
}

/* --- Comments Section --- */
.comments-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #e2e8f0;
}

.comments-section h2 {
    font-size: 1.8rem;
    color: var(--heading-color);
    margin-bottom: 30px;
}

.comment-list {
    margin-bottom: 50px;
}

.comment {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.comment-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
}

.comment-header {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.comment-author {
    font-weight: 600;
    color: var(--heading-color);
}

.comment-date {
    font-size: 0.8rem;
    color: #94a3b8;
}

.comment-text {
    color: var(--text-main);
    line-height: 1.7;
    margin: 0;
}

.comment-form-container h3 {
    font-size: 1.5rem;
    color: var(--heading-color);
    margin-bottom: 20px;
}

/* --- Typed.js Cursor --- */
.typed-cursor {
    color: #38bdf8;
    font-size: 1.5rem;
    animation: none; /* Optional: to use Typed.js's own blinking */
}

.hero .typed-cursor {
    font-size: 1.5rem;
    color: #e2e8f0;
}

/* --- Blog Section --- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.blog-card {
    background: var(--bg-card);
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
}

.blog-card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-card-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-card-date {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 10px;
    display: block;
}

.blog-card-content h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
    color: var(--heading-color);
}

.blog-card-content p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.7;
    flex-grow: 1;
}

.blog-card-link {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

/* Ad Section */
.ad-section {
    text-align: center;
}
.ad-section h3 {
    color: #94a3b8;
    font-weight: 400;
    margin-bottom: 20px;
}
.ad-placeholder {
    width: 100%; max-width: 728px; height: 90px; background: #e2e8f0; margin: 0 auto; border: 1px dashed #cbd5e1; display: flex; align-items: center; justify-content: center; color: #94a3b8; border-radius: 10px;
}

/* --- Contact Form --- */
#contact-me {
    padding: 80px 10%;
}

.contact-form-container {
    max-width: 700px;
    margin: 0 auto;
    background: var(--bg-card);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.contact-form-container .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.contact-form-container input[type="text"],
.contact-form-container input[type="email"],
.contact-form-container textarea,
.comment-form-container input[type="text"],
.comment-form-container input[type="email"],
.comment-form-container textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.3s, box-shadow 0.3s;
    background-color: var(--input-bg);
    color: var(--text-main);
}

.contact-form-container input[type="text"]:focus,
.contact-form-container input[type="email"]:focus,
.contact-form-container textarea:focus,
.comment-form-container input[type="text"]:focus,
.comment-form-container input[type="email"]:focus,
.comment-form-container textarea:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.contact-form-container textarea,
.comment-form-container textarea {
    resize: vertical;
}

.contact-form-container .full-width-input,
.comment-form-container .full-width-input {
    margin-bottom: 20px;
}

.contact-form-container .submit-button-container,
.comment-form-container .submit-button-container {
    text-align: center;
}

.contact-form-container .btn-submit {
    border: none;
    cursor: pointer;
}

.comment-form-container .submit-button-container {
    text-align: right;
}

.comment-form-container .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.contact-form-container #form-result {
    margin-top: 20px;
    text-align: center;
    font-weight: 600;
}

/* --- AI Chat Widget --- */
#ai-chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: Arial, sans-serif;
}

#chat-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    font-size: 28px;
    width: 60px;
    height: 60px;
}

#chat-box {
    width: 300px;
    height: 400px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: absolute;
    bottom: 80px;
    right: 0;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transform-origin: bottom right;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

#chat-box.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
}

#chat-header {
    background: #007bff;
    color: white;
    padding: 10px;
    border-radius: 10px 10px 0 0;
}

#messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    font-size: 14px;
}

#user-input {
    width: 100%;
    border: none;
    border-top: 1px solid #ccc;
    padding: 10px;
    box-sizing: border-box;
    border-radius: 0 0 10px 10px;
}

/* --- Hamburger Menu --- */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 101;
}

.hamburger-bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: #334155;
    transition: all 0.3s ease-in-out;
}

/* Responsive */
@media (max-width: 768px) {
    .section, .hero, #contact-me {
        padding: 60px 5%;
    }

    .blog-post-container h1 {
        font-size: 2.2rem;
    }

    .hero h1 { font-size: 2.5rem; }
    .hero .subtitle, .hero #typed-element, .hero .typed-cursor { font-size: 1.2rem; }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        background: white;
        width: 100%;
        flex-direction: column;
        text-align: center;
        padding: 10px 0;
        box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    }
    .nav-links.active {
        display: flex;
    }
    .nav-links a {
        padding: 15px 0;
    }

    .hamburger {
        display: block;
    }

    .hamburger.active .hamburger-bar:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active .hamburger-bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger.active .hamburger-bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .contact-form-container .form-grid {
        grid-template-columns: 1fr;
    }

    .comment-form-container .form-grid {
        grid-template-columns: 1fr;
    }

    .social-links a {
        font-size: 1.3rem;
    }
    
    .theme-btn {
        margin-left: auto;
        margin-right: 15px;
    }
}

/* --- Animation & Effects --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero h1, .hero p, .hero .btn-download {
    opacity: 0; /* Start hidden */
    animation: fadeInUp 0.8s ease-out forwards;
}

.hero h1 { animation-delay: 0.2s; }
.hero p { animation-delay: 0.4s; }
.hero .btn-download { animation-delay: 0.6s; }

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

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

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid var(--text-light);
    border-top: 5px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loader-hidden {
    opacity: 0;
    visibility: hidden;
}

/* --- Index Contact Form Styles --- */
.contact-container {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-card);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-main);
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--input-bg);
    color: var(--text-main);
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group select option {
    background-color: var(--bg-card);
    color: var(--text-main);
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    border-color: #2563eb;
    outline: none;
}

.btn-submit {
    width: 100%;
    background-color: #2563eb;
    color: white;
    border: none;
    padding: 14px;
    font-size: 1.1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-submit:hover {
    background-color: #1d4ed8;
}

#msg-status {
    margin-top: 15px;
    text-align: center;
    font-weight: 600;
}

/* --- Particles.js Background --- */
#tsparticles {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
}

/* Ensure text sits above the particle overlay */
.hero > *, .section > *, footer > * {
    position: relative;
    z-index: 2;
}