/* StormHelpLine.com Custom Styles */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --storm-blue: #1e3a8a;
    --storm-yellow: #fbbf24;
    
    /* Light Theme Variables */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #e2e8f0;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e0;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --shadow-color: rgba(255, 255, 255, 0.1);
    
    /* Adjust brand colors for dark mode */
    --primary-color: #3b82f6;
    --storm-blue: #1d4ed8;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* CRITICAL FIX: Override body text color for certification cards */
section.bg-primary .stat-card.text-center .text-white,
section.bg-primary .bg-white.bg-opacity-10 .text-white,
.bg-primary .text-white {
    color: #ffffff !important;
}

/* Navigation Enhancements */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--storm-blue) 0%, var(--primary-color) 100%);
    min-height: 60vh;
    position: relative;
    color: white;
}

.hero::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"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
    pointer-events: none;
}

[data-theme="dark"] .hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

[data-theme="dark"] .hero::before {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.05)"/></svg>') repeat;
}

.min-vh-75 {
    min-height: 75vh;
}

/* Cards and Components */
.card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px var(--shadow-color);
}

.shadow-sm {
    box-shadow: 0 2px 4px var(--shadow-color);
}

.card-body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.card-header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.card-footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* Button Enhancements */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1.1rem;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), #4dabf7);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #0b5ed7, var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.3);
}

.btn-warning {
    background: linear-gradient(45deg, var(--warning-color), #ffed4a);
    border: none;
    color: #000;
}

.btn-warning:hover {
    background: linear-gradient(45deg, #ffca2c, var(--warning-color));
    color: #000;
    transform: translateY(-2px);
}

/* Form Controls */
.form-control, .form-select, .form-check-input {
    background-color: var(--bg-primary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-primary);
    border-color: var(--primary-color);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-label {
    color: var(--text-primary);
}

.form-text {
    color: var(--text-muted);
}

/* Fix certification section text visibility issues */
.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-primary .text-white, 
.bg-primary h1, 
.bg-primary h2, 
.bg-primary h3, 
.bg-primary h4, 
.bg-primary h5, 
.bg-primary h6,
.bg-primary p,
.bg-primary .lead {
    color: white !important;
}

/* FORCE certification cards to have white text - override any conflicting theme rules */
.bg-primary .bg-white.bg-opacity-10 h5,
.bg-primary .bg-white.bg-opacity-10 p,
.bg-primary .stat-card h5,
.bg-primary .stat-card p {
    color: white !important;
}

/* FORCE certification section header text to be white */
.bg-primary .text-center h2,
.bg-primary .text-center .lead,
.bg-primary .text-center p {
    color: white !important;
}

/* DON'T OVERRIDE EXISTING text-white CLASSES - Certification cards already have correct contrast */

/* COMPREHENSIVE TEXT CONTRAST FIXES */
/* Proper contrast rules: Dark backgrounds = white text, Light backgrounds = dark text */
/* THESE RULES OVERRIDE THEME SWITCHING FOR FIXED BACKGROUND COLORS */

/* VERY SPECIFIC fix for "Ready to Get Your Property Restored?" section only */
.bg-success.content-section h2,
.bg-success.content-section p,
.bg-success.content-section .lead {
    color: #ffffff !important;
}

/* Hero sections always white text */
.hero, .hero-about {
    color: #ffffff !important;
}

.hero h1, .hero h2, .hero h3, .hero h4, .hero h5, .hero h6,
.hero-about h1, .hero-about h2, .hero-about h3, .hero-about h4, .hero-about h5, .hero-about h6 {
    color: #ffffff !important;
}

.hero p, .hero .lead, .hero .small,
.hero-about p, .hero-about .lead, .hero-about .small {
    color: #ffffff !important;
}

/* Preserve existing correct contrast for certification cards and other nested elements */
.bg-white .bg-opacity-10 h1, .bg-white .bg-opacity-10 h2, .bg-white .bg-opacity-10 h3, 
.bg-white .bg-opacity-10 h4, .bg-white .bg-opacity-10 h5, .bg-white .bg-opacity-10 h6,
.bg-white .bg-opacity-10 p, .bg-white .bg-opacity-10 .small {
    color: white !important;
}

/* REMOVED PROBLEMATIC CSS THAT WAS OVERRIDING EXISTING text-white CLASSES */

/* REMOVED - This was causing white text on white background in certification section */
/* These broad selectors were overriding the explicit text-white classes */

/* List Groups */
.list-group-item {
    background-color: var(--bg-primary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.list-group-item:hover {
    background-color: var(--bg-secondary);
}

/* Alerts */
.alert {
    border-color: var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

/* Modals */
.modal-content {
    background-color: var(--bg-primary);
    border-color: var(--border-color);
}

.modal-header {
    border-bottom-color: var(--border-color);
}

.modal-footer {
    border-top-color: var(--border-color);
}

.modal-title {
    color: var(--text-primary);
}

/* Tables */
.table {
    color: var(--text-primary);
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: var(--bg-secondary);
}

/* Breadcrumbs */
.breadcrumb {
    background-color: var(--bg-secondary);
}

.breadcrumb-item a {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--text-muted);
}

/* Pagination */
.page-link {
    background-color: var(--bg-primary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.page-link:hover {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Text Colors */
.text-primary {
    color: var(--primary-color) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* Dark Mode Text Color Overrides */
[data-theme="dark"] .text-dark {
    color: #ffffff !important;
}

[data-theme="dark"] .text-muted {
    color: #cbd5e0 !important;
}

[data-theme="dark"] .card-title {
    color: #ffffff !important;
}

[data-theme="dark"] .card-text {
    color: #cbd5e0 !important;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: #ffffff !important;
}

[data-theme="dark"] .display-4,
[data-theme="dark"] .display-5,
[data-theme="dark"] .display-6 {
    color: #ffffff !important;
}

[data-theme="dark"] .lead {
    color: #cbd5e0 !important;
}

/* Additional Dark Mode List and Content Overrides */
[data-theme="dark"] ol li,
[data-theme="dark"] ul li {
    color: #cbd5e0 !important;
}

[data-theme="dark"] .card-body ol li,
[data-theme="dark"] .card-body ul li {
    color: #cbd5e0 !important;
}

[data-theme="dark"] .card-body ol li strong,
[data-theme="dark"] .card-body ul li strong {
    color: #ffffff !important;
}

[data-theme="dark"] .small,
[data-theme="dark"] small {
    color: #94a3b8 !important;
}

[data-theme="dark"] .small.text-muted,
[data-theme="dark"] small.text-muted {
    color: #94a3b8 !important;
}

[data-theme="dark"] .bg-light {
    background-color: var(--bg-secondary) !important;
}

[data-theme="dark"] .bg-light h4,
[data-theme="dark"] .bg-light h5,
[data-theme="dark"] .bg-light h6 {
    color: #ffffff !important;
}

[data-theme="dark"] .bg-light small {
    color: #94a3b8 !important;
}

/* Background Colors */
.bg-light {
    background-color: var(--bg-secondary) !important;
}

.bg-white {
    background-color: var(--bg-primary) !important;
}

[data-theme="dark"] .bg-light {
    background-color: var(--bg-secondary) !important;
}

[data-theme="dark"] .bg-white {
    background-color: var(--bg-primary) !important;
}

/* Stats Cards */
.stat-card {
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: scale(1.05);
}

.stat-card h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Contact Items */
.contact-item {
    padding: 1.5rem;
    transition: transform 0.3s ease;
}

.contact-item:hover {
    transform: translateY(-3px);
}

/* Form Enhancements */
.form-control, .form-select {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.input-group-text {
    border-radius: 8px 0 0 8px;
    border: 2px solid #e9ecef;
    border-right: none;
}

/* Alert Enhancements */
.alert {
    border-radius: 8px;
    border: none;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.alert-warning {
    background-color: #fff3cd;
    color: #664d03;
}

/* Dashboard Styles */
.dashboard-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.dashboard-stat {
    text-align: center;
    padding: 2rem 1rem;
}

.dashboard-stat .number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.dashboard-stat .label {
    color: #6c757d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Status Badges */
.status-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background-color: #fff3cd;
    color: #664d03;
}

.status-scheduled {
    background-color: #cff4fc;
    color: #055160;
}

.status-in-progress {
    background-color: #e7f3ff;
    color: #0c5aa6;
}

.status-completed {
    background-color: #d1e7dd;
    color: #0f5132;
}

.status-cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

/* Priority Indicators */
.priority-low {
    color: var(--success-color);
}

.priority-medium {
    color: var(--warning-color);
}

.priority-high {
    color: var(--danger-color);
}

.priority-emergency {
    color: var(--danger-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Table Enhancements */
.table {
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: background-color 0.3s ease;
}

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

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Dashboard Container Styling */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.admin-content, .dashboard-content {
    max-width: 1200px;
    margin: 0 auto;
}

/* Center align main content areas */
.container-fluid {
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .hero {
        min-height: 60vh;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .dashboard-stat .number {
        font-size: 2rem;
    }
    
    .btn-lg {
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    .dashboard-container,
    .admin-content,
    .dashboard-content {
        max-width: 100%;
        padding: 0 15px;
    }
}

/* Sidebar Navigation */
.sidebar {
    background: linear-gradient(180deg, var(--storm-blue) 0%, var(--primary-color) 100%);
    min-height: 100vh;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 12px 20px;
    border-radius: 8px;
    margin: 2px 10px;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: rgba(255,255,255,0.1);
    color: white;
    transform: translateX(5px);
}

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

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

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: #f8f9fa;
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.1);
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
    
    .btn {
        display: none !important;
    }
}

/* Accessibility Improvements */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Focus Indicators */
button:focus,
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Emergency Contact Styling */
.emergency-contact {
    background: linear-gradient(45deg, var(--warning-color), #ffed4a);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.emergency-contact h6 {
    color: #000;
    margin-bottom: 0.5rem;
}

.emergency-contact strong {
    color: var(--storm-blue);
    font-size: 1.2rem;
}

/* Mobile Responsive Fixes - Targeted for mobile only */
@media screen and (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    
    /* Answer grid fixes for claims form */
    .answer-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .answer-option {
        margin-bottom: 1rem;
    }
    
    /* Text fixes for mobile */
    .display-1,
    .display-2,
    .display-3,
    .display-4,
    .display-5,
    .display-6 {
        word-break: break-word;
        line-height: 1.2;
    }
    
    /* Button fixes for mobile */
    .btn-lg {
        margin-bottom: 0.5rem;
    }
}

/* Extra small screens */
@media screen and (max-width: 480px) {
    .btn {
        font-size: 0.9rem;
        padding: 8px 12px;
    }
}

/* Prevent image overflow */
img,
video,
iframe {
    max-width: 100%;
    height: auto;
}

/* Claims Form Styling */
.claims-form-container {
    position: relative;
    min-height: 100vh;
}

.question-container {
    display: none;
    min-height: calc(100vh - 140px);
    padding-bottom: 60px;
    position: relative;
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.5s ease-in-out;
}

.question-container.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

/* Connection-based animation adjustments */
.fast-connection .question-container {
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slow-connection .question-container {
    transition: opacity 0.2s ease !important;
    transform: none !important;
}

.slow-connection .question-container.active {
    transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .question-container {
        transition: opacity 0.2s ease !important;
        transform: none !important;
    }
    
    .question-container.active {
        transform: none !important;
    }
}

.answer-grid {
    margin-bottom: 40px;
    padding-bottom: 20px;
}

.question-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Navigation buttons at bottom of each question */
.question-navigation {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.question-navigation .btn {
    border-radius: 50px;
    padding: 12px 24px;
    font-weight: 600;
    min-width: 120px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.question-navigation .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Mobile navigation */
@media (max-width: 768px) {
    .question-navigation {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .question-navigation .btn {
        width: 100%;
        max-width: 200px;
    }
}

/* Progress header positioning */
.progress-header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e9ecef;
    z-index: 999;
    padding: 15px 0;
}

/* Storm Cloud Loading Spinner */
.storm-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 58, 138, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.storm-cloud {
    position: relative;
    width: 120px;
    height: 60px;
    margin-bottom: 40px;
}

.cloud {
    position: absolute;
    background: #4a5568;
    border-radius: 50px;
    opacity: 0.9;
    animation: float 3s ease-in-out infinite;
}

.cloud:before,
.cloud:after {
    content: '';
    position: absolute;
    background: #4a5568;
    border-radius: 50px;
}

/* Main cloud body */
.cloud {
    width: 80px;
    height: 40px;
    top: 20px;
    left: 20px;
}

.cloud:before {
    width: 50px;
    height: 50px;
    top: -25px;
    left: 10px;
}

.cloud:after {
    width: 60px;
    height: 40px;
    top: -15px;
    right: 10px;
}

/* Dark storm cloud */
.cloud.dark {
    background: #2d3748;
    animation: float 3s ease-in-out infinite reverse;
}

.cloud.dark:before,
.cloud.dark:after {
    background: #2d3748;
}

/* Lightning effect */
.lightning {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 40px;
    background: linear-gradient(to bottom, #fbbf24, transparent);
    opacity: 0;
    animation: lightning 2s infinite;
    border-radius: 2px;
}

.lightning:before {
    content: '';
    position: absolute;
    top: 20px;
    left: -8px;
    width: 3px;
    height: 20px;
    background: linear-gradient(to bottom, #fbbf24, transparent);
    transform: rotate(20deg);
    border-radius: 2px;
}

.lightning:after {
    content: '';
    position: absolute;
    top: 25px;
    right: -8px;
    width: 3px;
    height: 15px;
    background: linear-gradient(to bottom, #fbbf24, transparent);
    transform: rotate(-20deg);
    border-radius: 2px;
}

/* Rain drops */
.rain {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 60px;
    overflow: hidden;
}

.rain-drop {
    position: absolute;
    width: 2px;
    height: 15px;
    background: linear-gradient(to bottom, #60a5fa, transparent);
    border-radius: 2px;
    animation: rain-fall 1.5s linear infinite;
}

.rain-drop:nth-child(1) { left: 10px; animation-delay: 0s; }
.rain-drop:nth-child(2) { left: 25px; animation-delay: 0.2s; }
.rain-drop:nth-child(3) { left: 40px; animation-delay: 0.4s; }
.rain-drop:nth-child(4) { left: 55px; animation-delay: 0.6s; }
.rain-drop:nth-child(5) { left: 70px; animation-delay: 0.8s; }
.rain-drop:nth-child(6) { left: 85px; animation-delay: 1s; }

/* Loading text */
.storm-text {
    position: absolute;
    bottom: 30%;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    animation: pulse 2s ease-in-out infinite;
}

.storm-text .dots {
    display: inline-block;
    animation: loading-dots 1.5s steps(4, end) infinite;
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes lightning {
    0%, 90%, 100% { opacity: 0; }
    5%, 10% { opacity: 1; }
    15%, 20% { opacity: 0; }
    25%, 30% { opacity: 1; }
}

@keyframes rain-fall {
    0% { 
        top: -15px; 
        opacity: 1; 
    }
    100% { 
        top: 60px; 
        opacity: 0; 
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes loading-dots {
    0%, 20% { color: transparent; text-shadow: .25em 0 0 transparent, .5em 0 0 transparent; }
    40% { color: white; text-shadow: .25em 0 0 transparent, .5em 0 0 transparent; }
    60% { text-shadow: .25em 0 0 white, .5em 0 0 transparent; }
    80%, 100% { text-shadow: .25em 0 0 white, .5em 0 0 white; }
}

/* Hide loader by default */
.storm-loader.hidden {
    display: none;
}

/* Show loader */
.storm-loader.show {
    display: flex;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .storm-cloud {
        width: 100px;
        height: 50px;
        margin-bottom: 30px;
    }
    
    .cloud {
        width: 70px;
        height: 35px;
    }
    
    .storm-text {
        font-size: 16px;
    }
}

/* Gamified Progress Bar with Achievement Badges */
.gamified-progress {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.gamified-progress::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"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1.5" fill="rgba(255,255,255,0.08)"/><circle cx="50" cy="10" r="0.8" fill="rgba(255,255,255,0.12)"/></svg>') repeat;
    pointer-events: none;
    animation: sparkle 20s linear infinite;
}

@keyframes sparkle {
    0% { transform: translateX(0) translateY(0); }
    100% { transform: translateX(-100px) translateY(-100px); }
}

.progress-title {
    color: white;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 12px 20px;
    color: white;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    flex: 1;
    min-width: 120px;
}

.stat-number {
    font-size: 28px;
    font-weight: 800;
    display: block;
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}

.progress-bar-container {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    height: 16px;
    margin: 20px 0;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 50px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-bar-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%);
    animation: shimmer 2s infinite;
}

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

.progress-percentage {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-weight: 700;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Achievement Badges */
.achievement-badges {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.achievement-badge {
    position: relative;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    border: 3px solid transparent;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.achievement-badge.locked {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    opacity: 0.4;
    filter: grayscale(1);
}

.achievement-badge.unlocked {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-color: #ffd700;
    box-shadow: 0 5px 20px rgba(245, 87, 108, 0.4);
    animation: badge-glow 2s ease-in-out infinite alternate;
}

.achievement-badge.earned {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border-color: #ffd700;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.6);
}

@keyframes badge-glow {
    0% { box-shadow: 0 5px 20px rgba(245, 87, 108, 0.4); }
    100% { box-shadow: 0 8px 30px rgba(245, 87, 108, 0.8); }
}

.achievement-badge:hover {
    transform: scale(1.1);
}

.achievement-tooltip {
    position: absolute;
    top: -45px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
    min-width: max-content;
}

.achievement-badge:hover .achievement-tooltip {
    opacity: 1;
    visibility: visible;
    top: -50px;
}

.achievement-tooltip::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid rgba(0, 0, 0, 0.9);
}

/* Level Up Animation */
.level-up-animation {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.6);
    z-index: 10000;
    text-align: center;
    opacity: 0;
    scale: 0.8;
    animation: levelUpShow 0.6s ease-out forwards;
}

@keyframes levelUpShow {
    0% {
        opacity: 0;
        scale: 0.8;
    }
    100% {
        opacity: 1;
        scale: 1;
    }
}

.level-up-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 10px;
}

.level-up-description {
    font-size: 16px;
    opacity: 0.9;
}

/* Milestone Celebrations */
.milestone-celebration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
    border-radius: 20px;
}

.confetti {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #ffd700;
    animation: confetti-fall 3s linear infinite;
}

.confetti:nth-child(odd) { background: #ff6b6b; }
.confetti:nth-child(3n) { background: #4ecdc4; }
.confetti:nth-child(4n) { background: #45b7d1; }
.confetti:nth-child(5n) { background: #96ceb4; }

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .gamified-progress {
        padding: 20px 15px;
        margin: 15px 0;
    }
    
    .progress-title {
        font-size: 18px;
    }
    
    .progress-stats {
        gap: 10px;
    }
    
    .stat-item {
        min-width: 100px;
        padding: 10px 15px;
    }
    
    .stat-number {
        font-size: 24px;
    }
    
    .achievement-badge {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    
    .achievement-badges {
        gap: 10px;
    }
    
    .level-up-animation {
        padding: 25px 30px;
        margin: 0 20px;
    }
    
    .level-up-title {
        font-size: 20px;
    }
    
    .level-up-description {
        font-size: 14px;
    }
}