/*
 * ShowRunner - Base Styles
 * Imports design tokens and establishes global styling
 */

@import "./styles/tokens.css";

/* ============================================
 * RESET & BASE
 * Note: tokens.css provides body, *, scrollbar styles
 * ============================================ */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    text-rendering: optimizeLegibility;
}

html,
body {
    overflow: hidden;
    height: 100%;
    width: 100%;
}

#root {
    width: 100%;
    height: 100%;
    overflow: hidden;
    isolation: isolate;
}

/* ============================================
 * TYPOGRAPHY UTILITIES
 * ============================================ */

.font-mono {
    font-family: var(--font-mono);
    font-feature-settings:
        "liga" 1,
        "calt" 1;
    letter-spacing: var(--tracking-mono);
}

.text-primary {
    color: var(--text-primary);
}
.text-secondary {
    color: var(--text-secondary);
}
.text-tertiary {
    color: var(--text-tertiary);
}
.text-muted {
    color: var(--text-muted);
}

/* ============================================
 * SCROLLBAR STYLING
 * ============================================ */

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-strong);
    background-clip: content-box;
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-default) transparent;
}

/* ============================================
 * FOCUS STYLES
 * ============================================ */

:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* ============================================
 * SELECTION
 * ============================================ */

::selection {
    background-color: var(--accent-primary-muted);
    color: var(--text-primary);
}

/* ============================================
 * BUTTON BASE STYLES
 * ============================================ */

button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
    transition: var(--transition-all);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* ============================================
 * INPUT BASE STYLES
 * ============================================ */

input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--input-radius);
    transition: var(--transition-colors);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-tertiary);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-muted);
}

/* ============================================
 * LINK STYLES
 * ============================================ */

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: var(--transition-colors);
}

a:hover {
    color: var(--accent-primary-hover);
}

/* ============================================
 * CODE & PRE
 * ============================================ */

code,
pre,
kbd {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

code {
    background-color: var(--bg-muted);
    padding: 0.125em 0.375em;
    border-radius: var(--radius-sm);
    color: var(--accent-terminal);
}

pre {
    background-color: var(--bg-muted);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    overflow-x: auto;
}

kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5em;
    height: 1.5em;
    padding: 0 0.375em;
    background: var(--kbd-bg);
    border: 1px solid var(--kbd-border);
    border-radius: var(--kbd-radius);
    font-size: var(--kbd-size);
    font-weight: var(--weight-medium);
    color: var(--text-secondary);
    box-shadow: 0 1px 0 var(--border-strong);
}

/* ============================================
 * UTILITY CLASSES
 * ============================================ */

/* Glass effect for floating elements */
.glass {
    background: rgba(15, 15, 18, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-default);
}

.glass-subtle {
    background: rgba(15, 15, 18, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
}

/* Card styling */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    transition: var(--transition-all);
}

.card:hover {
    background: var(--card-bg-hover);
    border-color: var(--card-border-hover);
}

.card-interactive {
    cursor: pointer;
}

.card-interactive:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Surface elevation */
.surface-base {
    background: var(--bg-base);
}
.surface-elevated {
    background: var(--bg-elevated);
}
.surface-muted {
    background: var(--bg-muted);
}

/* Border utilities */
.border-subtle {
    border-color: var(--border-subtle);
}
.border-default {
    border-color: var(--border-default);
}
.border-strong {
    border-color: var(--border-strong);
}

/* ============================================
 * ANIMATION UTILITIES
 * ============================================ */

.animate-pulse-record {
    animation: pulse-record 1.5s ease-in-out infinite;
}

.animate-pulse-subtle {
    animation: pulse-subtle 2s ease-in-out infinite;
}

.animate-glow {
    animation: glow-primary 2s ease-in-out infinite;
}

.animate-fade-in {
    animation: fade-in var(--duration-normal) var(--ease-out);
}

.animate-fade-in-up {
    animation: fade-in-up var(--duration-slow) var(--ease-out);
}

.animate-scale-in {
    animation: scale-in var(--duration-normal) var(--ease-bounce);
}

.animate-slide-in-right {
    animation: slide-in-right var(--duration-slow) var(--ease-out);
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-muted) 25%,
        var(--bg-hover) 50%,
        var(--bg-muted) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ============================================
 * KEYBOARD SHORTCUT STYLING
 * ============================================ */

.kbd-group {
    display: inline-flex;
    align-items: center;
    gap: 0.25em;
}

.kbd-plus::after {
    content: "+";
    margin: 0 0.125em;
    color: var(--text-muted);
}

/* ============================================
 * TRANSITIONS FOR INTERACTIVE ELEMENTS
 * ============================================ */

.transition-colors {
    transition: var(--transition-colors);
}

.transition-transform {
    transition: var(--transition-transform);
}

.transition-all {
    transition: var(--transition-all);
}

/* Hover lift effect */
.hover-lift {
    transition:
        transform var(--duration-normal) var(--ease-out),
        box-shadow var(--duration-normal) var(--ease-out);
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ============================================
 * RECORDING STATE INDICATORS
 * ============================================ */

.recording-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--accent-record);
    animation: pulse-record 1.5s ease-in-out infinite;
}

.recording-border {
    border-color: var(--accent-record) !important;
    box-shadow: 0 0 0 1px var(--accent-record-glow);
}

/* ============================================
 * BADGE STYLES
 * ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 0.125rem 0.5rem;
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    border-radius: var(--radius-sm);
    line-height: var(--leading-tight);
}

.badge-primary {
    background: var(--accent-primary-muted);
    color: var(--accent-primary);
}

.badge-success {
    background: var(--accent-success-muted);
    color: var(--accent-success);
}

.badge-warning {
    background: var(--accent-warning-muted);
    color: var(--accent-warning);
}

.badge-info {
    background: var(--accent-info-muted);
    color: var(--accent-info);
}

.badge-terminal {
    background: var(--accent-terminal-muted);
    color: var(--accent-terminal);
}

/* ============================================
 * EMPTY STATE STYLING
 * ============================================ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-16) var(--space-8);
    text-align: center;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: var(--space-4);
    opacity: 0.3;
}

.empty-state-title {
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.empty-state-description {
    font-size: var(--text-base);
    color: var(--text-tertiary);
    margin-bottom: var(--space-6);
    max-width: 320px;
}

/* ============================================
 * LEGACY COMPATIBILITY
 * Keep old variables working during migration
 * ============================================ */

:root {
    --font-main: var(--font-sans);
    --bg-deep: var(--bg-base);
    --bg-soft: var(--bg-elevated);
    --accent: var(--accent-primary);
    --accent-glow: var(--accent-primary-glow);
    --text-main: var(--text-primary);
    --text-dim: var(--text-secondary);
    --border: var(--border-default);
}
