/* R.A.P.I.D. Custom Styles */

/* Fix dropdown menus being cut off in tables */
.table-responsive {
    overflow: visible;
}

/* Ensure dropdowns have proper z-index */
.dropdown-menu {
    z-index: 1050;
}
:root {
    --rapid-primary: #4F46E5;
    --rapid-secondary: #7C3AED;
    --rapid-gradient: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    --rapid-light: #EEF2FF;
    --rapid-dark: #1E1B4B;
    --rapid-success: #10B981;
    --rapid-warning: #F59E0B;
    --rapid-danger: #EF4444;
    --rapid-info: #3B82F6;
}

/* Global Styles */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #F8FAFC;
    color: #1E293B;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    display: block;
    visibility: visible;
    position: relative;
    z-index: 1;
}

/* Header & Navigation */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    background: var(--rapid-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar {
    background: white;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid #E2E8F0;
}

.nav-link {
    color: #64748B !important;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--rapid-primary) !important;
}

/* Hero Section */
.hero-section {
    background: var(--brand-gradient, linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%)) !important;
    color: white !important;
    padding: 4rem 0 !important;
    position: relative !important;
    overflow: hidden !important;
    min-height: 500px !important;
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.1;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

/* Disaster Type Grid */
.disaster-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.disaster-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.disaster-card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.disaster-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

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

.card-header {
    background: var(--rapid-light);
    border-bottom: 1px solid #E2E8F0;
    font-weight: 600;
    color: var(--rapid-dark);
}

/* Buttons */
.btn-primary {
    background: var(--rapid-gradient);
    border: none;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.btn-outline-primary {
    border-color: var(--rapid-primary);
    color: var(--rapid-primary);
    font-weight: 600;
    border-width: 2px;
}

.btn-outline-primary:hover {
    background: var(--rapid-primary);
    border-color: var(--rapid-primary);
    color: white;
}

/* Card header buttons - ensure proper visibility */
.card-header .btn-outline-primary {
    border-color: var(--rapid-primary) !important;
    color: var(--rapid-primary) !important;
    background-color: transparent !important;
    border-width: 2px !important;
    font-weight: 600 !important;
}

.card-header .btn-outline-primary:hover {
    background-color: var(--rapid-primary) !important;
    border-color: var(--rapid-primary) !important;
    color: white !important;
}

/* Dashboard Styles */
.dashboard-header {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    border-left: 4px solid var(--rapid-primary);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

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

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--rapid-primary);
    display: block;
}

.stat-label {
    color: #64748B;
    font-weight: 500;
    margin-top: 0.5rem;
}

/* Forms */
.form-control {
    border-radius: 8px;
    border: 1px solid #D1D5DB;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--rapid-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

/* Tables */
.table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.table thead th {
    background: var(--rapid-light);
    border: none;
    font-weight: 600;
    color: var(--rapid-dark);
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    border-color: #F1F5F9;
}

.table tbody tr:hover {
    background-color: #F8FAFC;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

/* Status badges with custom colors */
.badge.bg-success {
    background-color: var(--rapid-success) !important;
}

.badge.bg-warning {
    background-color: var(--rapid-warning) !important;
    color: white;
}

.badge.bg-danger {
    background-color: var(--rapid-danger) !important;
}

.badge.bg-info {
    background-color: var(--rapid-info) !important;
}

/* Sidebar */
.sidebar {
    background: white;
    min-height: calc(100vh - 76px);
    border-right: 1px solid #E2E8F0;
    padding: 1.5rem 0;
}

.sidebar .nav-link {
    color: #64748B;
    padding: 0.75rem 1.5rem;
    margin: 0.25rem 0;
    border-radius: 0 25px 25px 0;
    margin-right: 1rem;
    transition: all 0.2s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: var(--rapid-gradient);
    color: white;
}

.sidebar .nav-link i {
    margin-right: 0.75rem;
    width: 20px;
}

/* Footer */
.footer {
    background: var(--brand-gradient, linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%)) !important;
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer a {
    color: rgba(255, 255, 255, 0.8) !important;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: white !important;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 8px;
    padding: 1rem 1.5rem;
}

.alert-success {
    background-color: #ECFDF5;
    color: #065F46;
    border-left: 4px solid var(--rapid-success);
}

.alert-danger {
    background-color: #FEF2F2;
    color: #991B1B;
    border-left: 4px solid var(--rapid-danger);
}

.alert-warning {
    background-color: #FFFBEB;
    color: #92400E;
    border-left: 4px solid var(--rapid-warning);
}

.alert-info {
    background-color: #EFF6FF;
    color: #1E40AF;
    border-left: 4px solid var(--rapid-info);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .disaster-grid {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none;
    }
}

/* Loading States */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* File Upload */
.file-upload-area {
    border: 2px dashed #D1D5DB;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: var(--rapid-primary);
    background-color: var(--rapid-light);
}

.file-upload-area.dragover {
    border-color: var(--rapid-primary);
    background-color: var(--rapid-light);
}

/* Multi-hazard indicator */
.multi-hazard-badge {
    background: var(--rapid-gradient);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #F1F5F9;
}

::-webkit-scrollbar-thumb {
    background: #CBD5E0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #A0AEC0;
}

/* Print styles */
@media print {
    .navbar, .sidebar, .footer {
        display: none !important;
    }
    
    .container-fluid {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* Milestone Timeline Styles */
.milestone-timeline {
    padding: 0;
}

.milestone-item {
    padding: 12px 0;
    border-bottom: 1px solid #E2E8F0;
}

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

.milestone-indicator {
    margin-top: 2px;
    min-width: 20px;
}

.milestone-content {
    margin-top: -2px;
}

.milestone-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 2px;
}

.milestone-deliverables {
    margin-top: 4px;
    font-style: italic;
}

.milestone-completed {
    margin-top: 4px;
}

/* Status-specific icon colors */
.milestone-item .fa-check-circle {
    color: #10B981 !important;
}

.milestone-item .fa-play-circle {
    color: #3B82F6 !important;
}

.milestone-item .fa-circle {
    color: #6B7280 !important;
}

.milestone-item .fa-minus-circle {
    color: #F59E0B !important;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .milestone-item .d-flex.align-items-center.justify-content-between {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .milestone-item .btn-group {
        margin-top: 4px;
    }
}
