/**
 * Kocaeli 112 - Emergency Management System
 * Professional & Official Dashboard Styles
 * Classic, Formal Design
 */

/* ========== RESET & BASE ========== */
* {
    box-sizing: border-box;
}

.em-admin-wrapper {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
}

/* ========== LOGIN PAGE ========== */
.em-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a2e;
    background-image: 
        linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: 20px;
    position: relative;
}

.em-login-box {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

.em-login-logo-section {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
    padding: 40px 30px;
    text-align: center;
    border-bottom: 3px solid #e94560;
}

.em-logo-icon {
    background: rgba(255, 255, 255, 0.15);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.em-logo-icon .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
    color: #fff;
}

.em-main-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.em-sub-title {
    font-size: 14px;
    font-weight: 400;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.em-login-form-section {
    padding: 35px 30px;
    background: #ffffff;
}

.em-input-group {
    position: relative;
    margin-bottom: 20px;
}

.em-input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 18px;
    z-index: 1;
}

.em-input-group input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
    background: #fafafa;
}

.em-input-group input:focus {
    outline: none;
    border-color: #0f3460;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(15, 52, 96, 0.1);
}

.em-login-button {
    width: 100%;
    padding: 14px;
    background: #0f3460;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.em-login-button:hover {
    background: #16213e;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 52, 96, 0.3);
}

.em-login-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
    margin-top: 20px;
    color: #666;
    font-size: 12px;
}

/* ========== DASHBOARD ========== */
.em-dashboard-container {
    background: #f5f5f5;
    min-height: 100vh;
}

/* Top Bar */
.em-top-bar {
    background: #ffffff;
    border-bottom: 2px solid #0f3460;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.em-top-bar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.em-logo-small {
    background: #0f3460;
    width: 50px;
    height: 50px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.em-logo-small .dashicons {
    color: #fff;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.em-title-section h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: 0.3px;
}

.em-realtime {
    margin: 4px 0 0 0;
    font-size: 12px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
}

.em-pulse-dot {
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.em-top-bar-right {
    display: flex;
    gap: 10px;
}

.em-action-btn {
    padding: 8px 14px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #333;
    text-decoration: none;
}

.em-action-btn:hover {
    background: #f8f9fa;
    border-color: #0f3460;
    color: #0f3460;
}

.em-btn-refresh:hover {
    background: #e3f2fd;
}

.em-btn-logout {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

.em-btn-logout:hover {
    background: #c82333;
    border-color: #bd2130;
}

/* Statistics Cards */
.em-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px;
}

.em-stat-box {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 18px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    position: relative;
    border-left: 4px solid #0f3460;
}

.em-stat-box:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.em-clickable-card {
    cursor: pointer;
}

.em-clickable-card:hover {
    border-left-color: #e94560;
}

.em-stat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.em-stat-header .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #0f3460;
}

.em-stat-title {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.em-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1;
}

.em-stat-emergency {
    border-left-color: #dc3545;
}

.em-stat-emergency .em-stat-header .dashicons {
    color: #dc3545;
}

.em-stat-emergency .em-stat-value {
    color: #dc3545;
}

.em-stat-active {
    border-left-color: #17a2b8;
}

.em-stat-active .em-stat-header .dashicons {
    color: #17a2b8;
}

.em-stat-ready {
    border-left-color: #28a745;
}

.em-stat-ready .em-stat-header .dashicons {
    color: #28a745;
}

/* Main Content Grid */
.em-main-content-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 15px;
    padding: 0 20px 20px;
}

/* Panels */
.em-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

/* Activity Panel */
.em-activity-panel {
    display: flex;
    flex-direction: column;
}

.em-activity-body {
    padding: 0;
    max-height: 450px;
    overflow-y: auto;
}

.em-activity-feed {
    padding: 12px;
}

.em-activity-item {
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    transition: background 0.2s;
}

.em-activity-item:hover {
    background: #f8f9fa;
}

.em-activity-item:last-child {
    border-bottom: none;
}

.em-activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.em-activity-icon.emergency {
    background: #fee;
    color: #dc3545;
}

.em-activity-icon.ready {
    background: #e8f5e9;
    color: #28a745;
}

.em-activity-icon.safe {
    background: #fff3cd;
    color: #ffc107;
}

.em-activity-content {
    flex: 1;
    min-width: 0;
}

.em-activity-name {
    font-weight: 600;
    color: #1a1a2e;
    font-size: 13px;
    margin-bottom: 3px;
    line-height: 1.3;
}

.em-activity-status {
    font-size: 11px;
    color: #666;
    margin-bottom: 3px;
    line-height: 1.3;
}

.em-activity-time {
    font-size: 10px;
    color: #999;
    line-height: 1.3;
}

.em-panel {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.em-panel-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.em-panel-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 6px;
}

.em-panel-header .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #0f3460;
}

.em-panel-actions {
    display: flex;
    gap: 6px;
}

.em-panel-body {
    padding: 15px;
}

.em-badge {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.em-badge-info {
    background: #e3f2fd;
    color: #1976d2;
}

.em-badge-success {
    background: #e8f5e9;
    color: #388e3c;
}

/* Charts */
.em-panel-body canvas {
    max-height: 220px;
}

/* Map */
.em-map-panel {
    grid-column: 1 / -1;
    margin: 0 20px 20px;
}

.em-map-body {
    padding: 0;
}

#em-map-container {
    width: 100%;
    height: 500px;
    border-radius: 0 0 6px 6px;
}

/* Table */
.em-table-body {
    padding: 0;
}

.em-table-responsive {
    overflow-x: auto;
}

.em-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.em-data-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #0f3460;
}

.em-data-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #1a1a2e;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.em-data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    color: #333;
}

.em-data-table tbody tr:hover {
    background: #f8f9fa;
}

.em-loading {
    text-align: center;
    padding: 40px !important;
    color: #666;
}

.em-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e0e0e0;
    border-top-color: #0f3460;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Buttons */
.em-btn-primary {
    background: #0f3460;
    color: #fff;
    border-color: #0f3460;
}

.em-btn-primary:hover {
    background: #16213e;
    border-color: #16213e;
}

.em-btn-secondary {
    background: #6c757d;
    color: #fff;
    border-color: #6c757d;
}

.em-btn-success {
    background: #28a745;
    color: #fff;
    border-color: #28a745;
}

.em-btn-block {
    width: 100%;
    justify-content: center;
}

/* Modal */
.em-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.em-modal-dialog {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.em-modal-small {
    max-width: 500px;
}

.em-modal-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.em-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.em-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.em-modal-close:hover {
    background: #e0e0e0;
}

.em-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Form */
.em-form-field {
    margin-bottom: 20px;
}

.em-form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.em-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}

.em-select:focus {
    outline: none;
    border-color: #0f3460;
    box-shadow: 0 0 0 3px rgba(15, 52, 96, 0.1);
}

.em-staff-name {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    margin: 0;
    font-weight: 600;
    color: #1a1a2e;
}

/* Responsive */
@media (max-width: 1200px) {
    .em-main-content-grid {
        grid-template-columns: 1fr;
    }
    
    .em-activity-panel {
        order: -1;
    }
}

@media (max-width: 768px) {
    .em-stats-grid {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    .em-content-grid {
        grid-template-columns: 1fr;
    }
    
    .em-main-content-grid {
        padding: 0 20px 20px;
    }
    
    .em-top-bar {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .em-top-bar-right {
        width: 100%;
        justify-content: flex-end;
    }
}

