/**
 * E-kajet Enterprise Dashboard Modal Styles
 * File: dashboard-modal.css
 * Version: 2.0 - includes dashboard content styles
 */

/* ============================================ */
/* MODAL CONTAINER & BACKDROP */
/* ============================================ */

.dashboard-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
}

.dashboard-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================ */
/* MODAL CONTENT */
/* ============================================ */

.dashboard-modal-content {
    position: relative;
    width: 100%;
    max-width: 1400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.4s ease;
    max-height: 95vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from { 
        transform: translateY(50px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================ */
/* CLOSE BUTTON */
/* ============================================ */

.dashboard-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px; /* Zwiększone z 40px */
    height: 50px; /* Zwiększone z 40px */
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(26, 58, 82, 0.1); /* Dodany border */
    border-radius: 50%;
    cursor: pointer;
    font-size: 28px; /* Zwiększone z 24px */
    line-height: 1;
    color: #1a3a52; /* Ciemniejszy kolor */
    z-index: 1000;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-modal-close:hover {
    background: white;
    color: #ff6b6b; /* Czerwony hover */
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    border-color: #ff6b6b;
}

/* ============================================ */
/* CTA BAR (sticky bottom) */
/* ============================================ */

.dashboard-cta-bar {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a3a52 0%, #2d5a7b 100%);
    padding: 20px;
    text-align: center;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
}

.dashboard-cta-bar p {
    color: white;
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 500;
}

.dashboard-cta-bar button {
    background: #2dd4a3;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.dashboard-cta-bar button:hover {
    background: #25b88d;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 212, 163, 0.3);
}

/* ============================================ */
/* PREVENT BODY SCROLL WHEN MODAL OPEN */
/* ============================================ */

body.modal-open {
    overflow: hidden;
}

/* ============================================ */
/* DASHBOARD CONTENT STYLES */
/* ============================================ */

.dashboard-container {
    background: white;
}

.dashboard-header {
    background: linear-gradient(135deg, #1a3a52 0%, #2d5a7b 100%);
    color: white;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-header h1 {
    font-size: 28px;
    font-weight: 600;
    margin: 0;
}

.dashboard-header .subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 5px;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.15);
    padding: 10px 18px; /* Zwiększony padding */
    border-radius: 24px;
    margin-right: 80px; /* DODANE - odstęp od przycisku X */
}

.live-dot {
    width: 10px; /* Zwiększone z 8px */
    height: 10px; /* Zwiększone z 8px */
    background: #2dd4a3;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(45, 212, 163, 0.6); /* Dodany glow */
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.6; 
        transform: scale(1.2);
    }
}

.dashboard-body {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 0;
    min-height: 600px;
    width: 100%;
}

.sidebar {
    background: #f8f9fa;
    padding: 30px;
    border-right: 1px solid #e0e0e0;
}

.main-content {
    padding: 30px 20px;
    width: 100%; 
    min-width: 0;
}

/* Stats Cards */
.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
    box-sizing: border-box;
}

.stat-card {
    background: white;
    padding: 20px 16px; /* Zwiększony padding */
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s;
    min-height: 140px; /* Minimalna wysokość dla wszystkich */
    min-width: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.stat-label {
    font-size: 10px; /* Zmniejszony żeby się mieścił */
    text-transform: uppercase;
    color: #666;
    letter-spacing: 0.5px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 12px;
}

.stat-value {
    font-size: 36px; /* Większy dla lepszej czytelności */
    font-weight: 700;
    color: #1a3a52;
    line-height: 1;
    margin: 8px 0;
}

.stat-change {
    font-size: 11px; /* Zmniejszony */
    color: #2dd4a3;
    font-weight: 500;
    line-height: 1.4;
    margin-top: 8px;
}

.stat-change::before {
    content: '↑ ';
    font-weight: 700;
}

/* Responsive - mobile */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr; /* 1 kolumna na mobile */
    }
}

.locations-section h3 {
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
}

.location-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.location-item:hover {
    border-color: #2dd4a3;
    background: #f0fdf9;
}

.location-item.active {
    border-color: #2dd4a3;
    background: #f0fdf9;
}

.location-name {
    font-weight: 600;
    color: #1a3a52;
    margin-bottom: 5px;
}

.location-stats {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
}

/* Map Section */
.map-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    position: relative;
    height: 400px;
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.map-header h2 {
    font-size: 18px;
    color: #1a3a52;
    margin: 0;
}

.map-controls {
    display: flex;
    gap: 10px;
}

.map-controls button {
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    background: white;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.map-controls button:hover {
    background: #f0fdf9;
    border-color: #2dd4a3;
}

.map-controls button.active {
    background: #2dd4a3;
    color: white;
    border-color: #2dd4a3;
}

.map-container {
    position: relative;
    width: 100%;
    height: 320px;
    /* Ciemniejsze tło z gradientem */
    background: 
        radial-gradient(ellipse at center, rgba(26, 58, 82, 0.08) 0%, transparent 70%),
        linear-gradient(135deg, #d4e3f0 0%, #e8eef3 100%);
    border-radius: 8px;
    overflow: hidden;
    /* Wyraźny border */
    border: 3px solid rgba(26, 58, 82, 0.15);
    box-shadow: 
        inset 0 0 50px rgba(26, 58, 82, 0.05),
        0 4px 12px rgba(0,0,0,0.08);
}

.map-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
}

/* Poland Map Markers */
.marker {
    position: absolute;
    width: 24px;
    height: 24px;
    background: #2dd4a3;
    border: 3px solid white;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    animation: markerPop 0.5s ease-out;
}

@keyframes markerPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.marker:hover {
    transform: scale(1.3);
    box-shadow: 0 4px 12px rgba(45, 212, 163, 0.4);
    z-index: 10;
}

.marker.high { background: #2dd4a3; }
.marker.medium { background: #ffd93d; }
.marker.low { background: #ff6b6b; }

/* Tooltip */
.marker-tooltip {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 8px 12px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    white-space: nowrap;
    font-size: 12px;
    display: none;
    z-index: 100;
}

.marker:hover .marker-tooltip {
    display: block;
}

/* Chart Section */
.chart-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #e0e0e0;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header h2 {
    font-size: 18px;
    color: #1a3a52;
    margin: 0;
}

.chart-legend {
    display: flex;
    gap: 20px;
    font-size: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.chart-container {
    height: 200px;
    position: relative;
}

.chart-canvas {
    width: 100%;
    height: 100%;
}

/* ============================================ */
/* RESPONSIVE - MOBILE */
/* ============================================ */

@media (max-width: 768px) {
    .dashboard-modal {
        padding: 0;
    }
    
    .dashboard-modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .dashboard-modal-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
    
    .dashboard-cta-bar {
        border-radius: 0;
        padding: 15px;
    }
    
    .dashboard-cta-bar p {
        font-size: 14px;
    }
    
    .dashboard-cta-bar button {
        padding: 12px 24px;
        font-size: 14px;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .dashboard-body {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .map-controls {
        flex-wrap: wrap;
    }
}


/* ============================================ */
/* RESPONSIVE - TABLET */
/* ============================================ */

@media (max-width: 1024px) {
    .dashboard-modal {
        padding: 10px;
    }
    
    .dashboard-modal-content {
        max-width: 95%;
    }
    
}