/* ===================================
   Forest Resom - Minimal White Theme
   =================================== */

:root {
    /* Color Palette - Minimal & Professional */
    --primary-dark: #333333;
    --primary-text: #333333;
    --secondary-text: #6b6b6b;
    --border-color: #e5e5e5;
    --background: #ffffff;
    --background-alt: #fafafa;

    /* Accent Colors */
    --accent-primary: #2d7a3e;  /* Forest Green */
    --accent-success: #10b981;
    --accent-danger: #ef4444;
    --accent-warning: #f59e0b;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
}

/* ===================================
   Base Styles
   =================================== */

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

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background: var(--background);
    color: var(--primary-text);
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===================================
   Map Section
   =================================== */

.col-lg-8 {
    position: relative;
    overflow: hidden;
}

#map {
    position: relative;
    z-index: 1;
    margin-top: -40px;
    margin-bottom: -20px;
    height: calc(100vh + 60px) !important;
}

/* ===================================
   Side Panel
   =================================== */

.side-panel {
    background: var(--background);
    height: 100vh;
    padding: var(--spacing-lg);
    overflow-y: auto;
    border-left: 1px solid var(--border-color);
}

/* Brand Header */
.brand-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.brand-header h1 {
    font-size: 22px;
    font-weight: 500;
    color: var(--primary-dark);
    letter-spacing: -0.5px;
    margin: 0;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-success);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    font-size: 12px;
    color: var(--secondary-text);
    font-weight: 400;
}

/* ===================================
   Loading
   =================================== */

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl) 0;
    gap: var(--spacing-md);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 13px;
    color: var(--secondary-text);
    font-weight: 400;
}

/* ===================================
   Cart Filter
   =================================== */

.cart-filter-container {
    margin-bottom: var(--spacing-md);
}

.filter-scroll {
    display: flex;
    gap: var(--spacing-sm);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* 스크롤바 숨기기 (Webkit 브라우저) */
.filter-scroll::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    flex-shrink: 0;
    padding: 4px 6px;
    font-size: 11px;
    font-weight: 500;
    color: var(--secondary-text);
    background: var(--background-alt);
    border: 1px solid var(--border-color);
    border-radius: 20px; /* 타원형 */
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    letter-spacing: -0.2px;
}

.filter-btn:hover {
    color: var(--primary-text);
    border-color: var(--primary-text);
    background: var(--background);
}

.filter-btn.active {
    color: white;
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* ===================================
   Cart Cards
   =================================== */

.cart-status-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.cart-card {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: var(--spacing-md);
    transition: all 0.2s ease;
    cursor: pointer;
}

.cart-card:hover {
    border-color: var(--primary-text);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Cart Header */
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

.cart-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--primary-dark);
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-name i {
    color: var(--accent-primary);
}

/* Status Text */
.cart-status {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cart-status.on {
    color: var(--accent-success);
}

.cart-status.off {
    color: #999999;
}

/* Cart Body */
.cart-body .info-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.cart-body .info-item {
    padding: 0;
}

.cart-body small {
    display: block;
    font-size: 10px;
    color: var(--secondary-text);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.cart-body .value {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-dark);
    line-height: 1.2;
}

.cart-body .value.small {
    font-size: 11px;
    font-weight: 500;
}

/* Chart Wrapper */
.cart-body .chart-wrapper {
    margin-top: var(--spacing-md);
    padding: 0;
}

.cart-body .chart-title {
    font-size: 10px;
    font-weight: 500;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-sm);
}

.cart-chart-container {
    position: relative;
    height: 84px;
    width: 100%;
}

/* Button */
.btn-primary {
    background: var(--primary-dark) !important;
    border: none !important;
    color: white !important;
    font-size: 13px;
    font-weight: 500;
    padding: 10px var(--spacing-md);
    border-radius: 6px;
    transition: all 0.2s ease;
    letter-spacing: -0.2px;
}

.btn-primary:hover {
    background: var(--accent-primary) !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary i {
    margin-right: 6px;
}

/* ===================================
   Scrollbar
   =================================== */

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-text);
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 991px) {
    /* Tablet */
    #map {
        height: calc(70vh + 60px) !important;
    }

    .side-panel {
        height: auto;
        min-height: 30vh;
        border-left: none;
        border-top: 1px solid var(--border-color);
    }

    .brand-header {
        margin-bottom: var(--spacing-lg);
        padding-bottom: var(--spacing-md);
    }

    .brand-header h1 {
        font-size: 20px;
    }

    .cart-card {
        padding: var(--spacing-md);
    }

    .cart-body .value {
        font-size: 15px;
    }

    .cart-body small {
        font-size: 9px;
    }

    .cart-chart-container {
        height: 70px;
    }
}

@media (max-width: 767px) {
    /* Mobile */
    .side-panel {
        padding: var(--spacing-md);
    }

    .brand-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: var(--spacing-sm);
    }

    .brand-header h1 {
        font-size: 16px;
    }

    .status-indicator {
        font-size: 10px;
    }

    .cart-body .value {
        font-size: 14px;
    }

    .cart-body small {
        font-size: 9px;
    }

    .cart-chart-container {
        height: 70px;
    }
}

@media (max-width: 576px) {
    /* Small Mobile */
    .side-panel {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .brand-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-bottom: var(--spacing-md);
        padding-bottom: var(--spacing-sm);
    }

    .brand-header h1 {
        font-size: 15px;
    }

    .status-dot {
        width: 6px;
        height: 6px;
    }

    .status-text {
        font-size: 9px;
    }

    .cart-card {
        padding: var(--spacing-sm);
    }

    .cart-name {
        font-size: 14px;
    }

    .cart-body .info-row {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .cart-body .value {
        font-size: 12px;
    }

    .cart-body .value.small {
        font-size: 9px;
    }

    .cart-body small {
        font-size: 8px;
        margin-bottom: 2px;
    }

    .cart-chart-container {
        height: 63px;
    }
}

/* ===================================
   Utilities
   =================================== */

.mt-3 {
    margin-top: var(--spacing-md);
}

.mb-4 {
    margin-bottom: var(--spacing-lg);
}

.w-100 {
    width: 100%;
}

/* Remove Bootstrap default margins */
.container-fluid {
    padding: 0 !important;
}

.row {
    margin: 0 !important;
}

.col-lg-8,
.col-lg-4 {
    padding: 0 !important;
}
