@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #075797; /* Deep Blue */
    --background-color: #f0f2f5;
    --text-dark: #333;
    --text-light: #fff;
    --card-width-mobile: 90vw;
    --card-width-desktop: 380px;
    --card-spacing: 20px;
    --card-padding-horizontal: 25px;
    --card-padding-vertical: 25px;
    --image-margin: 15px;
}

/* Base style for the slider container */
.content-wrapper {
    max-width: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Optional: Center the entire block if used in a narrow column */
    margin: 20px auto; 
    font-family: 'Poppins', sans-serif;
}

/* --- Slider Container (The scrollable viewport) --- */
.slider-container {
    max-width: 100%; 
    width: 100%;
    /* KEY: Enables horizontal scrolling and touch swiping */
    overflow-x: scroll;
    padding-bottom: 20px; 
    -webkit-overflow-scrolling: touch;
    
    /* HIDE SCROLLBARS */
    -ms-overflow-style: none;  
    scrollbar-width: none;  
}
.slider-container::-webkit-scrollbar { display: none; }

/* --- Card Slider (The flex track) --- */
.card-slider {
    display: flex;
    gap: var(--card-spacing);
    /* CRITICAL: Padding ensures the first card aligns correctly */
    padding-left: var(--card-spacing); 
    /* CSS SCROLL SNAP: Makes cards "lock" when you stop dragging/swiping */
    scroll-snap-type: x mandatory; 
}

/* --- Individual Card Styling (Mobile Default) --- */
.card {
    background-color: var(--text-light);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
    padding: var(--card-padding-vertical) var(--card-padding-horizontal);
    box-sizing: border-box;
    /* Calculate width to show approximately one card at a time */
    width: calc(var(--card-width-mobile) - var(--card-spacing));
    scroll-snap-align: start; 
}

/* --- Content Styles --- */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.project-logo {
    height: 35px !important;
    width: auto;
    object-fit: contain;
    margin: 0;
}

.project-category {
    background-color: #e3eff7;
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 500;
    white-space: nowrap;
}

.project-duration {
    font-size: 0.9em;
    color: #777;
    margin-bottom: 15px;
}

.project-description {
    font-size: 15px !important;
    color: var(--text-dark);
    line-height: 1.4;
    margin-bottom: 25px; 
}

.card-image-wrapper {
    position: relative;
    /* Adjusts the wrapper width based on the image margin */
    width: calc(100% - 2 * var(--image-margin)); 
    margin: 0 auto 10px auto; 
    margin-top: 10px;
    border-radius: 10px;
    overflow: hidden; 
}

.card-image {
    width: 100%;
    height: 220px;
    object-fit: cover; 
    display: block;
    border-radius: 10px; 
}

/* --- Tech Stack (Horizontal Scroll) --- */
.tech-stack-container {
    display: flex;
    gap: 8px;
    margin-top: 15px; 
    align-items: center;
    overflow-x: auto; 
    padding-bottom: 5px;
    -webkit-overflow-scrolling: touch;
}

.tech-stack-container::-webkit-scrollbar { height: 3px; }
.tech-stack-container::-webkit-scrollbar-thumb { background: #ccc; border-radius: 5px; }

.tech-tag {
    background-color: #e3eff7; 
    color: var(--primary-color); 
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 500;
    flex-shrink: 0;
    white-space: nowrap;
}

/* --- Slider Navigation (Dots) --- */
.slider-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    gap: 10px;
    z-index: 10; 
    width: 100%; 
}

.nav-dot {
    width: 10px;
    height: 10px;
    background-color: #ccc;
    border-radius: 50%;
    cursor: pointer; 
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.nav-dot.active {
    background-color: var(--primary-color);
    transform: scale(1.1);
}


/* =========================================
   RESPONSIVENESS (Tablet/Desktop) 
   ========================================= */

@media (min-width: 768px) {
    
    /* Adjust wrapper to accommodate the three-column grid layout */
    .content-wrapper {
        max-width: calc(3 * var(--card-width-desktop) + 2 * var(--card-spacing)); 
    }
    
    /* Disable mobile features on Desktop */
    .slider-container {
        overflow-x: hidden;
        padding-bottom: 0;
    }

    /* Use CSS Grid for the desktop layout */
    .card-slider {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(var(--card-width-desktop), 1fr));
        gap: var(--card-spacing);
        padding: 0; /* Remove padding needed for mobile scroll */
        margin: 0 auto;
        scroll-snap-type: none; 
    }
    
    .card {
        max-width: var(--card-width-desktop);
        width: 100%;
        scroll-snap-align: none; 
    }
    
    /* Hide navigation dots on desktop (as the grid is full) */
    .slider-navigation {
        display: none; 
    }
}

@media (min-width: 1200px) {
    .card-image {
        height: 250px;
    }
}