/**
 * ====================================================================
 * ThirtietHawk Key System - Main Stylesheet
 * ====================================================================
 * Modern dark theme with purple accents and smooth animations
 * ====================================================================
 */

/* ====================================================================
   CSS Variables
   ==================================================================== */
:root {
    --primary-color: #7c3aed;
    --primary-dark: #6d28d9;
    --primary-light: #8b5cf6;

    --secondary-color: #06b6d4;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;

    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;

    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    /* Much lighter gray */
    --text-muted: #e2e8f0;
    /* Very light gray for muted text */

    --border-color: #27272a;
    --border-radius: 12px;

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.3);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ====================================================================
   Base Styles
   ==================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated background particles */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(124, 58, 237, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* ====================================================================
   Navbar
   ==================================================================== */
.navbar {
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary) !important;
    transition: var(--transition);
}

.navbar-brand:hover {
    color: var(--primary-color) !important;
    transform: translateY(-2px);
}

/* ====================================================================
   Hero Section
   ==================================================================== */
.hero-section h1 {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        filter: hue-rotate(0deg);
    }

    50% {
        filter: hue-rotate(10deg);
    }
}

/* ====================================================================
   Key Card
   ==================================================================== */
.key-card {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(22, 33, 62, 0.95) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(10px);
    overflow: hidden;
    position: relative;
    transition: var(--transition);
}

.key-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.key-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(124, 58, 237, 0.2);
}

/* ====================================================================
   Progress Steps
   ==================================================================== */
.progress-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 0;
    position: relative;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 2;
}

.step-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.step.completed .step-icon {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-color: var(--primary-color);
    color: white;
    animation: pulse 2s ease infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.7);
    }

    50% {
        box-shadow: 0 0 0 15px rgba(124, 58, 237, 0);
    }
}

.step-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.step.completed .step-text {
    color: var(--primary-color);
}

.step-line {
    flex: 1;
    height: 3px;
    background: var(--border-color);
    position: relative;
}

/* ====================================================================
   Checkpoint Buttons
   ==================================================================== */
.checkpoint-info {
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.btn-checkpoint {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 600;
    padding: 1.25rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-checkpoint::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.btn-checkpoint:hover::before {
    left: 100%;
}

.btn-checkpoint:hover:not(:disabled) {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(124, 58, 237, 0.3);
}

.btn-checkpoint:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.checkpoint-status {
    float: right;
}

/* ====================================================================
   Key Display
   ==================================================================== */
.success-animation i {
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.key-display input {
    background: #1e1e2e;
    /* Lighter background for better contrast */
    border: 2px solid var(--primary-color);
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    font-family: 'Courier New', monospace;
    padding: 1rem;
}

.key-display input:focus {
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.2);
    border-color: var(--primary-light);
}

.key-info {
    background: rgba(124, 58, 237, 0.05);
    border: 1px solid rgba(124, 58, 237, 0.1);
    border-radius: 8px;
    padding: 1rem;
}

/* ====================================================================
   Info Cards
   ==================================================================== */
.info-card {
    background: rgba(26, 26, 46, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
}

.info-card:hover {
    background: rgba(26, 26, 46, 0.9);
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.info-card i {
    transition: var(--transition);
}

.info-card:hover i {
    transform: scale(1.2);
}

/* ====================================================================
   Buttons
   ==================================================================== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border: none;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(124, 58, 237, 0.3);
}

.btn-outline-light {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    transition: var(--transition);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.btn-outline-secondary {
    border-color: var(--border-color);
    color: var(--text-secondary);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

/* ====================================================================
   Form Controls
   ==================================================================== */
.form-control {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: var(--transition);
}

.form-control:focus {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
    color: var(--text-primary);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* ====================================================================
   Loading Spinner
   ==================================================================== */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* ====================================================================
   Footer
   ==================================================================== */
footer {
    border-top: 1px solid var(--border-color);
}

/* ====================================================================
   Responsive Design
   ==================================================================== */
@media (max-width: 768px) {
    .progress-steps {
        padding: 1rem 0;
    }

    .step-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .step-text {
        font-size: 0.75rem;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .key-display input {
        font-size: 1.1rem;
    }
}

/* ====================================================================
   Utility Classes
   ==================================================================== */
/* Utility overrides */
.text-muted {
    color: var(--text-muted) !important;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-hover {
    transition: var(--transition);
}

.card-hover:hover {
    transform: translateY(-5px);
}

/* ====================================================================
   Animations
   ==================================================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}