/* Root Variables */
:root {
    --primary-color: #2196F3;
    --success-color: #4CAF50;
    --warning-color: #FFC107;
    --danger-color: #F44336;
    --purple-color: #9C27B0;
    --dark-bg: #1a1a1a;
    --dark-surface: #2d2d2d;
    --dark-text: #ffffff;
    --light-bg: #ffffff;
    --light-surface: #f8f9fa;
    --light-text: #212529;
    --brutalist-shadow: 4px 4px 0px rgba(0, 0, 0, 0.3);
    --brutalist-border: 3px solid #000;
}

/* Dark Mode Variables */
[data-bs-theme="dark"] {
    --bs-body-bg: var(--dark-bg);
    --bs-body-color: var(--dark-text);
    --bs-card-bg: var(--dark-surface);
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Arial Black', Arial, sans-serif;
    font-weight: bold;
    line-height: 1.6;
    transition: all 0.3s ease;
}

/* Brutalist Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.display-4 {
    font-size: 2.5rem;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
}

/* Brutalist Buttons */
.btn {
    font-weight: bold;
    text-transform: uppercase;
    border: 3px solid;
    border-radius: 0;
    padding: 12px 24px;
    transition: all 0.2s ease;
    box-shadow: var(--brutalist-shadow);
    margin: 10px;
}

.btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
}

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

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.btn-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
    color: black;
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

/* Header Styles */
.header-brutalist {
    background: linear-gradient(135deg, var(--primary-color), var(--purple-color));
    border-bottom: 5px solid #000;
    box-shadow: 0 5px 0 rgba(0, 0, 0, 0.3);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 900;
    color: white !important;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-logo {
    height: 28px;
    width: auto;
    vertical-align: middle;
}

/* Enhanced Hamburger (Navbar Toggler) */
.navbar-toggler {
    border-radius: 0;
    box-shadow: var(--brutalist-shadow);
    padding: 8px 10px;
}

.navbar-toggler:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.35);
}

.navbar-dark .navbar-toggler-icon {
    width: 1.75rem;
    height: 1.75rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,1)' stroke-linecap='round' stroke-width='3' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-toggler:hover {
    transform: translate(2px, 2px);
    background: rgba(255, 255, 255, 0.08);
}

.navbar-toggler:hover .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,1)' stroke-linecap='round' stroke-width='3.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.nav-link {
    font-weight: bold;
    color: white !important;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--warning-color) !important;
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.3);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(45deg, var(--light-surface), white);
    border: var(--brutalist-border);
    box-shadow: var(--brutalist-shadow);
    padding: 3rem 2rem;
    margin-bottom: 2rem;
}

[data-bs-theme="dark"] .hero-section {
    background: linear-gradient(45deg, var(--dark-surface), var(--dark-bg));
    border-color: var(--primary-color);
}

/* Cards */
.card {
    border: var(--brutalist-border);
    border-radius: 0;
    box-shadow: var(--brutalist-shadow);
    transition: all 0.3s ease;
    background: white;
}

[data-bs-theme="dark"] .card {
    background: var(--dark-surface);
    border-color: var(--primary-color);
}

.card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.3);
}

.stat-card {
    border-left: 5px solid var(--primary-color);
}

.stat-card:nth-child(2) {
    border-left-color: var(--success-color);
}

.stat-card:nth-child(3) {
    border-left-color: var(--warning-color);
}

.stat-card:nth-child(4) {
    border-left-color: var(--danger-color);
}

/* Campaign Cards */
.campaign-card {
    position: relative;
    overflow: hidden;
}

.campaign-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 0;
    font-weight: bold;
    font-size: 0.75rem;
    text-transform: uppercase;
    border: 2px solid;
}

.status-active {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.status-upcoming {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
    color: black;
}

.status-completed {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Section Titles */
.section-title {
    font-size: 2rem;
    font-weight: 900;
    text-transform: uppercase;
    position: relative;
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
}

/* Forms */
.form-control, .form-select {
    border: 3px solid #000;
    border-radius: 0;
    font-weight: bold;
    padding: 12px;
    transition: all 0.3s ease;
}

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

.form-label {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
}

/* Modal Styles */
.modal-content {
    border: var(--brutalist-border);
    border-radius: 0;
    box-shadow: var(--brutalist-shadow);
}

.modal-header {
    background: var(--primary-color);
    color: white;
    border-bottom: 3px solid #000;
}

.modal-title {
    font-weight: 900;
    text-transform: uppercase;
}

/* Reserve space between modal and bottom of the page */
.modal-dialog {
    margin-bottom: 150px !important;
}

/* Chart Container */
.chart-container {
    background: white;
    border: var(--brutalist-border);
    box-shadow: var(--brutalist-shadow);
    padding: 2rem;
    text-align: center;
}

[data-bs-theme="dark"] .chart-container {
    background: var(--dark-surface);
    border-color: var(--primary-color);
}

/* Offcanvas */
.offcanvas {
    border-left: 5px solid var(--primary-color);
}

.offcanvas-header {
    background: var(--primary-color);
    color: white;
}

.offcanvas-title {
    font-weight: 900;
    text-transform: uppercase;
}

/* List Groups */
.list-group-item {
    border: 2px solid #000;
    border-radius: 0;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.list-group-item:first-child {
    border-top: 2px solid #000;
}

/* Accordion */
.accordion-button {
    font-weight: bold;
    text-transform: uppercase;
    background: var(--light-surface);
    border: 2px solid #000;
}

.accordion-button:not(.collapsed) {
    background: var(--primary-color);
    color: white;
}

/* Footer */
.footer-brutalist {
    background: linear-gradient(135deg, #000, #333);
    color: white;
    border-top: 5px solid var(--primary-color);
    padding: 3rem 0 2rem;
}

.footer-brutalist h5 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.footer-brutalist a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

.footer-brutalist a:hover {
    color: var(--warning-color);
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.3);
}

/* Ad Containers */
.ad-container {
    background: #f8f9fa;
    border: 2px dashed #ccc;
    padding: 1rem;
    text-align: center;
    margin: 2rem 0;
}

[data-bs-theme="dark"] .ad-container {
    background: var(--dark-surface);
    border-color: #666;
}

/* Progress Bars */
.progress {
    height: 8px;
    border: 2px solid #000;
    border-radius: 0;
    background: #f8f9fa;
}

.progress-bar {
    background: var(--primary-color);
}

/* Badges */
.badge {
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 0;
    border: 2px solid;
    padding: 0.5rem 0.75rem;
}

/* Alert Styles */
.alert {
    border: 3px solid;
    border-radius: 0;
    font-weight: bold;
    box-shadow: var(--brutalist-shadow);
}

.alert-primary {
    background: rgba(33, 150, 243, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    border-color: var(--success-color);
    color: var(--success-color);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    border-color: var(--warning-color);
    color: #856404;
}

.alert-danger {
    background: rgba(244, 67, 54, 0.1);
    border-color: var(--danger-color);
    color: var(--danger-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.25rem;
        max-width: 65%;
    }
    .brand-logo {
        height: 24px;
    }
    .display-4 {
        font-size: 2rem;
    }
    
    .hero-section {
        padding: 2rem 1rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1rem;
        max-width: 60%;
    }
    .brand-logo {
        height: 22px;
    }
    .display-4 {
        font-size: 1.75rem;
    }
    
    .btn-lg {
        padding: 12px 24px;
        font-size: 1rem;
    }
    
    .hero-section .btn {
        display: block;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .hero-section .btn:last-child {
        margin-bottom: 0;
    }
}

/* 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-right {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

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

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

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

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

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

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--purple-color);
}

/* Print Styles */
@media print {
    .btn, .navbar, .offcanvas, .modal, .ad-container {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --brutalist-shadow: 6px 6px 0px rgba(0, 0, 0, 0.8);
        --brutalist-border: 4px solid #000;
    }
    
    .btn {
        border-width: 4px;
    }
    
    .form-control, .form-select {
        border-width: 4px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .btn:hover {
        transform: none;
    }
    
    .card:hover {
        transform: none;
    }
}
