/* BeeMarshall - Centralized Branding System
 * Color Palette | Typography | Component Styles
 * Version: v1.3
 */

:root {
    /* ===== COLOR PALETTE - Hive Theme ===== */
    /* Primary Colors */
    --light-yellow: #FFFACD;        /* Background/Light */
    --dark-yellow: #DAA520;         /* Primary Accent */
    --gold: #FFD700;                /* Secondary Accent */
    --white: #FFFFFF;               /* Pure White */
    --black: #000000;               /* Primary Text */
    
    /* Semantic Colors */
    --success: #28a745;             /* Green for success states */
    --warning: #ffc107;             /* Yellow for warnings */
    --danger: #dc3545;              /* Red for errors */
    --info: #17a2b8;                /* Blue for info */
    
    /* Neutral Grays */
    --gray-50: #f8f9fa;
    --gray-100: #e9ecef;
    --gray-200: #dee2e6;
    --gray-300: #ced4da;
    --gray-400: #adb5bd;
    --gray-500: #6c757d;
    --gray-600: #495057;
    --gray-700: #343a40;
    --gray-800: #212529;
    --gray-900: #1a1e21;
    
    /* Background Colors */
    --bg-primary: var(--white);
    --bg-secondary: var(--light-yellow);
    --bg-accent: var(--dark-yellow);
    --bg-success: #d4edda;
    --bg-warning: #fff3cd;
    --bg-danger: #f8d7da;
    --bg-info: #d1ecf1;
    
    /* Glass Morphism */
    --glass-bg: rgba(255, 250, 205, 0.95);
    --glass-border: rgba(218, 165, 32, 0.3);
    
    /* ===== TYPOGRAPHY SYSTEM ===== */
    --font-family-primary: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-family-mono: 'Monaco', 'Courier New', monospace;
    
    /* Font Sizes */
    --font-size-xs: 0.75rem;      /* 12px */
    --font-size-sm: 0.875rem;     /* 14px */
    --font-size-base: 1rem;       /* 16px */
    --font-size-md: 1.125rem;     /* 18px */
    --font-size-lg: 1.25rem;      /* 20px */
    --font-size-xl: 1.5rem;       /* 24px */
    --font-size-2xl: 1.875rem;    /* 30px */
    --font-size-3xl: 2.25rem;     /* 36px */
    --font-size-4xl: 3rem;        /* 48px */
    
    /* Font Weights */
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-snug: 1.375;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;
    --line-height-loose: 2;
    
    /* Letter Spacing */
    --letter-spacing-tighter: -0.05em;
    --letter-spacing-tight: -0.025em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.025em;
    --letter-spacing-wider: 0.05em;
    --letter-spacing-widest: 0.1em;
    
    /* ===== SPACING SYSTEM ===== */
    --spacing-0: 0;
    --spacing-1: 0.25rem;   /* 4px */
    --spacing-2: 0.5rem;    /* 8px */
    --spacing-3: 0.75rem;   /* 12px */
    --spacing-4: 1rem;      /* 16px */
    --spacing-5: 1.25rem;   /* 20px */
    --spacing-6: 1.5rem;    /* 24px */
    --spacing-8: 2rem;      /* 32px */
    --spacing-10: 2.5rem;   /* 40px */
    --spacing-12: 3rem;     /* 48px */
    --spacing-16: 4rem;     /* 64px */
    --spacing-20: 5rem;     /* 80px */
    
    /* ===== BORDER RADIUS ===== */
    --radius-none: 0;
    --radius-sm: 0.25rem;    /* 4px */
    --radius-md: 0.5rem;     /* 8px */
    --radius-lg: 0.75rem;    /* 12px */
    --radius-xl: 1rem;       /* 16px */
    --radius-2xl: 1.5rem;    /* 24px */
    --radius-full: 9999px;
    
    /* ===== SHADOWS ===== */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.15);
    --shadow-hive: 0 8px 32px rgba(218, 165, 32, 0.15);
    
    /* ===== TRANSITIONS & ANIMATIONS ===== */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slower: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== BASE TYPOGRAPHY ===== */
html, body {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--black);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--black);
    margin-bottom: var(--spacing-4);
}

h1 {
    font-size: var(--font-size-4xl);
    letter-spacing: var(--letter-spacing-tight);
}

h2 {
    font-size: var(--font-size-3xl);
    letter-spacing: var(--letter-spacing-tight);
}

h3 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-semibold);
}

h4 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
}

h5 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
}

h6 {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
}

p {
    margin-bottom: var(--spacing-4);
    line-height: var(--line-height-relaxed);
}

a {
    color: var(--dark-yellow);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--gold);
}

/* ===== BUTTON COMPONENTS ===== */
.btn {
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-base);
    line-height: 1.5;
    border-radius: var(--radius-lg);
    border: 2px solid transparent;
    padding: var(--spacing-3) var(--spacing-6);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2);
}

.btn:focus {
    outline: 2px solid var(--dark-yellow);
    outline-offset: 2px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--dark-yellow), var(--gold));
    color: var(--black);
    border-color: var(--dark-yellow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--gold), var(--dark-yellow));
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    background: transparent;
    border-color: var(--dark-yellow);
    color: var(--black);
}

.btn-outline-primary:hover {
    background: var(--dark-yellow);
    color: var(--black);
}

.btn-success {
    background: var(--success);
    color: var(--white);
    border-color: var(--success);
}

.btn-warning {
    background: var(--warning);
    color: var(--black);
    border-color: var(--warning);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
    border-color: var(--danger);
}

.btn-sm {
    padding: var(--spacing-2) var(--spacing-4);
    font-size: var(--font-size-sm);
}

.btn-lg {
    padding: var(--spacing-4) var(--spacing-8);
    font-size: var(--font-size-lg);
}

/* ===== CARD COMPONENTS ===== */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 2px solid var(--dark-yellow);
    box-shadow: var(--shadow-hive);
    overflow: hidden;
}

.card:hover {
    /* Subtle shadow change only, no transform for performance */
    box-shadow: var(--shadow-xl);
}

.card-header {
    padding: var(--spacing-4);
    background: var(--glass-bg);
    border-bottom: 2px solid var(--dark-yellow);
    font-weight: var(--font-weight-semibold);
}

.card-body {
    padding: var(--spacing-4);
}

.card-footer {
    padding: var(--spacing-4);
    background: var(--light-yellow);
    border-top: 2px solid var(--glass-border);
}

/* ===== FORM COMPONENTS ===== */
.form-control,
.form-select {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    padding: var(--spacing-3) var(--spacing-4);
    transition: all var(--transition-base);
    background: var(--white);
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--dark-yellow);
    box-shadow: 0 0 0 3px rgba(218, 165, 32, 0.1);
}

.form-label {
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--spacing-2);
    color: var(--black);
}

.form-text {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
}

/* ===== BADGE COMPONENTS ===== */
.badge {
    display: inline-block;
    padding: var(--spacing-1) var(--spacing-3);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    line-height: 1;
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
}

.badge-primary {
    background: linear-gradient(135deg, var(--primary-accent), var(--info));
    color: var(--white);
}

.badge-success {
    background: var(--success);
    color: var(--white);
}

.badge-warning {
    background: var(--warning);
    color: var(--black);
}

.badge-danger {
    background: var(--danger);
    color: var(--white);
}

/* ===== ALERT COMPONENTS ===== */
.alert {
    padding: var(--spacing-4);
    border-radius: var(--radius-lg);
    border: 2px solid;
    margin-bottom: var(--spacing-4);
}

.alert-success {
    background: var(--bg-success);
    border-color: var(--success);
    color: #155724;
}

.alert-warning {
    background: var(--bg-warning);
    border-color: var(--warning);
    color: #856404;
}

.alert-danger {
    background: var(--bg-danger);
    border-color: var(--danger);
    color: #721c24;
}

.alert-info {
    background: var(--bg-info);
    border-color: var(--info);
    color: #0c5460;
}

/* ===== UTILITY CLASSES ===== */
.text-hive-primary {
    color: var(--dark-yellow);
}

.text-hive-secondary {
    color: var(--gold);
}

.bg-hive-primary {
    background: var(--dark-yellow);
}

.bg-hive-secondary {
    background: var(--light-yellow);
}

.border-hive {
    border-color: var(--dark-yellow);
}

.shadow-hive {
    box-shadow: var(--shadow-hive);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    h1 { font-size: var(--font-size-3xl); }
    h2 { font-size: var(--font-size-2xl); }
    h3 { font-size: var(--font-size-xl); }
    h4 { font-size: var(--font-size-lg); }
}

/* ===== ENHANCED MINI-CARDS ===== */
/* Hive Strength Badges - Performance optimized (no animations) */
.hive-strength-badge {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hive-strength-badge:hover {
    /* Subtle shadow change only, no transform for performance */
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

/* Hive Box Cards - Performance optimized (no animations) */
.hive-box-card {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 2px solid transparent;
}

.hive-box-card:hover {
    /* Subtle shadow change only, no transform/scale for performance */
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Mobile responsiveness for mini-cards */
@media (max-width: 768px) {
    .hive-strength-badge {
        min-width: 70px !important;
        font-size: 0.8rem !important;
        padding: 0.4rem 0.6rem !important;
    }
    
    .hive-box-card {
        min-width: 90px !important;
        max-width: 110px !important;
    }
    
    .hive-box-card .card-body {
        padding: 0.5rem !important;
    }
    
    .hive-box-card .card-body i {
        font-size: 1rem !important;
    }
    
    .hive-box-card .card-body .fw-bold {
        font-size: 0.7rem !important;
    }
    
    .hive-box-card .card-body .h5 {
        font-size: 1rem !important;
    }
}

/* ===== SHIMMER ANIMATION FOR CONTACT REQUIRED BADGE ===== */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.contact-required-badge {
    border: 2px solid #000000 !important;
    /* Static gradient background instead of animated shimmer for performance */
    background: linear-gradient(
        90deg,
        #ffc107 0%,
        #ffcd39 25%,
        #ffd700 50%,
        #ffcd39 75%,
        #ffc107 100%
    );
    position: relative;
    overflow: hidden;
}

/* ===== BACK TO TOP BUTTON ===== */
/* Button is now positioned in bottom right next to sync overlay */
/* Styles are defined in beemarshall-full.html */

/* ===== INTERACTIVE HIVE ANALYSIS CARD ===== */
/* Draggable and Resizable Card Styles */
.draggable-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.draggable-handle {
    cursor: move;
    user-select: none;
}

.draggable-handle:active {
    cursor: grabbing;
}

/* Resizable Card */
.resizable-card {
    resize: both;
    overflow: auto;
}

/* Hive Category Cards */
.hive-category-card {
    background: var(--glass-bg);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.hive-category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
    border-color: var(--dark-yellow);
}

.hive-category-card.clickable {
    cursor: pointer;
}

.hive-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.hive-icon.strong { color: #28a745; }
.hive-icon.medium { color: #ffc107; }
.hive-icon.weak { color: #fd7e14; }
.hive-icon.nuc { color: #6f42c1; }
.hive-icon.dead { color: #dc3545; }
.hive-icon.empty { color: #6c757d; }

.hive-count {
    font-size: 2rem;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 0.25rem;
}

.hive-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--black);
    margin-bottom: 0.25rem;
}

.hive-description {
    font-size: 0.9rem;
    color: var(--gray-600);
}

.hive-category-card:hover .hive-icon {
    transform: scale(1.1);
}

.hive-category-card:hover .hive-count {
    color: var(--dark-yellow);
}

/* Compact Hive Category Cards (non-interactive) */
.hive-category-card-compact {
    background: var(--glass-bg);
    border-radius: 6px;
    padding: 0.5rem;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 70px;
}

/* Responsive adjustments for breakdown cards container */
@media (max-width: 991.98px) {
    .row.mb-3.g-2.g-lg-3 > .col-12.col-lg-6 {
        width: 100%;
        max-width: 100%;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    /* Ensure inner row items fit 5 per line on mobile */
    .row.g-1.g-sm-2 {
        display: flex;
        flex-wrap: nowrap;
    }
    
    .row.g-1.g-sm-2 > .col[style*="20%"] {
        flex: 0 0 20% !important;
        max-width: 20% !important;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
}

@media (min-width: 992px) {
    /* Force breakdown cards row to display side by side on desktop */
    .row.mb-3.g-2.g-lg-2[style*="flex-wrap: nowrap"] {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 0.5rem;
    }
    
    .row.mb-3.g-2.g-lg-2 > .col-12.col-lg-6 {
        width: 50% !important;
        max-width: 50% !important;
        flex: 0 0 50% !important;
        margin-bottom: 0 !important;
    }
    
    /* On desktop, keep all 5 items on one line within each card */
    .row.g-1.g-sm-2 {
        display: flex !important;
        flex-wrap: nowrap !important;
    }
    
    .row.g-1.g-sm-2 > .col[style*="20%"] {
        flex: 0 0 20% !important;
        max-width: 20% !important;
    }
    
    /* Make breakdown cards more compact on desktop */
    .row.mb-3.g-2.g-lg-2 > .col-12.col-lg-6 .card-body {
        padding: 0.5rem 0.75rem !important;
    }
    
    .row.mb-3.g-2.g-lg-2 > .col-12.col-lg-6 .hive-category-card-compact {
        padding: 0.4rem !important;
        min-height: 60px !important;
    }
    
    /* Ensure cards themselves are compact */
    .row.mb-3.g-2.g-lg-2 > .col-12.col-lg-6 .card {
        margin-bottom: 0;
    }
}

.hive-icon-compact {
    font-size: 1.25rem;
    margin-bottom: 0.2rem;
}

@media (min-width: 576px) {
    .hive-icon-compact {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }
}

@media (min-width: 992px) {
    .hive-icon-compact {
        font-size: 1.75rem;
        margin-bottom: 0.3rem;
    }
}

.hive-icon-compact.strong { color: #28a745; }
.hive-icon-compact.medium { color: #ffc107; }
.hive-icon-compact.weak { color: #fd7e14; }
.hive-icon-compact.nuc { color: #6f42c1; }
.hive-icon-compact.dead { color: #dc3545; }
.hive-icon-compact.empty { color: #6c757d; }

.hive-count-compact {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 0.1rem;
    line-height: 1.2;
}

@media (min-width: 576px) {
    .hive-count-compact {
        font-size: 1.5rem;
        margin-bottom: 0.15rem;
    }
}

@media (min-width: 992px) {
    .hive-count-compact {
        font-size: 1.75rem;
        margin-bottom: 0.2rem;
    }
}

.hive-label-compact {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-700);
    font-style: italic;
    line-height: 1.2;
}

@media (min-width: 576px) {
    .hive-label-compact {
        font-size: 0.85rem;
    }
}

@media (min-width: 992px) {
    .hive-label-compact {
        font-size: 0.9rem;
    }
}

/* ===== PREFERS REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hive-strength-badge,
    .hive-box-card {
        transition: none !important;
    }
    
    .contact-required-badge {
        animation: none !important;
    }
}
