/* Canopy Theme - Forest Canopy Design System */

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

:root {
    /* Canopy Color Palette - Forest Layers */
    --canopy-primary: #2D5016;        /* Deep forest green - canopy layer */
    --canopy-primary-light: #4A7C2B;  /* Bright canopy leaves */
    --canopy-primary-dark: #1A3009;   /* Shadow beneath canopy */
    --canopy-accent: #6B9E3E;         /* Sunlit leaves */
    --canopy-highlight: #8FBC5C;      /* New growth */
    
    /* Sky and Light */
    --canopy-sky: #E8F4F8;            /* Sky through leaves */
    --canopy-light: #F0F7EB;          /* Dappled sunlight */
    --canopy-sunbeam: #FFE87C;        /* Sunbeam through canopy */
    
    /* Trunk and Bark */
    --canopy-bark: #8B7355;           /* Tree bark */
    --canopy-bark-dark: #6B5340;      /* Aged bark */
    
    /* Forest Floor */
    --canopy-ground: #3D3D2B;         /* Forest floor */
    --canopy-moss: #5C7A51;           /* Moss on trunk */
    
    /* Shadows and Depth */
    --canopy-shadow: rgba(29, 48, 9, 0.15);
    --canopy-shadow-deep: rgba(29, 48, 9, 0.3);
    
    /* Status Colors */
    --canopy-success: #4A7C2B;        /* Healthy leaves */
    --canopy-warning: #D4A574;        /* Autumn leaves */
    --canopy-danger: #A84632;         /* Dead branch */
    --canopy-info: #6B9E3E;           /* Fresh growth */
    
    /* Neutral Tones */
    --canopy-dark: #2C3E2A;
    --canopy-light-bg: #FAFDF8;
    --canopy-border: #D4E3C8;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: linear-gradient(180deg, 
        var(--canopy-sky) 0%, 
        var(--canopy-light) 30%,
        var(--canopy-primary-light) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    position: relative;
}

/* Canopy Texture Overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(107, 158, 62, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(45, 80, 22, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(143, 188, 92, 0.08) 0%, transparent 30%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ========================================================================
   HEADER - Tree Canopy Top
   ======================================================================== */

.header {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.95) 0%, 
        rgba(240, 247, 235, 0.95) 100%);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 
        0 10px 30px var(--canopy-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    margin-bottom: 24px;
    border: 2px solid var(--canopy-border);
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-content {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px var(--canopy-shadow));
}

.header-text h1 {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 4px;
    background: linear-gradient(135deg, 
        var(--canopy-primary) 0%, 
        var(--canopy-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px var(--canopy-shadow);
}

.header-text .company {
    color: var(--canopy-bark);
    font-size: 0.8em;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.subtitle {
    color: var(--canopy-ground);
    font-size: 1.1em;
    margin-bottom: 24px;
    font-weight: 500;
}

/* ========================================================================
   NAVIGATION - Branches
   ======================================================================== */

.nav-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.nav-link {
    background: linear-gradient(135deg, 
        var(--canopy-primary) 0%, 
        var(--canopy-primary-light) 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 4px 6px var(--canopy-shadow);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 2px solid transparent;
}

.nav-link:hover {
    background: linear-gradient(135deg, 
        var(--canopy-accent) 0%, 
        var(--canopy-highlight) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px var(--canopy-shadow-deep);
    border-color: var(--canopy-sunbeam);
}

.nav-icon {
    font-size: 1.2em;
}

/* ========================================================================
   CARDS - Leaf Clusters
   ======================================================================== */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.card {
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.98) 0%, 
        rgba(250, 253, 248, 0.95) 100%);
    backdrop-filter: blur(8px);
    padding: 28px;
    border-radius: 16px;
    box-shadow: 
        0 10px 30px var(--canopy-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 2px solid var(--canopy-border);
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease;
    position: relative;
    overflow: hidden;
}

/* Leaf texture on cards */
.card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, 
        rgba(107, 158, 62, 0.03) 0%, 
        transparent 70%);
    pointer-events: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 15px 40px var(--canopy-shadow-deep),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border-color: var(--canopy-accent);
}

.card h2 {
    color: var(--canopy-primary);
    font-size: 1.4em;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--canopy-accent);
    font-weight: 600;
    position: relative;
    z-index: 1;
}

/* ========================================================================
   STATUS INDICATORS - Health of Trees
   ======================================================================== */

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--canopy-light);
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid var(--canopy-accent);
    transition: all 0.2s ease;
}

.status-item:hover {
    background: var(--canopy-sky);
    border-left-width: 6px;
}

.status-label {
    font-weight: 600;
    color: var(--canopy-ground);
}

.status-value {
    font-weight: 700;
    color: var(--canopy-success);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-value.pending {
    color: var(--canopy-warning);
}

.status-value.error {
    color: var(--canopy-danger);
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 24px;
    font-weight: 600;
    font-size: 0.95em;
    box-shadow: 0 2px 8px var(--canopy-shadow);
}

.status-badge::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.9);
    }
}

.status-healthy {
    background: var(--canopy-success);
    color: white;
}

.status-healthy::before {
    background: white;
}

.status-degraded {
    background: var(--canopy-warning);
    color: white;
}

.status-degraded::before {
    background: white;
}

.status-unhealthy {
    background: var(--canopy-danger);
    color: white;
}

.status-unhealthy::before {
    background: white;
}

/* ========================================================================
   BUTTONS - Growing Branches
   ======================================================================== */

.button, .btn {
    background: linear-gradient(135deg, 
        var(--canopy-primary) 0%, 
        var(--canopy-primary-light) 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px var(--canopy-shadow);
    position: relative;
    overflow: hidden;
}

.button::before, .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.button:hover::before, .btn:hover::before {
    width: 300px;
    height: 300px;
}

.button:hover, .btn:hover {
    background: linear-gradient(135deg, 
        var(--canopy-accent) 0%, 
        var(--canopy-highlight) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--canopy-shadow-deep);
}

.button:active, .btn:active {
    transform: translateY(0);
}

/* ========================================================================
   SUCCESS MESSAGE - Blooming Flowers
   ======================================================================== */

.success-message {
    background: linear-gradient(135deg, 
        var(--canopy-success) 0%, 
        var(--canopy-accent) 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    font-size: 18px;
    margin-bottom: 20px;
    box-shadow: 0 8px 20px var(--canopy-shadow);
    border: 2px solid var(--canopy-highlight);
    animation: bloom 0.5s ease;
}

@keyframes bloom {
    0% {
        transform: scale(0.9);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ========================================================================
   METRICS - Tree Rings (Growth)
   ======================================================================== */

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--canopy-border);
}

.metric:last-child {
    border-bottom: none;
}

.metric-label {
    color: var(--canopy-bark);
    font-weight: 500;
}

.metric-value {
    font-weight: 700;
    color: var(--canopy-primary);
    font-size: 1.15em;
}

/* ========================================================================
   STAT CARDS - Canopy Density
   ======================================================================== */

.stat-card {
    background: linear-gradient(135deg, 
        var(--canopy-primary) 0%, 
        var(--canopy-accent) 100%);
    color: white;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 20px var(--canopy-shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '🌿';
    position: absolute;
    font-size: 100px;
    opacity: 0.1;
    right: -20px;
    bottom: -20px;
    transform: rotate(-15deg);
}

.stat-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 30px var(--canopy-shadow-deep);
}

.stat-value {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.stat-label {
    opacity: 0.9;
    font-weight: 500;
}

/* ========================================================================
   LOADING STATES - Leaves Rustling
   ======================================================================== */

.loading {
    text-align: center;
    padding: 30px;
    color: var(--canopy-moss);
    font-size: 1.1em;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}

/* ========================================================================
   SCROLLBAR - Tree Trunk
   ======================================================================== */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--canopy-light);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, 
        var(--canopy-bark) 0%, 
        var(--canopy-bark-dark) 100%);
    border-radius: 5px;
    border: 2px solid var(--canopy-light);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, 
        var(--canopy-bark-dark) 0%, 
        var(--canopy-ground) 100%);
}

/* ========================================================================
   RESPONSIVE DESIGN
   ======================================================================== */

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

    .header {
        padding: 20px;
    }

    .logo {
        width: 50px;
        height: 50px;
    }

    .header-text h1 {
        font-size: 1.8em;
    }

    .nav-links {
        flex-direction: column;
    }

    .nav-link {
        text-align: center;
    }

    .grid {
        grid-template-columns: 1fr;
    }
}