/**
 * TF Loader Component
 * Pure CSS loaders for tim-frenzel.com
 * No build step required - works with static HTML
 */

:root {
    --loader-primary: #7A99BB;
    --loader-muted: #455976;
    --loader-bg: #121215;
}

/* Base Loader Container */
.tf-loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Size variants */
.tf-loader--sm { --loader-size: 16px; --loader-text: 12px; }
.tf-loader--md { --loader-size: 20px; --loader-text: 14px; }
.tf-loader--lg { --loader-size: 24px; --loader-text: 16px; }

/* Screen reader only */
.tf-loader .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================
   CIRCULAR LOADER
   ======================================== */
.tf-loader--circular .loader-ring {
    width: var(--loader-size);
    height: var(--loader-size);
    border: 2px solid var(--loader-primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: tf-spin 1s linear infinite;
}

@keyframes tf-spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   DOTS LOADER
   ======================================== */
.tf-loader--dots {
    gap: 4px;
}

.tf-loader--dots .dot {
    width: calc(var(--loader-size) * 0.4);
    height: calc(var(--loader-size) * 0.4);
    background: var(--loader-primary);
    border-radius: 50%;
    animation: tf-bounce-dots 1.4s ease-in-out infinite;
}

.tf-loader--dots .dot:nth-child(2) { animation-delay: 0.16s; }
.tf-loader--dots .dot:nth-child(3) { animation-delay: 0.32s; }

@keyframes tf-bounce-dots {
    0%, 100% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
}

/* ========================================
   PULSE LOADER
   ======================================== */
.tf-loader--pulse .pulse-ring {
    width: var(--loader-size);
    height: var(--loader-size);
    border: 2px solid var(--loader-primary);
    border-radius: 50%;
    animation: tf-pulse 1.5s ease-in-out infinite;
}

@keyframes tf-pulse {
    0%, 100% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 0.4; }
}

/* ========================================
   WAVE LOADER (Bars)
   ======================================== */
.tf-loader--wave {
    gap: 3px;
    height: var(--loader-size);
}

.tf-loader--wave .bar {
    width: 3px;
    background: var(--loader-primary);
    border-radius: 2px;
    animation: tf-wave 1s ease-in-out infinite;
}

.tf-loader--wave .bar:nth-child(1) { height: 40%; animation-delay: 0s; }
.tf-loader--wave .bar:nth-child(2) { height: 60%; animation-delay: 0.1s; }
.tf-loader--wave .bar:nth-child(3) { height: 80%; animation-delay: 0.2s; }
.tf-loader--wave .bar:nth-child(4) { height: 60%; animation-delay: 0.3s; }
.tf-loader--wave .bar:nth-child(5) { height: 40%; animation-delay: 0.4s; }

@keyframes tf-wave {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.6); }
}

/* ========================================
   TERMINAL LOADER
   ======================================== */
.tf-loader--terminal {
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--loader-text);
    color: var(--loader-primary);
    gap: 4px;
}

.tf-loader--terminal .prompt {
    opacity: 0.8;
}

.tf-loader--terminal .cursor {
    width: 8px;
    height: calc(var(--loader-text) + 2px);
    background: var(--loader-primary);
    animation: tf-blink 1s step-end infinite;
}

@keyframes tf-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ========================================
   TEXT BLINK LOADER
   ======================================== */
.tf-loader--text-blink {
    font-family: 'Roboto', sans-serif;
    font-size: var(--loader-text);
    font-weight: 500;
    animation: tf-text-blink 2s ease-in-out infinite;
}

@keyframes tf-text-blink {
    0%, 100% { color: var(--loader-primary); }
    50% { color: var(--loader-muted); }
}

/* ========================================
   TEXT SHIMMER LOADER
   ======================================== */
.tf-loader--text-shimmer {
    font-family: 'Roboto', sans-serif;
    font-size: var(--loader-text);
    font-weight: 500;
    background: linear-gradient(
        to right,
        var(--loader-muted) 40%,
        var(--loader-primary) 60%,
        var(--loader-muted) 80%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: tf-shimmer 3s linear infinite;
}

@keyframes tf-shimmer {
    0% { background-position: 200% 50%; }
    100% { background-position: -200% 50%; }
}

/* ========================================
   LOADING DOTS (Text + Dots)
   ======================================== */
.tf-loader--loading-dots {
    font-family: 'Roboto', sans-serif;
    font-size: var(--loader-text);
    font-weight: 500;
    color: var(--loader-primary);
}

.tf-loader--loading-dots .dots span {
    animation: tf-loading-dots 1.4s infinite;
    opacity: 0;
}

.tf-loader--loading-dots .dots span:nth-child(1) { animation-delay: 0.2s; }
.tf-loader--loading-dots .dots span:nth-child(2) { animation-delay: 0.4s; }
.tf-loader--loading-dots .dots span:nth-child(3) { animation-delay: 0.6s; }

@keyframes tf-loading-dots {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* ========================================
   TYPING LOADER
   ======================================== */
.tf-loader--typing {
    gap: 4px;
}

.tf-loader--typing .dot {
    width: 6px;
    height: 6px;
    background: var(--loader-primary);
    border-radius: 50%;
    animation: tf-typing 1s infinite;
}

.tf-loader--typing .dot:nth-child(2) { animation-delay: 0.25s; }
.tf-loader--typing .dot:nth-child(3) { animation-delay: 0.5s; }

@keyframes tf-typing {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    50% { transform: translateY(-4px); opacity: 1; }
}

/* ========================================
   BARS LOADER
   ======================================== */
.tf-loader--bars {
    gap: 4px;
    height: var(--loader-size);
}

.tf-loader--bars .bar {
    width: 4px;
    height: 100%;
    background: var(--loader-primary);
    animation: tf-bars 1.2s ease-in-out infinite;
}

.tf-loader--bars .bar:nth-child(2) { animation-delay: 0.2s; }
.tf-loader--bars .bar:nth-child(3) { animation-delay: 0.4s; }

@keyframes tf-bars {
    0%, 100% { transform: scaleY(1); opacity: 0.5; }
    50% { transform: scaleY(0.5); opacity: 1; }
}

