/* =============================================
   NSRP - Advanced Responsive & Modern Design
   ============================================= */

/* Enhanced CSS Variables for Modern Design */
:root {
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --neon-blue: #00d4ff;
    --neon-purple: #b24bf3;
    --neon-green: #00ff88;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-danger: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    --gradient-warning: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Glassmorphism Effects */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
}

.glass-card {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
}

.glass-card:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Modern Button Styles */
.btn-modern {
    position: relative;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-modern::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 ease;
}

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

.btn-glow {
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
}

.btn-glow:hover {
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.6);
}

/* Animated Gradient Background for Important Elements */
.gradient-animated {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Neon Glow Effects */
.neon-text {
    text-shadow: 0 0 10px var(--neon-blue), 0 0 20px var(--neon-blue), 0 0 30px var(--neon-blue);
}

.neon-border {
    box-shadow: 0 0 5px var(--neon-blue), 0 0 10px var(--neon-blue), inset 0 0 5px var(--neon-blue);
}

/* Enhanced Card Hover Effects */
.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.card-3d:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(-5deg) translateZ(10px);
}

/* Pulse Animation for Critical Elements */
.pulse-critical {
    animation: pulseCritical 1.5s ease-in-out infinite;
}

@keyframes pulseCritical {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    50% { box-shadow: 0 0 0 15px rgba(239, 68, 68, 0); }
}

/* Shimmer Loading Effect */
.shimmer {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-card) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* =============================================
   RESPONSIVE BREAKPOINTS
   ============================================= */

/* Extra Large Screens (1400px+) */
@media (min-width: 1400px) {
    .main-content {
        max-width: 1600px;
        margin: 0 auto;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .scenarios-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Large Screens (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .scenarios-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Medium-Large Screens (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .header-center h1 {
        font-size: 1.1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.75rem;
    }

    .scenarios-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .simulation-body {
        grid-template-columns: 1fr 1fr;
    }
}

/* Tablets (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .header {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
    }

    .header-center {
        order: 3;
        width: 100%;
        text-align: center;
        margin-top: 0.5rem;
    }

    .header-center h1 {
        font-size: 1rem;
    }

    .main-nav {
        justify-content: center;
        flex-wrap: wrap;
    }

    .nav-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .nav-btn span {
        display: inline;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .scenarios-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .simulation-body {
        grid-template-columns: 1fr;
    }

    .reports-grid {
        grid-template-columns: 1fr;
    }

    .report-card.large {
        grid-column: span 1;
    }

    .resources-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .training-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .world-map-wrapper {
        flex-direction: column;
    }

    .map-legend-panel,
    .realtime-stats-panel,
    .crisis-timeline-panel {
        position: static !important;
        width: 100% !important;
        margin-bottom: 1rem;
    }
}

/* Small Tablets / Large Phones (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .header {
        padding: 0.5rem 0.75rem;
    }

    .logo-title {
        font-size: 1.2rem;
    }

    .logo-subtitle {
        font-size: 0.65rem;
    }

    .logo i {
        font-size: 2rem;
    }

    .header-center {
        display: none;
    }

    .header-right {
        gap: 0.5rem;
    }

    .status-indicator {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }

    .status-indicator span:not(.status-dot) {
        display: none;
    }

    .datetime {
        font-size: 0.75rem;
    }

    .user-info {
        padding: 0.4rem 0.6rem;
    }

    .user-info #user-name {
        display: none;
    }

    .main-nav {
        padding: 0.25rem 0.5rem;
        gap: 0.25rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-btn {
        padding: 0.5rem 0.75rem;
        min-width: auto;
    }

    .nav-btn span {
        display: none;
    }

    .main-content {
        padding: 0.75rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .section-header h2 {
        font-size: 1.2rem;
    }

    .filter-controls {
        width: 100%;
        flex-wrap: wrap;
    }

    .filter-select {
        flex: 1;
        min-width: 120px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .stat-card {
        padding: 0.75rem;
    }

    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .stat-trend {
        display: none;
    }

    .scenarios-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .scenario-card {
        margin-bottom: 0.5rem;
    }

    .training-grid {
        grid-template-columns: 1fr;
    }

    .resources-grid {
        grid-template-columns: 1fr;
    }

    .footer {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        padding: 0.75rem 1rem;
    }

    .footer-center {
        display: none;
    }
}

/* Mobile Phones (max-width: 575px) */
@media (max-width: 575px) {
    html {
        font-size: 14px;
    }

    body {
        overflow-x: hidden;
    }

    .header {
        padding: 0.5rem;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .header-left {
        flex: 1;
    }

    .logo {
        gap: 0.5rem;
    }

    .logo i {
        font-size: 1.75rem;
    }

    .logo-title {
        font-size: 1.1rem;
        letter-spacing: 2px;
    }

    .logo-subtitle {
        display: none;
    }

    .header-center {
        display: none;
    }

    .header-right {
        gap: 0.25rem;
    }

    .status-indicator {
        padding: 0.3rem 0.5rem;
    }

    .status-indicator span:not(.status-dot) {
        display: none;
    }

    .datetime {
        display: none;
    }

    .user-info {
        padding: 0.3rem 0.5rem;
    }

    .user-info #user-name,
    .user-info #user-role-badge,
    .user-info .fa-chevron-down {
        display: none;
    }

    .user-dropdown {
        right: 0;
        min-width: 200px;
    }

    /* Mobile Navigation */
    .main-nav {
        padding: 0.25rem;
        gap: 0.15rem;
        justify-content: space-between;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border-color);
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .main-nav::-webkit-scrollbar {
        display: none;
    }

    .nav-btn {
        flex: 1;
        padding: 0.6rem 0.3rem;
        justify-content: center;
        min-width: 50px;
        border-radius: var(--radius-sm);
    }

    .nav-btn span {
        display: none;
    }

    .nav-btn i {
        font-size: 1.1rem;
    }

    .nav-btn.active {
        background: var(--primary-light);
    }

    /* Mobile Content */
    .main-content {
        padding: 0.5rem;
        min-height: calc(100vh - 140px);
    }

    .section-header {
        margin-bottom: 0.75rem;
    }

    .section-header h2 {
        font-size: 1.1rem;
        gap: 0.5rem;
    }

    .section-header h2 i {
        font-size: 1rem;
    }

    .threat-level {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        font-size: 0.8rem;
    }

    .threat-badge {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }

    /* Mobile Stats Grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }

    .stat-card {
        padding: 0.6rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .stat-card.clickable {
        cursor: pointer;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        margin: 0 auto;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .stat-label {
        font-size: 0.7rem;
        line-height: 1.2;
    }

    .stat-trend {
        display: none;
    }

    /* Mobile Dashboard Grid */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .dashboard-card {
        border-radius: var(--radius-md);
    }

    .card-header {
        padding: 0.75rem;
    }

    .card-header h3 {
        font-size: 0.9rem;
    }

    .alerts-list {
        padding: 0.5rem;
        max-height: 200px;
    }

    .alert-item {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .alert-icon {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .alert-title {
        font-size: 0.8rem;
    }

    .alert-meta {
        font-size: 0.7rem;
    }

    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
        padding: 0.5rem;
    }

    .action-btn {
        padding: 0.75rem 0.5rem;
    }

    .action-btn i {
        font-size: 1.2rem;
    }

    .action-btn span {
        font-size: 0.7rem;
    }

    /* Mobile Scenarios */
    .scenarios-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .scenario-card {
        border-radius: var(--radius-md);
    }

    .scenario-header {
        padding: 0.75rem;
    }

    .scenario-category {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }

    .scenario-title {
        font-size: 0.95rem;
    }

    .scenario-meta {
        font-size: 0.7rem;
        gap: 0.5rem;
    }

    .scenario-body {
        padding: 0.75rem;
    }

    .scenario-description {
        font-size: 0.8rem;
        line-height: 1.5;
    }

    .scenario-tags {
        gap: 0.3rem;
    }

    .tag {
        font-size: 0.65rem;
        padding: 0.15rem 0.4rem;
    }

    .scenario-footer {
        padding: 0.6rem 0.75rem;
    }

    .difficulty-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }

    .btn-primary, .btn-secondary, .btn-danger {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    /* Mobile Simulation */
    .simulation-placeholder {
        min-height: 300px;
        padding: 1rem;
    }

    .placeholder-content i {
        font-size: 3rem;
    }

    .placeholder-content h3 {
        font-size: 1.1rem;
    }

    .placeholder-content p {
        font-size: 0.85rem;
    }

    .simulation-header {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .scenario-info h3 {
        font-size: 1rem;
    }

    .simulation-controls {
        width: 100%;
        justify-content: space-between;
        gap: 0.5rem;
    }

    .timer, .score {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }

    .simulation-body {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .panel-header {
        padding: 0.5rem 0.75rem;
    }

    .panel-header h4 {
        font-size: 0.85rem;
    }

    .situation-content {
        padding: 0.75rem;
        font-size: 0.85rem;
        max-height: 150px;
    }

    .decisions-list {
        padding: 0.5rem;
        max-height: 200px;
    }

    .decision-option {
        padding: 0.75rem;
    }

    .decision-title {
        font-size: 0.9rem;
    }

    .decision-desc {
        font-size: 0.75rem;
    }

    .resources-list {
        padding: 0.5rem;
    }

    .resource-item {
        padding: 0.5rem;
    }

    .comm-log {
        height: 120px;
        padding: 0.5rem;
    }

    .simulation-progress {
        padding: 0.5rem 0.75rem;
    }

    /* Mobile World Map */
    .world-map-container {
        padding: 0;
    }

    .map-controls {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .map-controls select {
        flex: 1;
        min-width: 100px;
        font-size: 0.8rem;
    }

    .map-control-buttons {
        width: 100%;
        justify-content: space-between;
    }

    #leaflet-map {
        height: 300px !important;
    }

    .map-legend-panel,
    .realtime-stats-panel,
    .crisis-timeline-panel,
    .crisis-details-panel {
        position: static !important;
        width: 100% !important;
        margin-top: 0.5rem;
    }

    .realtime-stats {
        flex-wrap: wrap;
    }

    .realtime-stat {
        flex: 1;
        min-width: 80px;
    }

    .data-sources-panel,
    .actors-panel {
        margin-top: 0.5rem;
    }

    /* Mobile Reports */
    .performance-overview {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .overview-card {
        padding: 0.75rem;
    }

    .overview-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .overview-value {
        font-size: 1.2rem;
    }

    .overview-label {
        font-size: 0.7rem;
    }

    .reports-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .report-card {
        padding: 1rem;
    }

    .chart-container {
        height: 200px;
    }

    /* Mobile Training */
    .training-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .training-card {
        padding: 1rem;
    }

    .training-icon {
        width: 50px;
        height: 50px;
    }

    .training-icon i {
        font-size: 1.4rem;
    }

    /* Mobile Resources */
    .resources-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .resource-category {
        margin-bottom: 0.5rem;
    }

    .resource-list li {
        padding: 0.5rem;
    }

    .resource-list.contacts li {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    /* Mobile Admin */
    .admin-tabs {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .admin-tab {
        flex: 1;
        min-width: 80px;
        padding: 0.5rem;
        font-size: 0.75rem;
    }

    .admin-toolbar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .admin-table-container {
        overflow-x: auto;
    }

    .admin-table {
        font-size: 0.75rem;
        min-width: 600px;
    }

    /* Mobile Footer */
    .footer {
        padding: 0.5rem;
        flex-direction: column;
        gap: 0.25rem;
    }

    .footer-left span,
    .footer-right span {
        font-size: 0.7rem;
    }

    .footer-center {
        display: none;
    }

    /* Mobile Modal */
    .modal {
        width: 95%;
        max-height: 85vh;
        margin: 0.5rem;
    }

    .modal-header {
        padding: 0.75rem 1rem;
    }

    .modal-header h3 {
        font-size: 1rem;
    }

    .modal-body {
        padding: 1rem;
        max-height: 50vh;
    }

    .modal-footer {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Mobile Login */
    .login-container {
        width: 95%;
        padding: 1.5rem;
    }

    .login-header i {
        font-size: 2.5rem;
    }

    .login-header h1 {
        font-size: 1.5rem;
    }

    .login-form .form-group {
        margin-bottom: 0.75rem;
    }

    .login-form input,
    .login-form select {
        padding: 0.6rem 0.75rem;
        font-size: 0.9rem;
    }

    .btn-login {
        padding: 0.75rem;
        font-size: 0.95rem;
    }

    /* Mobile Notifications */
    .notification-container {
        top: auto;
        bottom: 10px;
        right: 10px;
        left: 10px;
    }

    .notification {
        min-width: auto;
        max-width: none;
        width: 100%;
    }
}

/* Extra Small Phones (max-width: 375px) */
@media (max-width: 375px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.3rem;
    }

    .stat-card {
        padding: 0.5rem;
    }

    .stat-icon {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .nav-btn {
        padding: 0.5rem 0.2rem;
        min-width: 40px;
    }

    .quick-actions {
        grid-template-columns: 1fr 1fr;
    }

    .action-btn span {
        font-size: 0.65rem;
    }
}

/* Landscape Mode Adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        padding: 0.25rem 0.5rem;
    }

    .main-nav {
        padding: 0.15rem 0.5rem;
    }

    .nav-btn {
        padding: 0.4rem 0.6rem;
    }

    .main-content {
        padding: 0.5rem;
    }

    .simulation-placeholder {
        min-height: 200px;
    }

    .modal {
        max-height: 95vh;
    }
}

/* Print Adjustments */
@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }

    .header, .main-nav, .footer,
    .modal-container, .notification-container,
    .btn-primary, .btn-secondary, .btn-danger {
        display: none !important;
    }

    .main-content {
        padding: 0;
    }

    .section {
        display: block !important;
        page-break-after: always;
    }
}

/* Touch-friendly Adjustments */
@media (hover: none) and (pointer: coarse) {
    .btn-primary, .btn-secondary, .btn-danger,
    .nav-btn, .action-btn, .scenario-card,
    .decision-option, .filter-select {
        min-height: 44px;
    }

    .stat-card:hover,
    .scenario-card:hover,
    .training-card:hover {
        transform: none;
    }

    /* Remove hover effects on touch devices */
    .card-3d:hover {
        transform: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --bg-primary: #000;
        --bg-secondary: #111;
        --bg-tertiary: #222;
        --text-primary: #fff;
        --border-color: #555;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark Mode (already default, but explicit) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0a0e1a;
        --bg-secondary: #111827;
        --text-primary: #f8fafc;
    }
}
