/**
 * Common CSS - Shared styles and CSS variables
 */

/* CSS Variables */
:root {
    /* Colors */
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --primary-light: rgba(79, 70, 229, 0.1);

    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;

    --background: #0F172A;
    --surface: #1E293B;
    --surface-elevated: #334155;

    --border: #334155;
    --border-light: #475569;

    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);

    /* Spacing */
    --header-height: 56px;
    --controls-height: 72px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
}

/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Base */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
}

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

a:hover {
    text-decoration: underline;
}

/* Buttons */
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

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

/* Inputs */
input {
    font-family: inherit;
    font-size: inherit;
}

input:focus {
    outline: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Toast notifications */
#toast-container {
    position: fixed;
    bottom: calc(var(--controls-height) + 20px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    background: var(--surface-elevated);
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-normal);
    pointer-events: auto;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-info {
    border-left: 4px solid var(--primary);
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-warning {
    border-left: 4px solid var(--warning);
}

.toast-error {
    border-left: 4px solid var(--error);
}

/* Utility classes */
.hidden {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Responsive breakpoints */
@media (max-width: 768px) {
    :root {
        --header-height: 48px;
        --controls-height: 64px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
}
