@import "variables.css";

/* --- Page Loader (Dark Mode) --- */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #020617; /* Hardcoded dark bg to ensure no flash */
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transition: opacity .3s ease-out, visibility .3s ease-out;
}

.loader-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loader-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid rgba(59,130,246,.2);
    border-top: 2px solid #3b82f6;
    border-right: 2px solid #8b5cf6;
    animation: spinLoader .8s linear infinite;
    position: relative;
    box-shadow: 0 0 20px rgba(59,130,246,.3); /* Stronger glow for dark mode */
}

.loader-circle::before {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    border: 2px solid rgba(236,72,153,.2);
    border-bottom: 2px solid #ec4899;
    animation: spinLoader 2s linear infinite reverse;
}

.loader-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    color: #f8fafc;
    font-size: 24px;
    animation: pulseLoader 1.5s ease-in-out infinite;
}

.loader-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(59,130,246,0.5);
}

.loader-text span {
    opacity: 0;
    display: inline-block;
    animation: fadeInText .5s forwards;
}
.loader-text span:nth-child(1), .loader-text span:nth-child(2), .loader-text span:nth-child(3) { animation-delay: .05s; color: #3b82f6; }
.loader-text span:nth-child(4), .loader-text span:nth-child(5), .loader-text span:nth-child(6) { animation-delay: .2s; color: #a855f7; }
.loader-text span:nth-child(7), .loader-text span:nth-child(8), .loader-text span:nth-child(9), .loader-text span:nth-child(10) { animation-delay: .35s; color: #ec4899; }

.loader-bar {
    width: 200px;
    height: 3px;
    background: rgba(255,255,255,.1);
    border-radius: 10px;
    margin-top: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.loader-bar::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg,#3b82f6,#ec4899);
    animation: progressBar 1s ease-in-out infinite;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(59,130,246,0.5);
}

@keyframes spinLoader { to { transform: rotate(360deg) } }
@keyframes pulseLoader { 
    0%,100% { opacity: .5; transform: translate(-50%,-50%) scale(.9) } 
    50% { opacity: 1; transform: translate(-50%,-50%) scale(1.1); text-shadow: 0 0 20px #3b82f6; } 
}
@keyframes fadeInText { to { opacity: 1; transform: translateY(0) } }
@keyframes progressBar { 0% { left: -30% } 50% { width: 60% } 100% { left: 100%; width: 30% } }

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* --- Global Reset & Base (Dark Mode) --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .75rem 1.5rem;
    border-radius: .5rem;
    font-weight: 600;
    transition: all .3s ease;
    cursor: pointer;
    font-size: .95rem;
    gap: .5rem;
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 15px rgba(59,130,246,.4); /* Glow effect */
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(59,130,246,.6);
}

.btn-outline {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    backdrop-filter: blur(5px);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--text-muted);
    box-shadow: 0 0 15px rgba(255,255,255,0.1);
}
