/* --- Global Styles & Variables --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --primary-color: #007bff; /* Professional Blue - Change as desired */
    --secondary-color: #6c757d; /* Muted Grey */
    --background-color: #f8f9fa; /* Light Grey Background */
    --text-color: #343a40;       /* Dark Grey Text */
    --light-text-color: #ffffff;
    --card-bg: #ffffff;
    --border-color: #dee2e6;
    --hover-color: #0056b3; /* Darker blue on hover */

    /* Animation Timing */
    --transition-speed: 0.6s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth; /* Smooth scrolling for anchor links */
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-color);
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Prevent background scroll when modal is open */
body.modal-open {
    overflow: hidden;
}


.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 30px;
    overflow: hidden; /* Clears floats and contains margins */
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--hover-color);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block; /* Remove extra space below images */
}

h1, h2, h3, h4 {
    line-height: 1.3;
    margin-bottom: 1rem;
    font-weight: 600;
}

p {
    margin-bottom: 1rem;
}

/* --- Header & Navigation --- */
.main-header {
    background: var(--card-bg);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    transition: top 0.3s ease-in-out; /* Smooth hide/show */
}

/* Optional: Hide header on scroll down, show on scroll up */
/* body.scroll-down .main-header {
    top: -100px;
} */

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.main-header .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.main-nav ul {
    display: flex;
}

.main-nav ul li {
    margin-left: 20px;
}

.main-nav ul li a {
    color: var(--text-color);
    padding: 5px 10px;
    font-weight: 400;
    position: relative;
    transition: color 0.3s ease;
}

.main-nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.main-nav ul li a:hover::after,
.main-nav ul li a.active::after {
    width: 100%;
}

.main-nav ul li a:hover,
.main-nav ul li a.active {
    color: var(--primary-color);
}

/* --- Hero Section (Homepage) --- */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), url('images/hero-background.jpg') no-repeat center center/cover; /* Darker overlay for text contrast */
    color: var(--light-text-color);
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    position: relative;
    overflow: hidden; /* Contain animations */
}

.hero-content {
    max-width: 800px;
}
/* Staggered animation for hero content */
.hero-content > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.hero-content.visible > * {
    opacity: 1;
    transform: translateY(0);
}
.hero-content.visible h1 { transition-delay: 0.2s; }
.hero-content.visible p { transition-delay: 0.4s; }
.hero-content.visible .btn { transition-delay: 0.6s; }


.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--light-text-color);
    font-weight: 700;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.95); /* Slightly more opaque */
    font-weight: 300;
}

.btn {
    display: inline-block;
    background: var(--primary-color);
    color: var(--light-text-color);
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.btn:hover {
    background-color: var(--hover-color);
    color: var(--light-text-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-secondary {
    background: var(--secondary-color);
    margin-left: 10px; /* Space between buttons */
}
.btn-secondary:hover {
     background: #5a6268;
     color: var(--light-text-color);
}


/* --- General Section Styling --- */
.section {
    padding: 70px 0; /* Slightly more padding */
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px; /* Increased margin */
    position: relative;
    padding-bottom: 15px;
    font-weight: 700;
}

.section-title::after {
    content: '';
    position: absolute;
    width: 70px; /* Wider underline */
    height: 4px; /* Thicker underline */
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* --- Animation Base State & Visible State --- */
.initial-hidden {
    opacity: 0;
    transform: translateY(40px); /* Start slightly lower */
    transition: opacity var(--transition-speed) ease-out, transform var(--transition-speed) ease-out;
}

.initial-hidden.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- About Section (Homepage) --- */
.about-content {
    display: flex;
    align-items: center;
    gap: 50px; /* Increased gap */
}

.about-image {
    flex: 1;
    text-align: center;
}

.about-image img {
    max-width: 320px; /* Slightly larger */
    border-radius: 50%;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border: 5px solid var(--card-bg); /* Optional border */
    transition: transform 0.4s ease;
}
.about-image img:hover {
    transform: scale(1.05);
}

.about-text {
    flex: 1.5; /* Give text slightly more space */
}

/* --- Services Section --- */
#services-preview {
     background-color: #eef1f5; /* Slightly adjusted background */
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 35px; /* Increased gap */
    margin-top: 40px;
}

.service-item {
    background: var(--card-bg);
    padding: 35px 30px; /* Increased padding */
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid transparent; /* Prepare for hover border */
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.service-item:hover {
    transform: translateY(-8px); /* More lift */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color); /* Highlight border on hover */
}

.service-item i {
    font-size: 2.8rem; /* Larger icons */
    color: var(--primary-color);
    margin-bottom: 20px;
    display: block;
    transition: transform 0.3s ease;
}
.service-item:hover i {
    transform: scale(1.1); /* Scale icon on hover */
}
.service-item h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
}

/* --- Experience Section --- */
.experience-timeline {
    position: relative;
    max-width: 800px;
    margin: 50px auto 0 auto;
}

.experience-timeline::after {
    content: '';
    position: absolute;
    width: 4px; /* Thicker line */
    background-color: var(--primary-color);
    opacity: 0.3; /* Softer line color */
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
    z-index: 1;
    border-radius: 2px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
    margin-bottom: 40px; /* Increased space */
    z-index: 2;
}

/* The circle */
.timeline-item::after {
    content: '';
    position: absolute;
    width: 18px; /* Larger circle */
    height: 18px;
    right: -11px;
    background-color: var(--card-bg);
    border: 4px solid var(--primary-color);
    top: 15px;
    border-radius: 50%;
    z-index: 3;
    transition: transform 0.3s ease;
}
.timeline-item:hover::after {
    transform: scale(1.2); /* Scale circle on hover */
}

/* Left item */
.timeline-left { left: 0; }
.timeline-left::after { left: -11px; }

/* Right item */
.timeline-right { left: 50%; }
.timeline-right::after { left: -11px; } /* Same position calculation relative to the item */

/* Remove connector lines for minimalism */
.timeline-left::before, .timeline-right::before {
    content: none;
}

.timeline-content {
    padding: 25px 30px; /* More padding */
    background-color: var(--card-bg);
    position: relative;
    border-radius: 8px; /* Slightly more rounded */
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.07);
    border-left: 4px solid var(--primary-color); /* Accent border */
    transition: box-shadow 0.3s ease;
}
.timeline-item:hover .timeline-content {
     box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.timeline-content h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}
.timeline-content h4 {
    font-size: 1rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-weight: 400;
}
.timeline-content p, .timeline-content ul {
    font-size: 0.95rem;
    color: #555;
}
.timeline-content ul {
    padding-left: 20px;
    list-style: disc;
}
.timeline-content ul li {
    margin-bottom: 0.5rem;
}


/* --- Contact Section --- */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 50px; /* Increased gap */
    align-items: start;
}

.contact-info h3, .contact-form h3 {
    margin-bottom: 25px; /* Increased margin */
}

.contact-info p {
    margin-bottom: 20px; /* Increased margin */
    display: flex;
    align-items: center;
    font-size: 1.05rem; /* Slightly larger text */
}

.contact-info i {
    color: var(--primary-color);
    margin-right: 15px; /* Increased space */
    width: 22px;
    text-align: center;
    font-size: 1.2rem; /* Slightly larger icons */
}
.contact-info a:hover {
    text-decoration: underline;
}

.social-links-contact a i {
     transition: transform 0.3s ease;
}
.social-links-contact a:hover i {
     transform: scale(1.2);
     color: var(--hover-color);
}

.contact-form .form-group {
    margin-bottom: 25px; /* Increased margin */
}

.contact-form label {
    display: block;
    margin-bottom: 8px; /* Increased space */
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase; /* Uppercase labels */
    letter-spacing: 0.5px;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 15px; /* Increased padding */
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.contact-form textarea {
    resize: vertical;
    min-height: 150px; /* Taller textarea */
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

/* --- Footer --- */
.main-footer {
    background: var(--text-color);
    color: var(--light-text-color);
    text-align: center;
    padding: 40px 0; /* Increased padding */
    margin-top: 60px;
}

.social-links a {
    color: var(--light-text-color);
    margin: 0 12px; /* Increased margin */
    font-size: 1.6rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-3px); /* Lift icons on hover */
}

.main-footer p {
    margin-top: 20px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}
.main-footer p:last-child {
    margin-bottom: 0;
}


/* --- Responsiveness --- */

/* Tablet */
@media (max-width: 768px) {
    .main-header .container {
        flex-direction: column;
        align-items: center;
    }
    .main-nav ul {
        margin-top: 15px;
        justify-content: center; /* Center nav items */
        flex-wrap: wrap; /* Allow wrapping */
    }
    .main-nav ul li {
        margin: 5px 10px; /* Adjust spacing for wrap */
    }

    .hero h1 { font-size: 2.5rem; }
    .hero p { font-size: 1.1rem; } /* Adjusted size */

    .about-content {
        flex-direction: column;
        text-align: center;
    }
     .about-image {
        margin-bottom: 30px; /* Increased margin */
    }
    .about-text {
        flex: 1; /* Reset flex */
    }

    /* Timeline adjustments for Tablet */
    .experience-timeline::after { left: 31px; }
    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }
     .timeline-left::after, .timeline-right::after {
        left: 20px; /* Adjust circle position */
    }
    .timeline-right { left: 0%; } /* Stack */
    .timeline-content { padding: 20px 25px; } /* Adjust padding */

    .contact-grid {
       grid-template-columns: 1fr;
       gap: 40px;
    }
     .contact-info {
        margin-bottom: 30px;
        text-align: center; /* Center align info */
     }
     .contact-info p {
         justify-content: center; /* Center items within paragraph */
     }
     .social-links-contact {
         justify-content: center; /* Center social icons */
         display: flex;
     }
}

/* Mobile */
@media (max-width: 500px) {
    .container { padding: 0 20px; }

    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; } /* Adjusted size */
     .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .section { padding: 50px 0; }
    .section-title { font-size: 2rem; margin-bottom: 40px; }

    .about-image img { max-width: 250px; }

    .services-grid { gap: 25px; }
    .service-item { padding: 30px 20px; }

    /* Further timeline adjustments if needed */
     .experience-timeline::after { left: 20px; } /* Move line further left */
     .timeline-item { padding-left: 55px; padding-right: 15px; }
     .timeline-left::after, .timeline-right::after { left: 9px; width: 16px; height: 16px; border-width: 3px; } /* Adjust circle */

    .contact-info p, .contact-form label, .contact-form input, .contact-form textarea { font-size: 0.95rem; }
    .contact-form input, .contact-form textarea { padding: 12px; }

    .main-footer { padding: 30px 0; }
    .social-links a { font-size: 1.5rem; margin: 0 10px; }
    .main-footer p { font-size: 0.85rem; }

}

/* --- Journal/Blog Page Styles --- */

.journal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
    margin-top: 40px;
}

.journal-post-item {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.journal-post-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.journal-post-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.post-content {
    padding: 25px 30px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.post-title {
    font-size: 1.4rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.post-title a {
    color: var(--text-color);
    transition: color 0.3s ease;
}

.post-title a:hover {
    color: var(--primary-color);
}

.post-meta {
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.post-meta span i {
    margin-right: 5px;
}

.post-excerpt {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.7;
    margin-bottom: 20px;
    flex-grow: 1;
}

.read-more-btn {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-self: flex-start;
    transition: color 0.3s ease;
}

.read-more-btn i {
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.read-more-btn:hover {
    color: var(--hover-color);
}

.read-more-btn:hover i {
    transform: translateX(4px);
}

/* --- Campaigns Page Styles --- */ /* NEW SECTION */

.campaign-grid {
    display: grid;
    /* Use similar grid setup as services or journal */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 40px;
}

.campaign-card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer; /* Indicate it's clickable */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.campaign-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.campaign-card img.campaign-preview-img {
    width: 100%;
    height: 200px; /* Consistent image height */
    object-fit: cover;
    display: block;
}

.campaign-card .campaign-content {
    padding: 25px 30px;
    flex-grow: 1;
}

.campaign-card .campaign-title {
    font-size: 1.3rem; /* Slightly smaller than journal post */
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-color);
}

.campaign-card .campaign-excerpt {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
}

/* --- Modal Styles --- */ /* NEW SECTION */

.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1050; /* Sit on top - higher than header */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Enable scroll if needed within modal */
    background-color: rgba(0, 0, 0, 0.6); /* Black w/ opacity */
    /* Add fade-in animation */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.modal.show {
    display: block;
    opacity: 1;
}

.modal-content {
    background-color: var(--card-bg);
    margin: 5% auto; /* 5% from top, centered */
    padding: 30px 40px; /* More padding */
    border: 1px solid var(--border-color);
    width: 85%;
    max-width: 800px; /* Max width */
    border-radius: 8px;
    position: relative;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    /* Add slide-down animation */
    transform: translateY(-30px);
    transition: transform 0.3s ease-in-out;
}

.modal.show .modal-content {
    transform: translateY(0);
}


.modal-close-button {
    color: #aaa;
    position: absolute;
    top: 15px; /* Adjust position */
    right: 25px; /* Adjust position */
    font-size: 2rem; /* Larger close icon */
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close-button:hover,
.modal-close-button:focus {
    color: var(--text-color);
    text-decoration: none;
}

.modal-content h2 {
    font-size: 2rem; /* Modal title size */
    margin-bottom: 25px;
    color: var(--primary-color);
}

.modal-content p {
    margin-bottom: 20px;
    font-size: 1rem;
    line-height: 1.7;
}

.modal-screenshots {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two columns for screenshots */
    gap: 30px;
    margin-top: 30px;
}

.modal-screenshots div h4 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: 600;
    color: var(--text-color);
}

.modal-screenshots img {
    width: 100%;
    height: auto;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* --- Adjustments for Responsiveness --- */
@media (max-width: 768px) {
    /* ... existing tablet styles ... */

    .journal-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* NEW: Campaign Grid on Tablet */
    .campaign-grid {
        grid-template-columns: 1fr; /* Stack cards */
        gap: 30px;
    }

    /* NEW: Modal on Tablet */
    .modal-content {
        width: 90%;
        padding: 25px 30px;
        margin: 10% auto; /* Adjust margin */
    }
    .modal-screenshots {
        grid-template-columns: 1fr; /* Stack screenshots */
        gap: 25px;
    }
    .modal-content h2 { font-size: 1.8rem; }

}

@media (max-width: 500px) {
    /* ... existing mobile styles ... */

    .post-title { font-size: 1.25rem; }
    .post-content { padding: 20px 25px; }
    .post-excerpt { font-size: 0.9rem; }

    /* NEW: Campaign Card on Mobile */
    .campaign-card .campaign-title { font-size: 1.2rem; }
    .campaign-card .campaign-content { padding: 20px 25px; }
    .campaign-card .campaign-excerpt { font-size: 0.9rem; }

    /* NEW: Modal on Mobile */
    .modal-content {
        width: 95%;
        padding: 20px;
        margin: 15% auto; /* Adjust margin */
    }
     .modal-close-button {
        top: 10px;
        right: 15px;
        font-size: 1.8rem;
    }
    .modal-content h2 { font-size: 1.6rem; margin-bottom: 20px;}
    .modal-content p { font-size: 0.95rem; }
    .modal-screenshots div h4 { font-size: 1rem; margin-bottom: 10px; }
}
