/* ============================================================================
   GLOBAL STYLES & RESET
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --primary-light: #a78bfa;
    --secondary: #ec4899;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;

    /* Backgrounds */
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.6);
    --bg-input: rgba(15, 23, 42, 0.8);

    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    /* Borders */
    --border-color: rgba(148, 163, 184, 0.2);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4);

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* Animated background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 0.8;
    }
}

/* ============================================================================
   CONTAINER & LAYOUT
   ============================================================================ */

.container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* ============================================================================
   CARDS
   ============================================================================ */

.login-card,
.dashboard-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: var(--shadow-xl);
    max-width: 450px;
    width: 100%;
    animation: fadeInUp 0.6s ease-out;
}

.dashboard-card {
    max-width: 900px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================
   LOGO & BRANDING
   ============================================================================ */

.logo-section {
    text-align: center;
    margin-bottom: 2.5rem;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.wolf-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.logo-container {
    text-align: center;
}

/* ============================================================================
   FORMS
   ============================================================================ */

.login-form,
.user-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-row {
    display: flex;
    gap: 0.75rem;
}

label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

input[type="text"],
input[type="password"] {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.875rem 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

input[type="text"]:focus,
input[type="password"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

input::placeholder {
    color: var(--text-muted);
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn-primary,
.btn-secondary,
.btn-remove {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-primary);
}

.btn-remove {
    background: transparent;
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    font-size: 1.5rem;
    line-height: 1;
    border-radius: 8px;
}

.btn-remove:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

/* ============================================================================
   MESSAGES
   ============================================================================ */

.error-message,
.message {
    padding: 0.875rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-message,
.message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.error-message.error-blocked {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fcd34d;
}

.message.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

/* ============================================================================
   DASHBOARD
   ============================================================================ */

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.input-section,
.status-section {
    margin-bottom: 2rem;
}

.input-section h2,
.status-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* ============================================================================
   STATUS CARDS
   ============================================================================ */

.status-container {
    display: grid;
    gap: 1rem;
}

.status-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    transition: var(--transition);
}

.status-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

.status-card.ready {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.status-card.processing {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.05);
}

.status-card.success {
    border-color: var(--success);
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.user-id {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

.status-body {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.status-icon {
    font-size: 2rem;
    line-height: 1;
}

.status-info {
    flex: 1;
}

.status-message {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.countdown {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.25rem;
}

.countdown .label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.countdown .time {
    color: var(--primary-light);
    font-weight: 600;
    font-size: 1rem;
}

.last-claim {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ============================================================================
   PROCESSING ANIMATION
   ============================================================================ */

.processing-animation {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.chest-spinner {
    font-size: 3rem;
    animation: spin 2s linear infinite;
    display: inline-block;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.processing-animation p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* ============================================================================
   SPINNERS
   ============================================================================ */

.spinner,
.spinner-large {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.spinner-large {
    width: 48px;
    height: 48px;
    border-width: 3px;
    margin: 0 auto 1rem;
}

/* ============================================================================
   EMPTY & ERROR STATES
   ============================================================================ */

.loading,
.empty-state,
.error-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.empty-state .hint {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.error-state {
    color: var(--error);
}

/* ============================================================================
   ADMIN PANEL
   ============================================================================ */

.admin-panel {
    margin-top: 2rem;
}

.admin-users-container {
    margin-top: 1.5rem;
}

.admin-users-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.admin-user-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    transition: var(--transition);
}

.admin-user-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

.admin-user-card.ready {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.admin-user-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.admin-user-header h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.user-id-small {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
}

.admin-user-status {
    margin-bottom: 1rem;
}

.status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.status-row .label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.status-row .value {
    color: var(--text-primary);
    font-weight: 500;
}

.status-row .value.ready {
    color: var(--success);
}

.btn-claim-admin {
    width: 100%;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-claim-admin:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

/* ============================================================================
   CLAIM BUTTON
   ============================================================================ */

.btn-claim {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-claim:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

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

.header-actions {
    display: flex;
    gap: 0.75rem;
}

/* ============================================================================
   WELCOME BOX
   ============================================================================ */

.welcome-box {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideIn 0.3s ease-out;
}

.welcome-box.new {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

.welcome-box.returning {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
}

.welcome-icon {
    font-size: 2rem;
    line-height: 1;
}

.welcome-box p {
    color: var(--text-primary);
    font-size: 1rem;
    margin: 0;
}

/* ============================================================================
   HEADER
   ============================================================================ */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.logout-btn {
    padding: 0.5rem 1rem;
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.logout-btn:hover {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-primary);
}

/* ============================================================================
   USER ID FORM
   ============================================================================ */

.user-id-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.message-container {
    margin-top: 1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row.highlight {
    background: rgba(139, 92, 246, 0.05);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin: 0.5rem 0;
}

.info-row .label {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.info-row .value {
    color: var(--text-primary);
    font-weight: 600;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }

    .login-card,
    .dashboard-card {
        padding: 2rem 1.5rem;
    }

    .title {
        font-size: 2rem;
    }

    .form-row {
        flex-direction: column;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}
/* ============================================================================
   PROGRESS MODAL
   ============================================================================ */

.progress-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

.progress-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease-out;
}

.progress-modal-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.progress-bar-container {
    width: 100%;
    height: 30px;
    background: rgba(15, 23, 42, 0.8);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 15px;
    transition: width 0.5s ease-out;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

.progress-modal-content p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 1rem;
}

#progressPercent {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-light);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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