/* ===================================
   Global Styles & Reset
   =================================== */

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

:root {
    /* Primary Colors - ONLY using specified colors */
    --primary-red: #cb0c0c;
    --dark-red: #952624;
    
    /* Derived shades from primary colors for variety */
    --red-light: #e03838;
    --red-lighter: #ff6b6b;
    --red-dark: #7a1d1d;
    --red-darker: #4a0e0e;
    
    /* Neutral colors */
    --white: #ffffff;
    --off-white: #fafafa;
    --light-gray: #f5f5f5;
    --gray: #e0e0e0;
    --dark-gray: #9e9e9e;
    --text-dark: #081727;
    --text-medium: #4a4a4a;
    --text-light: #757575;
    
    /* Background colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f0f0f0;
    
    /* Shadow colors */
    --shadow-sm: rgba(149, 38, 36, 0.08);
    --shadow-md: rgba(149, 38, 36, 0.12);
    --shadow-lg: rgba(149, 38, 36, 0.16);
    --shadow-xl: rgba(149, 38, 36, 0.24);
    
    /* Typography */
    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Inter', sans-serif;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-xxl: 4rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-round: 50%;
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-medium: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}
   h1 {
            font-size: 1.98rem;
            color: var(--primary-color);
            margin-bottom: 10px;
        }

        .subtitle {
            font-size: clamp(0.9rem, 2vw, 1.1rem);
            color: #b4b4b4;
            font-weight: 300;
        }

        .content-wrapper {
            display: grid;
            grid-template-columns: 100%;
            gap: 30px;
            align-items: start;
        }

        /* Labels Panel */
        .labels-panel {
            background: rgba(255, 255, 255, 0.05);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 15px;
            padding: 25px;
            position: sticky;
            top: 20px;
        }

        .labels-panel h2 {
            font-size: 1.3rem;
            color: var(--primary-color);
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 2px solid rgba(0, 217, 255, 0.3);
        }

        .label-item {
            display: block;
            width: 100%;
            padding: 12px 15px;
            margin-bottom: 10px;
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            color: #e4e4e4;
            text-align: left;
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 0.95rem;
            text-decoration: none;
        }

        .label-item:hover,
        .label-item:focus {
            background: rgba(0, 217, 255, 0.15);
            border-color: var(--primary-color);
            transform: translateX(5px);
            box-shadow: 0 4px 15px rgba(0, 217, 255, 0.3);
            outline: none;
        }

        .label-item:active {
            transform: translateX(3px);
        }

        .label-item.active {
            background: rgba(0, 217, 255, 0.2);
            border-color: var(--primary-color);
            box-shadow: 0 4px 15px rgba(0, 217, 255, 0.4);
        }

        /* Diagram Container */
        .diagram-container {
            background: rgba(255, 255, 255, 0.03);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 15px;
            padding: 30px;
            position: relative;
            overflow: hidden;
        }

        .svg-wrapper {
            width: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            position: relative;
        }

        #kidneyDiagram {
            max-width: 100%;
            height: auto;
            filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
        }

        /* Interactive SVG Elements */
        #kidneyDiagram .kidney-part {
            cursor: pointer;
            transition: all 0.3s ease;
        }

        #kidneyDiagram .kidney-part:hover,
        #kidneyDiagram .kidney-part:focus {
            filter: brightness(1.3) drop-shadow(0 0 10px rgba(0, 217, 255, 0.8));
            outline: none;
        }

        #kidneyDiagram .kidney-part.active {
            filter: brightness(1.5) drop-shadow(0 0 15px rgba(0, 217, 255, 1));
        }

        #kidneyDiagram text {
            cursor: pointer;
            transition: all 0.3s ease;
        }

        #kidneyDiagram text:hover,
        #kidneyDiagram text:focus {
            fill: var(--primary-color);
             
            outline: none;
        }

        #kidneyDiagram text.active {
            fill: var(--primary-color);
            
            font-weight: bold;
        }

        /* Tooltip */
        .tooltip {
            position: fixed;
            background:linear-gradient(90deg, #eaefff 0%, #fbd7d7 100%);
            border: 1px solid var(--primary-color);
            border-radius: 12px;
            padding: 20px;
            max-width: 350px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 217, 255, 0.3);
            z-index: 1000;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
            transform: translateY(-10px);
            pointer-events: none;
            z-index: 1036;
        }

        .tooltip.active {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .tooltip-header {
            font-size: 1.3rem;
            color: var(--primary-color);
            margin-bottom: 12px;
            font-weight: 600;
            border-bottom: 1px solid rgba(73, 73, 73, 0.3);
            padding-bottom: 8px;
        }

        .tooltip-content {
            font-size: 0.95rem;
            line-height: 1.6;
            color: #303030;
        }

        .tooltip::before {
            content: '';
            position: absolute;
            bottom: -10px;
            left: 20px;
            width: 0;
            height: 0;
            border-left: 10px solid transparent;
            border-right: 10px solid transparent;
            border-top: 10px solid var(--primary-color);
        }

        /* Instructions */
        .instructions {
               background: #fbefef;
    border-left: 4px solid var(--primary-color);
    padding: 15px 20px;
    margin-top: 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #797979;
        }

        .instructions strong {
            color: var(--primary-color);
        }

        /* Responsive Design */
        @media (max-width: 1024px) {
            .content-wrapper {
                grid-template-columns: 1fr;
            }

            .labels-panel {
                position: relative;
                top: 0;
            }

            .labels-panel h2 {
                text-align: center;
            }

            .label-item {
                display: inline-block;
                width: auto;
                margin: 5px;
            }
        }

        @media (max-width: 768px) {
            body {
                padding: 15px;
            }

            header {
                margin-bottom: 25px;
            }

            .diagram-container {
                padding: 20px;
            }

            .tooltip {
                max-width: 280px;
                padding: 15px;
            }

            .tooltip-header {
                font-size: 1.1rem;
            }

            .tooltip-content {
                font-size: 0.85rem;
            }
        }

        @media (max-width: 480px) {
            .label-item {
                display: block;
                width: 100%;
                margin: 8px 0;
            }

            h1 {
                font-size: 1.8rem;
            }

            .subtitle {
                font-size: 0.85rem;
            }
        }

        /* Loading Animation */
        @keyframes pulse {
            0%, 100% {
                opacity: 1;
            }
            50% {
                opacity: 0.5;
            }
        }

        .loading {
            animation: pulse 1.5s ease-in-out infinite;
        }

        /* Focus Visible for Accessibility */
        *:focus-visible {
            outline: 2px solid var(--primary-color);
            outline-offset: 3px;
        }