/* V5 Homepage Styles - Final "Compact & Airy" */

/* --- Layout & Typography --- */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* --- Header Container --- */
.header-v4 {
    display: flex;
    flex-direction: column;
    /* Stack Wrapper and Button */
    padding: 0;
    /* Content padding moves inside */
    background: transparent;
    align-items: center;
    margin-bottom: 20px;
}

/* --- MASTER WRAPPER (The Big Rectangle) --- */
.master-panel-wrapper {
    display: flex;
    flex-direction: row;
    /* Logo Left, Grid Right */
    width: 100%;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 20px 25px;
    box-sizing: border-box;

    /* Toggle Mechanics */
    overflow: hidden;
    max-height: 120px;
    /* STRICT LIMIT: Shows ONLY 1 ROW + Logo/Search block */
    transition: max-height 0.5s ease-in-out;
    border-bottom: 1px solid #eee;
}

.master-panel-wrapper.expanded {
    max-height: 2000px;
    /* Expand fully */
}

/* --- Zone 1: Brand (Logo & Search) --- */
/* --- Zone 1: Brand (Logo Only) --- */
.brand-zone {
    width: 220px;
    /* Slightly narrower since search is gone */
    flex-shrink: 0;
    margin-right: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Center Vertically now */
    padding-top: 0;
}

.logo-v4 {
    width: 100%;
    max-width: 200px;
    height: auto;
    display: block;
    /* No bottom margin needed if it's the only thing */
}

/* --- Zone 2: Specialties Grid --- */
.mega-grid-container {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    /* More breathing room */
    align-items: flex-start;
    padding-top: 5px;
    /* No internal max-height/overflow needed - handled by Wrapper */
}

/* "Show More" Button (Attached to Bottom) */

/* --- NAVIGATION DOCK (The Bottom Bar) --- */
.navigation-dock {
    width: 100%;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 10px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Space between Toggle and Search */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    border-radius: 0 0 12px 12px;
    /* Smooth rounded bottom corners */
    margin-top: -1px;
    /* Connect to master panel */
    z-index: 10;
    position: relative;
    gap: 20px;
}

/* 1. The Toggle Button (Left/Center) */
#show-more-btn {
    background: transparent;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

#show-more-btn:hover {
    background-color: #f0f2f5;
    color: #2c3e50;
    transform: translateX(2px);
    /* Subtle nudging */
}

/* 2. The Dock Search (Right) */
.dock-search-container {
    flex: 1;
    max-width: 300px;
    /* Limit width */
    position: relative;
}

#specialty-search {
    width: 100%;
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    /* Pill Shape */
    font-size: 0.9rem;
    background-color: #f9f9f9;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    /* Inner depth */
}

#specialty-search:focus {
    background-color: #fff;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
    outline: none;
}

/* Icon tweak removed (using placeholder emoji for now or background image if preferred) */
/* If keeping the SVG background: */
#specialty-search {
    /* Keeping the previous background icon if desirable, but simplified here for the Pill look */
    background-image: none;
    padding-left: 15px;
}

/* --- "TOATE" Button Style --- */
.specialty-btn.btn-all {
    background-color: #2c3e50;
    /* distinct dark blue/black */
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    border: none;
    padding: 4px 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.specialty-btn.btn-all:hover {
    background-color: #000;
    transform: translateY(-2px);
}

.specialty-btn.btn-all.active {
    background-color: #000;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* --- CATEGORY CONTAINERS (Colored Backgrounds) --- */
.specialty-category {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 8px;
    /* Compact */
    border-radius: 6px;
    margin-bottom: 4px;
    border-left: 4px solid transparent;
    /* Marker */
    transition: background-color 0.2s;
}

/* Metabolic: Red Coral */
.cat-metabolic {
    background-color: rgba(255, 82, 82, 0.08);
    border-left-color: #FF5252;
}

.cat-metabolic .specialty-btn:hover,
.cat-metabolic .specialty-btn.active {
    background-color: #FF5252;
    color: #fff;
    border-color: #FF5252;
}

/* Respirator: Azure Blue */
.cat-respirator {
    background-color: rgba(3, 169, 244, 0.08);
    border-left-color: #03A9F4;
}

.cat-respirator .specialty-btn:hover,
.cat-respirator .specialty-btn.active {
    background-color: #03A9F4;
    color: #fff;
    border-color: #03A9F4;
}

/* Neuro: Deep Violet */
.cat-neuro {
    background-color: rgba(124, 77, 255, 0.08);
    border-left-color: #7C4DFF;
}

.cat-neuro .specialty-btn:hover,
.cat-neuro .specialty-btn.active {
    background-color: #7C4DFF;
    color: #fff;
    border-color: #7C4DFF;
}

/* Chirurgie: Emerald Green */
.cat-chirurgie {
    background-color: rgba(0, 200, 83, 0.08);
    border-left-color: #00C853;
}

.cat-chirurgie .specialty-btn:hover,
.cat-chirurgie .specialty-btn.active {
    background-color: #00C853;
    color: #fff;
    border-color: #00C853;
}

/* Mama & Copilul: Magenta/Pink */
.cat-mama {
    background-color: rgba(224, 64, 251, 0.08);
    border-left-color: #E040FB;
}

.cat-mama .specialty-btn:hover,
.cat-mama .specialty-btn.active {
    background-color: #E040FB;
    color: #fff;
    border-color: #E040FB;
}

/* Paraclinic: Blue Grey */
.cat-paraclinic {
    background-color: rgba(96, 125, 139, 0.1);
    border-left-color: #607D8B;
}

.cat-paraclinic .specialty-btn:hover,
.cat-paraclinic .specialty-btn.active {
    background-color: #607D8B;
    color: #fff;
    border-color: #607D8B;
}


/* --- BUTTONS (White by Default) --- */
.specialty-btn {
    border: 1px solid rgba(0, 0, 0, 0.08);
    background-color: #fff;
    color: #444;
    /* Dark text for readability */
    border-radius: 4px;
    padding: 3px 10px;
    /* Very Compact */
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
}

.specialty-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.specialty-btn.active {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: scale(0.98);
}


/* --- Feedback Container (Empty State) --- */
#feedback-container {
    display: none;
    background: #fff;
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    max-width: 600px;
    margin: 40px auto;
}

#feedback-container h3 {
    color: #444;
    font-size: 1.25rem;
    margin-bottom: 15px;
}

#feedback-text {
    width: 100%;
    height: 100px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
    margin-bottom: 15px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
}

/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
    .master-panel-wrapper {
        flex-direction: column;
        align-items: center;
        max-height: none;
        /* Auto height on mobile usually better, or limit */
    }

    .brand-zone {
        margin-right: 0;
        margin-bottom: 15px;
        width: 100%;
    }

    .mega-grid-container {
        justify-content: center;
    }
}

/* --- CAROUSEL REFINEMENT V2 (The Contained Glass-Pane) --- */

/* 1. The Container Shield (Fixes Overlap) */
.carousel {
    position: relative;
    overflow: hidden !important;
    /* CRITICAL: Clips the tall controls so they don't bleed out */
    border-radius: 15px;
    /* Aesthetic rounding */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    /* Lift */
    transform: translateZ(0);
    /* Safari fix */
    margin-bottom: 20px;
}

/* 2. Glass-Pane Controls (Fixes "Black" Look) */
.carousel-control-prev,
.carousel-control-next {
    width: 10% !important;
    /* Narrower (was 15%) */
    height: 100% !important;
    top: 0 !important;
    bottom: 0 !important;
    margin: 0 !important;
    z-index: 100 !important;
    transform: none !important;

    /* GLASS MORPHISM - SOFT EDGES */
    /* Instead of a solid background, use a gradient that fades out to transparent */
    backdrop-filter: blur(3px);
    /* Slightly softer blur */
    transition: all 0.3s ease !important;
    opacity: 1 !important;
    border: none !important;
    /* Remove sharp borders */
}

/* Gradient Fades for "Blurred Edge" effect */
.carousel-control-prev {
    background: linear-gradient(to right, rgba(255, 255, 255, 0.1), transparent) !important;
}

.carousel-control-next {
    background: linear-gradient(to left, rgba(255, 255, 255, 0.1), transparent) !important;
}

/* 3. Visual Feedack on Hover */
.carousel-control-prev:hover {
    background: linear-gradient(to right, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.05)) !important;
    backdrop-filter: blur(6px);
}

.carousel-control-next:hover {
    background: linear-gradient(to left, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.05)) !important;
    backdrop-filter: blur(6px);
}

/* 4. The "Neon Beacons" Icons (Keep White & Shadow) */
.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 40px !important;
    /* Slightly smaller to match narrower zone */
    height: 40px !important;
    background-size: 100% 100% !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
    opacity: 0.9;
}

/* Ensure centering */
.carousel-control-prev,
.carousel-control-next {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* 5. Mobile Adjustments */
@media (max-width: 768px) {

    .carousel-control-next {
        width: 12% !important;
    }
}

/* --- Carousel Caption Redesign (User Request) --- */
.carousel-caption {
    top: auto !important;
    /* Override style.css top:0 */
    bottom: 0 !important;
    /* Position at bottom */
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    /* Full width strip */
    padding: 8px 15px !important;
    /* Compact padding */
    background: rgba(0, 0, 0, 0.6);
    /* Shadow strip (banda de umbra) */
    text-align: left !important;
    /* Left aligned (coltul stanga) */
    font-size: 0.9rem !important;
    /* Small text (scris mic) */
    text-shadow: none !important;
    /* Clean text */
    /* Optional: match rounded corners of the container if needed
       Assuming the carousel has border-radius 15px, we might want this: */
    border-radius: 0 0 15px 15px;
    z-index: 150 !important;
    /* Higher than controls (100) */
    pointer-events: none;
    /* So clicks pass through to image/controls */
}