/* ========================================
   Matrix Grid Background
   ======================================== */

.matrix-container {
    width: 100%;
    height: 100%;
    perspective: 1500px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
    background-color: #0d0d1a;
    overflow: hidden;
}

.matrix-grid {
    width: 100%;
    height: 100%;
    background: linear-gradient(#1a1919 1px, transparent 1px),
        linear-gradient(90deg, #1a1a1a 1px, transparent 1px),
        repeating-linear-gradient(
        45deg,
        rgb(0, 0, 0) 0px 1px,
        transparent 1px 12px
        ),
        repeating-linear-gradient(
        -45deg,
        rgba(0, 0, 0, 0.05) 0px 1px,
        transparent 1px 12px
        ),
        radial-gradient(circle at center, #000000 0%, #000000 100%);
    background-size:
        28px 28px,
        28px 28px,
        50px 50px,
        50px 50px,
        cover;
    border: 1px solid rgba(238, 238, 238, 0.1);
    box-shadow:
        inset 0 0 40px rgba(10, 10, 10, 0.1),
        0 0 60px rgba(34, 34, 34, 0.15);
    transform-style: preserve-3d;
    transition: all 0.6s ease-in-out;
    position: relative;
}

.matrix-grid::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0, 0, 0, 0.4),
        transparent
    );
    animation: borderFlow 1s linear infinite;
    pointer-events: none;
    mask: linear-gradient(#424242 0 0) padding-box, linear-gradient(#080808 0 0);
    -webkit-mask: linear-gradient(#2e2e2e 0 0) padding-box, linear-gradient(#080808 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
}

.matrix-grid::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 160px;
    height: 160px;
    background: radial-gradient(
        circle,
        rgba(65, 65, 65, 0.15) 0%,
        transparent 70%
    );
    transform: translate(-50%, -50%);
    animation: pulse 0.5s ease-in-out infinite alternate;
    z-index: 1;
}

@keyframes borderFlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.85);
        opacity: 0.2;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.8;
    }
}

/* ========================================
   Base Styles
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #000000;
    color: #FFFFFF;
    min-height: 100vh;
    position: relative;
}

/* ========================================
   Loader Overlay
   ======================================== */

.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

/* ========================================
   Square Loader (From Uiverse)
   ======================================== */

.loader {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
}

@keyframes loader_5191 {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.square {
    background: #FFFFFF;
    width: 10px;
    height: 10px;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -5px;
    margin-left: -5px;
}

#sq1 {
    margin-top: -25px;
    margin-left: -25px;
    animation: loader_5191 675ms ease-in-out 0s infinite alternate;
}

#sq2 {
    margin-top: -25px;
    animation: loader_5191 675ms ease-in-out 75ms infinite alternate;
}

#sq3 {
    margin-top: -25px;
    margin-left: 15px;
    animation: loader_5191 675ms ease-in-out 150ms infinite;
}

#sq4 {
    margin-left: -25px;
    animation: loader_5191 675ms ease-in-out 225ms infinite;
}

#sq5 {
    animation: loader_5191 675ms ease-in-out 300ms infinite;
}

#sq6 {
    margin-left: 15px;
    animation: loader_5191 675ms ease-in-out 375ms infinite;
}

#sq7 {
    margin-top: 15px;
    margin-left: -25px;
    animation: loader_5191 675ms ease-in-out 450ms infinite;
}

#sq8 {
    margin-top: 15px;
    animation: loader_5191 675ms ease-in-out 525ms infinite;
}

#sq9 {
    margin-top: 15px;
    margin-left: 15px;
    animation: loader_5191 675ms ease-in-out 600ms infinite;
}

.loader-text {
    font-size: 14px;
    color: #A0A0A0;
    animation: pulse 1.5s ease-in-out infinite;
    letter-spacing: 2px;
    text-transform: uppercase;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ========================================
   Error Alert Component
   ======================================== */

.error-alert {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 100%;
    max-width: 400px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.error-content {
    position: relative;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    padding: 12px 56px 12px 16px;
    border-radius: 9px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.5s ease;
    border: 1px solid #f85149;
    background: linear-gradient(#f851491a, #f851491a);
    color: #b22b2b;
}

.error-close-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    padding: 4px;
    border-radius: 6px;
    transition: opacity 0.3s ease;
    background: transparent;
    border: 1px solid #f85149;
    color: #f85149;
    cursor: pointer;
    opacity: 0.4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-close-btn:hover {
    opacity: 1;
}

.error-message {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-right: auto;
    gap: 8px;
}

.error-message svg {
    color: #b22b2b;
    flex-shrink: 0;
}

.error-message span {
    color: #b22b2b;
}

/* Warning variant */
.warning-alert .error-content {
    border-color: #f59e0b;
    background: linear-gradient(#f59e0b1a, #f59e0b1a);
    color: #b22b2b;
}

.warning-alert .error-close-btn {
    border-color: #f59e0b;
    color: #f59e0b;
}

.warning-alert .error-message svg,
.warning-alert .error-message span {
    color: #b22b2b;
}
