/* Color Palette based on Binary Background */
:root {
    /* Primary colors sampled from the background */
    --matrix-dark-blue: #0a1628;     /* Deep blue from background shadows */
    --matrix-medium-blue: #1e456e;   /* Admiral blue from NDIA  */
    --matrix-bright-blue: #2980b9;   /* Bright blue from binary streams */
    --matrix-cyan: #00bcd4;          /* Cyan highlights */
    --matrix-teal: #20c997;          /* Teal accents */
    --matrix-light: #e8f4f8;        /* Light blue-white */
    --ndia-limegreen: #88c540;      /* lime green from undral at ndia */
    
    /* Semantic colors using the palette */
    --primary-color: var(--matrix-bright-blue);
    --secondary-color: var(--matrix-cyan);
    --success-color: var(--matrix-teal);
    --accent-color: var(--matrix-medium-blue);
    --background-dark: var(--matrix-dark-blue);
}

/* Override Bootstrap button colors */
.btn-primary {
    background: linear-gradient(135deg, var(--matrix-bright-blue), var(--matrix-cyan));
    border: 1px solid var(--matrix-cyan);
    color: white;
    box-shadow: 0 2px 8px rgba(41, 128, 185, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--matrix-cyan), var(--matrix-teal));
    border-color: var(--matrix-teal);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--matrix-teal), var(--matrix-cyan));
    border: 1px solid var(--matrix-teal);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--matrix-cyan), var(--matrix-bright-blue));
    border-color: var(--matrix-bright-blue);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--matrix-medium-blue), var(--matrix-dark-blue));
    border: 1px solid var(--matrix-medium-blue);
    color: var(--matrix-light);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--matrix-bright-blue), var(--matrix-medium-blue));
    border-color: var(--matrix-bright-blue);
}

/* Section headers with matrix theme */
h1, h2, h3, h4, h5, h6 {
    color: var(--ndia-limegreen) !important;
    text-shadow: 0 0 10px rgba(0, 188, 212, 0.3);
}

h1 {
    color: var(--ndia-limegreen);
    
}

h2 {
    color: var(--matrix-bright-blue) !important;
    border-bottom: 2px solid var(--matrix-medium-blue);
    padding-bottom: 0.5rem;
}

h3, h4 {
    color: var(--matrix-teal) !important;
}

/* Fix for agreement sections */
#data-agreement-section .card-body {
    background-color: rgba(10, 22, 40, 0.9) !important; 
    color: var(--matrix-light) !important;
}

.agreement-content h1,
.agreement-content h2,
.agreement-content h3,
.agreement-content h4,
.agreement-content h5,
.agreement-content h6,
.agreement-content p,
.agreement-content ul,
.agreement-content ol,
.agreement-content li,
.agreement-content a,
.agreement-content code,
.agreement-content pre {
    color: white !important;
}

/* Override any Bootstrap background classes */
.bg-light.text-white {
    background-color: #212529 !important;
}

/* Loading Animation Styles */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-container {
    text-align: center;
    color: white;
}

.loading-spinner {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
}

.spinner-ring {
    box-sizing: border-box;
    display: block;
    position: absolute;
    width: 64px;
    height: 64px;
    margin: 8px;
    border: 8px solid transparent;
    border-top-color: #0d6efd;
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-ring:nth-child(1) {
    animation-delay: -0.45s;
    border-top-color: #0d6efd;
}

.spinner-ring:nth-child(2) {
    animation-delay: -0.3s;
    border-top-color: #6610f2;
}

.spinner-ring:nth-child(3) {
    animation-delay: -0.15s;
    border-top-color: #6f42c1;
}

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

.loading-text {
    font-size: 18px;
    font-weight: 500;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Page transitions removed per user request */

/* Button hover animations */
.btn {
    transition: all 0.3s ease;
    transform: translateY(0);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

/* Card hover animations */
.card {
    transition: all 0.3s ease;
    transform: translateY(0);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Navigation link animations with matrix theme */
.nav-link {
    transition: all 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--matrix-cyan), var(--matrix-teal));
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

/* Form input focus animations with matrix theme */
.form-control,
.form-select {
    transition: all 0.3s ease;
    background-color: rgba(10, 22, 40, 0.7);
    border-color: var(--matrix-medium-blue);
    color: var(--matrix-light);
}

.form-control:focus,
.form-select:focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 0.25rem rgba(0, 188, 212, 0.25);
    border-color: var(--matrix-cyan);
    background-color: rgba(10, 22, 40, 0.9);
}

.form-control::placeholder {
    color: rgba(232, 244, 248, 0.6);
}

/* Form labels with matrix theme */
.form-label {
    color: var(--matrix-light);
    font-weight: 500;
}

/* Badges with matrix theme */
.badge {
    text-shadow: none;
}

.badge.bg-success {
    background: linear-gradient(135deg, var(--matrix-teal), var(--matrix-cyan)) !important;
}

.badge.bg-primary {
    background: linear-gradient(135deg, var(--matrix-bright-blue), var(--matrix-cyan)) !important;
}

.badge.bg-secondary {
    background: linear-gradient(135deg, var(--matrix-medium-blue), var(--matrix-dark-blue)) !important;
}

/* Card headers with consistent primary theme */
.card-header {
    background: linear-gradient(135deg, var(--matrix-medium-blue), var(--matrix-bright-blue)) !important;
    border-bottom: 1px solid var(--matrix-cyan);
    color: white !important;
}

.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6 {
    color: white !important;
    text-shadow: none !important;
    margin-bottom: 0;
}

.bg-primary {
    background: linear-gradient(135deg, var(--matrix-medium-blue), var(--matrix-bright-blue)) !important;
}

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

/* Flash message animations */
.alert {
    animation: slideInDown 0.5s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Static Background - No Parallax */
.parallax-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: url('../img/binary_background.gif') center center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Content styling */
.main-content,
.card {
    position: relative;
    z-index: 1;
}

/* Additional visual depth with matrix theme */
.card {
    position: relative;
    background: rgba(10, 22, 40, 0.88);
    backdrop-filter: blur(2px);
    border: 1px solid var(--matrix-medium-blue);
    box-shadow: 0 4px 20px rgba(0, 188, 212, 0.1);
}

.sponsorcard {
    position: relative;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(2px);
    border: 1px solid var(--matrix-medium-blue);
    box-shadow: 0 4px 20px rgba(0, 188, 212, 0.1);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.08) 0%, transparent 50%);
    border-radius: inherit;
    pointer-events: none;
}

/* Navigation with matrix theme */
.nav-link {
    color: var(--matrix-light) !important;
}

.nav-link:hover {
    color: var(--matrix-cyan) !important;
}

.nav-link.active {
    color: var(--matrix-teal) !important;
}

.navbar-brand {
    color: var(--matrix-cyan) !important;
    text-shadow: 0 0 10px rgba(0, 188, 212, 0.5);
}

/* Tables with matrix theme */
.table {
    color: var(--matrix-light);
}

.table th {
    background-color: var(--matrix-medium-blue);
    color: var(--matrix-light);
    border-color: var(--matrix-cyan);
}

.table td {
    border-color: rgba(26, 61, 92, 0.5);
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 188, 212, 0.1);
}

/* Alerts with matrix theme */
.alert-success {
    background-color: rgba(32, 201, 151, 0.2);
    border-color: var(--matrix-teal);
    color: var(--matrix-light);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.2);
    border-color: #ffc107;
    color: var(--matrix-light);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.2);
    border-color: #dc3545;
    color: var(--matrix-light);
}

.alert-info {
    background-color: rgba(0, 188, 212, 0.2);
    border-color: var(--matrix-cyan);
    color: var(--matrix-light);
}

/* Enhanced navbar with depth */
.navbar {
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1050;
    position: relative;
}

/* Fix dropdown menu z-index issues */
.dropdown-menu {
    z-index: 1055;
    background-color: rgba(10, 22, 40, 0.95);
    border: 1px solid var(--matrix-medium-blue);
    backdrop-filter: blur(10px);
}

.dropdown-item {
    color: var(--matrix-light);
}

.dropdown-item:hover {
    background-color: rgba(0, 188, 212, 0.2);
    color: var(--matrix-cyan);
}

/* Fix modal z-index issues */
.modal {
    z-index: 1060 !important;
}

.modal-backdrop {
    z-index: 1040 !important;
}

.modal-dialog {
    z-index: 1080 !important;
    position: relative;
}

.modal-content {
    background-color: rgba(10, 22, 40, 0.95);
    border: 1px solid var(--matrix-medium-blue);
    backdrop-filter: blur(10px);
    z-index: 1090 !important;
    position: relative;
}

.modal-header {
    background: linear-gradient(135deg, var(--matrix-medium-blue), var(--matrix-bright-blue));
    border-bottom: 1px solid var(--matrix-cyan);
    color: white;
}

.modal-title {
    color: white;
}

.modal-body {
    color: var(--matrix-light);
}

.modal-footer {
    border-top: 1px solid var(--matrix-medium-blue);
}

/* Fix the modal backdrop z-index issue */
.modal-backdrop.fade.show {
    z-index: 1040 !important;
}

.modal-backdrop {
    z-index: 1040 !important;
}

/* Ensure modal content appears above backdrop */
.modal.show {
    z-index: 1055 !important;
}

.modal.show .modal-dialog {
    z-index: 1056 !important;
}

.modal.show .modal-content {
    z-index: 1057 !important;
}

/* Ensure modal buttons are clickable */
.modal .btn {
    z-index: 1058 !important;
    position: relative;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Mobile optimizations for static background */
@media (max-width: 768px) {
    .parallax-background {
        background-attachment: scroll;
    }
}