/* Color Palette and Variables */
:root {
    --primary-color: #e9652a; /* Orange/Accent */
    --secondary-color: #2a1b3c; /* Dark Purple/Text */
    --background-start: #f0f2f5;
    --background-end: #ffffff;
    --card-shadow: rgba(0,0,0,0.1);
    --hover-shadow: rgba(233, 101, 42, 0.2);
    --mobile-padding: 15px;
    --desktop-padding: 30px;
    --section-gap: 80px;
}

/* Base and Page Animation */
@keyframes background-pan {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

.animated-background {
    background: linear-gradient(135deg, var(--background-start), var(--background-end), var(--background-start));
    background-size: 400% 400%;
    animation: background-pan 12s ease infinite alternate;
    min-height: 100vh;
}

/* --- SECTION NAVIGATION BAR --- */
.section-nav-wrapper {
    position: sticky;
    top: 0;
    z-index: 999;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    padding: 0 var(--mobile-padding);
}
.section-nav-wrapper.open {
    display: none;
}

.section-nav-container {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: scroll; /* Enables sliding */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    flex-grow: 1;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
    padding: 10px 0;
}

.section-nav-container::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome, Safari */
}

.nav-item {
    text-decoration: none;
    color: var(--secondary-color);
    padding: 10px 15px;
    margin: 0 5px;
    white-space: nowrap;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 6px;
    border-bottom: 3px solid transparent;
}

.nav-item:hover {
    color: var(--primary-color);
    background-color: rgba(233, 101, 42, 0.05);
}

.nav-item.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}

.nav-scroll-btn {
    background: #ffffff;
    color: var(--secondary-color);
    padding: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.nav-scroll-btn:hover {
    color: var(--primary-color);
}

/* --- GENERAL SECTION STYLING --- */
.solution-section {
    padding: var(--section-gap) var(--desktop-padding);
}

.section-divider {
    border: none;
    height: 1px;
    background-color: rgba(42, 27, 60, 0.1);
    width: 80%;
    margin: 0 auto;
}

.ts-container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-heading {
    color: var(--secondary-color);
    font-size: 2rem; /* Reduced font size */
    text-align: center;
    margin-bottom: 15px;
    position: relative;
    padding-bottom: 10px;
}

.section-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px; /* Reduced width */
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

.section-description {
    text-align: justify; /* Justified text */
    max-width: 900px;
    margin: 0 auto 50px;
    color: #666;
    font-size: 1rem; /* Reduced font size */
    line-height: 1.6;
}

/* --- GRID AND CARD LAYOUT --- */
.ts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Slightly smaller cards */
    gap: 25px;
}

.ts-card {
    background: #ffffff;
    border-radius: 12px; /* Slightly smaller radius */
    overflow: hidden;
    box-shadow: 0 4px 15px var(--card-shadow);
    transition: box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* Card Hover Shadow (No float/translate) */
.ts-card:hover {
    box-shadow: 0 8px 30px var(--hover-shadow);
}

/* --- Image & Hover Zoom --- */
.ts-image-wrapper {
    width: 100%;
    height: 180px; /* Reduced image height */
    overflow: hidden;
    position: relative;
}

.ts-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.ts-card:hover .ts-card-image {
    transform: scale(1.05); /* Reduced zoom effect */
}

/* Modal Trigger Icon */
.modal-trigger {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ffffff;
    color: var(--primary-color);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.modal-trigger:hover {
    opacity: 1;
}

/* --- Card Content --- */
.ts-content {
    padding: 15px;
    text-align: center;
}

.ts-content h3 {
    color: var(--secondary-color);
    font-size: 1.2rem; /* Reduced font size */
    line-height: 1.3;
    margin: 0;
}


/* --- Modal Styles (Unchanged for Functionality, just cleanup) --- */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(42, 27, 60, 0.8);
    padding-top: 50px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.modal.open {
    display: block;
    opacity: 1;
}

.modal-content {
    background-color: #ffffff;
    margin: 5% auto; 
    padding: 30px; /* Reduced padding */
    border-radius: 10px;
    width: 90%; 
    max-width: 750px; /* Reduced max width */
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    position: relative;
    transform: translateY(-50px);
    transition: transform 0.4s ease-out;
}

.modal.open .modal-content {
    transform: translateY(0);
}

.close-button {
    color: #aaa;
    position: absolute;
    top: -2rem;
    right: -2rem;
    font-size: 1.8rem;
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover {
    color: var(--primary-color);
}

.modal-body #modalImage {
    width: 100%;
    max-height: 300px; /* Reduced max height */
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
}

.modal-body #modalTitle {
    color: var(--secondary-color);
    font-size: 1.5rem; /* Reduced font size */
    margin-bottom: 15px;
    border-left: 4px solid var(--primary-color);
    padding-left: 10px;
    line-height: 1.2;
}

.modal-body #modalDescription {
    color: #444;
    font-size: 0.95rem; /* Reduced font size for large text */
    line-height: 1.7;
    text-align: justify;
}


/* --- Responsive Design --- */
@media (max-width: 768px) {
    .solution-section {
        padding: 60px var(--mobile-padding); /* Adjusted padding */
    }

    .section-nav-wrapper {
        padding: 0 5px;
    }
    
    .section-heading {
        font-size: 1.2rem; /* Mobile font size */
        margin-bottom: 10px;
    }
    
    .section-description {
        margin-bottom: 30px;
        font-size: 0.85rem; /* Mobile font size */
    }
    
    .ts-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* 2 columns on small mobile */
        gap: 15px;
    }

    .ts-image-wrapper {
        height: 120px; /* Small mobile image height */
    }
    
    .ts-content h3 {
        font-size: 0.9rem;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 15px;
    }
    .close-button {
        top: -1rem;
        right: -1rem;
        font-size: 1.4rem;
    }
    
    .modal-body #modalTitle {
        font-size: 1.2rem;
    }
    
    .modal-body #modalDescription {
        font-size: 0.85rem;
    }

    .nav-scroll-btn {
        padding: 8px;
        font-size: 1rem;
    }
    
    .section-nav-container {
        padding: 8px 0;
    }

    .nav-item {
        font-size: 0.85rem;
        padding: 8px 10px;
    }
}
