/* ============================================
   Range Lab - Components
   Premium Dark Green Casino Theme
   ============================================ */

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-primary);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    line-height: 1;
    text-transform: none;
    letter-spacing: 0.01em;
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
    border-radius: var(--radius-md);
}

.btn-lg {
    padding: var(--space-4) var(--space-10);
    font-size: var(--text-base);
    border-radius: var(--radius-xl);
}

.btn-primary {
    background: var(--gradient-primary);
    color: #1d170c;
    border-color: transparent;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35), 0 0 24px rgba(215, 168, 74, 0.25);
}

.btn-primary:hover {
    background: var(--gradient-primary-hover);
    box-shadow: var(--shadow-glow-strong), inset 0 1px 0 rgba(255,255,255,0.25);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 212, 106, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-primary);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    border-radius: var(--radius-lg);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(215, 168, 74, 0.18);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
    border-color: transparent;
    border-radius: var(--radius-md);
}

.btn-ghost:hover {
    color: var(--color-primary);
    background: rgba(215, 168, 74, 0.12);
}

/* Theme Toggle Icon */
.theme-icon {
    font-family: var(--font-primary);
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    letter-spacing: 0.05em;
}

#theme-toggle {
    min-width: 44px;
    padding: var(--space-2) var(--space-3);
    cursor: pointer;
    position: relative;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

#theme-toggle svg {
    pointer-events: none;
}

#theme-toggle:hover {
    background: var(--color-primary-muted);
}

.btn-danger {
    background: var(--gradient-red);
    color: #140d0c;
    border-color: transparent;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.btn-danger:hover {
    box-shadow: 0 0 30px rgba(255, 71, 87, 0.4);
    transform: translateY(-2px);
}

.btn-success {
    background: var(--gradient-primary);
    color: #1d170c;
    border-color: transparent;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.btn-success:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn:disabled::before {
    display: none;
}

/* ===== Cards ===== */
.card {
    background: var(--gradient-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    transition: all var(--transition-base);
    position: relative;
    box-shadow: var(--shadow-card);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(215, 168, 74, 0.6), transparent);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.card-hover:hover {
    border-color: var(--color-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(215, 168, 74, 0.18);
}

.card-hover:hover::before {
    opacity: 1;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.card-title {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--color-text-primary);
}

.card-body {
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
}

/* ===== Inputs ===== */
.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.input-label {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input {
    padding: var(--space-3) var(--space-4);
    background: var(--color-bg-input);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    font-size: var(--text-base);
    transition: all var(--transition-base);
}

.input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-muted), 0 0 20px rgba(0, 212, 106, 0.1);
}

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

.input-lg {
    padding: var(--space-4) var(--space-5);
    font-size: var(--text-lg);
}

select.input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2300d46a'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
    background-size: 16px;
    padding-right: var(--space-10);
}

textarea.input {
    resize: vertical;
    min-height: 120px;
}

/* ===== Tags/Badges ===== */
.tag {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: 1px solid;
    border-radius: var(--radius-md);
}

.tag-gold {
    background: var(--color-gold-muted);
    color: var(--color-gold);
    border-color: var(--color-gold);
}

.tag-green {
    background: var(--color-primary-muted);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.tag-red {
    background: rgba(255, 71, 87, 0.15);
    color: var(--color-red);
    border-color: var(--color-red);
}

.tag-blue {
    background: rgba(0, 212, 255, 0.15);
    color: var(--color-blue);
    border-color: var(--color-blue);
}

.tag-purple {
    background: rgba(168, 85, 247, 0.15);
    color: var(--color-purple);
    border-color: var(--color-purple);
}

/* ===== Progress Bar ===== */
.progress-bar {
    height: 6px;
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-base);
    box-shadow: 0 0 10px rgba(0, 212, 106, 0.5);
}

/* ===== Toggle Switch ===== */
.toggle-group {
    display: inline-flex;
    background: var(--color-bg-tertiary);
    padding: var(--space-1);
    gap: var(--space-1);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.toggle-btn {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.toggle-btn:hover {
    color: var(--color-text-primary);
}

.toggle-btn.active {
    background: var(--gradient-primary);
    color: #000;
    box-shadow: 0 2px 10px rgba(0, 212, 106, 0.3);
}

/* ===== Playing Cards ===== */
.playing-card {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 78px;
    background: linear-gradient(145deg, #ffffff 0%, #e8e8e8 100%);
    border: 2px solid rgba(0, 212, 106, 0.3);
    border-radius: var(--radius-lg);
    font-family: var(--font-mono);
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--color-suit-spade);
    box-shadow:
        0 4px 15px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.8),
        0 0 20px rgba(0, 212, 106, 0.1);
    transition: all var(--transition-base);
}

.playing-card:hover {
    transform: translateY(-4px) rotate(2deg);
    box-shadow:
        0 8px 25px rgba(0,0,0,0.4),
        0 0 30px rgba(0, 212, 106, 0.2);
}

.playing-card.red {
    color: var(--color-suit-heart);
}

.playing-card-lg {
    width: 80px;
    height: 112px;
    font-size: var(--text-3xl);
    border-radius: var(--radius-xl);
}

.playing-card-sm {
    width: 40px;
    height: 56px;
    font-size: var(--text-base);
    border-radius: var(--radius-md);
}

/* ===== Stat Display ===== */
.stat-box {
    display: flex;
    flex-direction: column;
    padding: var(--space-5);
    background: var(--gradient-card);
    border-left: 4px solid var(--color-primary);
    border-radius: var(--radius-lg);
}

.stat-value {
    font-family: var(--font-mono);
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
    color: var(--color-primary);
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-top: var(--space-2);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ===== Bankroll Display ===== */
.bankroll-display {
    background: var(--gradient-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-4);
}

.bankroll-amount {
    font-family: var(--font-mono);
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    color: var(--color-text-primary);
}

.bankroll-change {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
}

.bankroll-change.positive {
    color: var(--color-primary);
}

.bankroll-change.negative {
    color: var(--color-red);
}

/* ===== Level Badge ===== */
.level-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--color-primary-muted);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--color-primary);
}

/* ===== Skill Radar (Pentagon) ===== */
.skill-radar {
    width: 150px;
    height: 150px;
    position: relative;
}

/* ===== Toast ===== */
.toast-container {
    position: fixed;
    top: calc(var(--nav-height) + var(--space-4));
    right: var(--space-4);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-width: 400px;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    padding-bottom: var(--space-3);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    min-width: 300px;
}

.toast-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.toast-message {
    flex: 1;
    font-size: var(--text-sm);
    line-height: 1.4;
    color: var(--color-text-primary);
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color var(--transition-fast);
}

.toast-close:hover {
    color: var(--color-text-primary);
}

/* Toast Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--color-bg-tertiary);
}

.toast-progress-bar {
    height: 100%;
    background: currentColor;
    animation: toastProgress linear forwards;
    transform-origin: left;
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* Toast Types */
.toast.success {
    border-left: 4px solid var(--color-green);
}
.toast.success .toast-icon { color: var(--color-green); }
.toast.success .toast-progress-bar { background: var(--color-green); }

.toast.error {
    border-left: 4px solid var(--color-red);
}
.toast.error .toast-icon { color: var(--color-red); }
.toast.error .toast-progress-bar { background: var(--color-red); }

.toast.info {
    border-left: 4px solid var(--color-blue);
}
.toast.info .toast-icon { color: var(--color-blue); }
.toast.info .toast-progress-bar { background: var(--color-blue); }

.toast.warning {
    border-left: 4px solid var(--color-gold);
}
.toast.warning .toast-icon { color: var(--color-gold); }
.toast.warning .toast-progress-bar { background: var(--color-gold); }

/* Toast Animations */
@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: var(--space-16) var(--space-8);
    color: var(--color-text-muted);
}

/* ===== Skeleton Loading ===== */
.skeleton {
    background: linear-gradient(90deg, var(--color-bg-tertiary) 25%, var(--color-bg-elevated) 50%, var(--color-bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== Glow Effects ===== */
.glow-green {
    box-shadow: var(--shadow-glow);
}

.glow-gold {
    box-shadow: var(--shadow-glow-gold);
}

/* ===== Theme Toggle Icon ===== */
.theme-icon {
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    letter-spacing: 0.05em;
}
