/* Advanced Dashboard Styles for SentraFlow Maritime Intelligence Platform */

/* Color Palette */
:root {
    --primary-blue: #1e3c72;
    --secondary-blue: #2a5298;
    --accent-blue: #3b82f6;
    --ocean-blue: #0ea5e9;
    --dark-blue: #1e293b;
    --light-blue: #e0f2fe;
    --success-green: #10b981;
    --warning-yellow: #f59e0b;
    --danger-red: #ef4444;
    --gray-light: #f8fafc;
    --gray-medium: #64748b;
    --gray-dark: #334155;
    --white: #ffffff;
}

/* Main Layout */
.dashboard-container {
    background: linear-gradient(135deg, var(--light-blue) 0%, var(--white) 100%);
    min-height: 100vh;
    padding: 2rem 0;
}

/* Card Enhancements */
.dashboard-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(30, 60, 114, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(30, 60, 114, 0.15);
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-blue), var(--ocean-blue));
}

/* Metric Cards */
.metric-card {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    color: var(--white);
    border-radius: 16px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 60, 114, 0.3);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translateX(-100%) translateY(-100%); }
    50% { transform: translateX(-50%) translateY(-50%); }
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.metric-label {
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-icon {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    opacity: 0.3;
}

/* Status Indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-operational {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-yellow);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-critical {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Data Visualization Enhancements */
.chart-container {
    position: relative;
    height: 300px;
    margin: 1rem 0;
    background: var(--gray-light);
    border-radius: 12px;
    padding: 1rem;
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-blue);
    margin-bottom: 1rem;
    text-align: center;
}

/* Interactive Elements */
.interactive-map {
    background: var(--light-blue);
    border-radius: 12px;
    height: 400px;
    position: relative;
    overflow: hidden;
    border: 2px solid var(--ocean-blue);
}

.map-legend {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.95);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.vessel-marker {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--ocean-blue);
    border-radius: 50%;
    border: 3px solid var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.vessel-marker:hover {
    transform: scale(1.2);
    background: var(--danger-red);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(14, 165, 233, 0); }
    100% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0); }
}

/* Data Tables */
.data-table {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.data-table th {
    background: var(--primary-blue);
    color: var(--white);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem;
    border: none;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-light);
    vertical-align: middle;
}

.data-table tr:hover {
    background: var(--light-blue);
}

/* Progress Bars */
.progress-container {
    background: var(--gray-light);
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 0.8s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer-progress 2s infinite;
}

@keyframes shimmer-progress {
    0% { left: -100%; }
    100% { left: 100%; }
}

.progress-excellent {
    background: linear-gradient(90deg, var(--success-green), #34d399);
}

.progress-good {
    background: linear-gradient(90deg, var(--ocean-blue), #38bdf8);
}

.progress-warning {
    background: linear-gradient(90deg, var(--warning-yellow), #fbbf24);
}

.progress-poor {
    background: linear-gradient(90deg, var(--danger-red), #f87171);
}

/* Alert Panels */
.alert-panel {
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid;
    position: relative;
    overflow: hidden;
}

.alert-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: alert-shine 3s infinite;
}

@keyframes alert-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.alert-critical {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
    border-left-color: var(--danger-red);
    color: var(--danger-red);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
    border-left-color: var(--warning-yellow);
    color: var(--warning-yellow);
}

.alert-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
    border-left-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* Buttons */
.btn-maritime {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    border: none;
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-maritime:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(30, 60, 114, 0.3);
    color: var(--white);
}

.btn-maritime::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-maritime:hover::before {
    left: 100%;
}

/* Loading States */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    z-index: 10;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--light-blue);
    border-top: 4px solid var(--ocean-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 1rem 0;
    }
    
    .metric-card {
        padding: 1.5rem;
    }
    
    .metric-value {
        font-size: 2rem;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .interactive-map {
        height: 300px;
    }
}

@media (max-width: 576px) {
    .metric-card {
        padding: 1rem;
    }
    
    .metric-value {
        font-size: 1.8rem;
    }
    
    .chart-container {
        height: 200px;
    }
    
    .interactive-map {
        height: 250px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --white: #1e293b;
        --gray-light: #334155;
        --gray-dark: #f8fafc;
        --dark-blue: #e2e8f0;
    }
    
    .dashboard-container {
        background: linear-gradient(135deg, var(--dark-blue) 0%, var(--gray-light) 100%);
    }
    
    .dashboard-card {
        background: var(--white);
        border: 1px solid rgba(59, 130, 246, 0.2);
    }
    
    .data-table td {
        border-bottom: 1px solid var(--gray-light);
    }
    
    .data-table tr:hover {
        background: rgba(59, 130, 246, 0.1);
    }
}

/* Simplified Metric Cards */
.simple-metric {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    height: 100%;
}

.simple-metric:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.metric-content {
    text-align: center;
}

.metric-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.metric-header .metric-icon {
    font-size: 1.5rem;
    color: var(--primary-blue);
}

.metric-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.simple-metric .metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.metric-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Summary Items */
.summary-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    background: #f8f9fa;
}

.summary-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.summary-content h6 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.summary-content p {
    margin: 0;
    font-size: 0.9rem;
}

/* Vessel Cards */
.vessel-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    height: 100%;
}

.vessel-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.vessel-header {
    margin-bottom: 1rem;
}

.vessel-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.vessel-type {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.vessel-status {
    margin-bottom: 1rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-good {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.status-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.status-critical {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.vessel-details {
    margin-bottom: 1rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.detail-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.detail-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 600;
}

.vessel-actions {
    text-align: center;
}

/* Activity Items */
.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.activity-content small {
    font-size: 0.8rem;
}

/* Maritime-specific animations */
@keyframes wave {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.wave-animation {
    animation: wave 2s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* Tooltip Enhancements */
.tooltip-maritime {
    background: var(--dark-blue);
    color: var(--white);
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.85rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--ocean-blue);
}

.tooltip-maritime::before {
    border-color: var(--dark-blue) transparent transparent transparent;
}

/* Accessibility Improvements */
.focus-visible {
    outline: 2px solid var(--ocean-blue);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Print Styles */
@media print {
    .dashboard-container {
        background: white;
    }
    
    .dashboard-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .metric-card {
        background: white;
        color: black;
        border: 1px solid #ccc;
    }
    
    .btn-maritime {
        display: none;
    }
}