/* QMLS Theme CSS Variables and Utilities */

:root {
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;
    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 222.2 84% 4.9%;
    --primary: 222.2 47.4% 11.2%;
    --primary-foreground: 210 40% 98%;
    --secondary: 210 40% 96.1%;
    --secondary-foreground: 222.2 47.4% 11.2%;
    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;
    --accent: 210 40% 96.1%;
    --accent-foreground: 222.2 47.4% 11.2%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 40% 98%;
    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 222.2 84% 4.9%;
    --radius: 0.5rem;
}

.dark {
    --background: 222.2 84% 4.9%;
    --foreground: 210 40% 98%;
    --card: 222.2 84% 4.9%;
    --card-foreground: 210 40% 98%;
    --popover: 222.2 84% 4.9%;
    --popover-foreground: 210 40% 98%;
    --primary: 210 40% 98%;
    --primary-foreground: 222.2 47.4% 11.2%;
    --secondary: 217.2 32.6% 17.5%;
    --secondary-foreground: 210 40% 98%;
    --muted: 217.2 32.6% 17.5%;
    --muted-foreground: 215 20.2% 65.1%;
    --accent: 217.2 32.6% 17.5%;
    --accent-foreground: 210 40% 98%;
    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 210 40% 98%;
    --border: 217.2 32.6% 17.5%;
    --input: 217.2 32.6% 17.5%;
    --ring: 212.7 26.8% 83.9%;
}

/* Background Colors */
.bg-background { background-color: hsl(var(--background)); }
.bg-card { background-color: hsl(var(--card)); }
.bg-primary { background-color: hsl(var(--primary)); }
.bg-secondary { background-color: hsl(var(--secondary)); }
.bg-accent { background-color: hsl(var(--accent)); }
.bg-muted { background-color: hsl(var(--muted)); }
.bg-destructive { background-color: hsl(var(--destructive)); }

/* Text Colors */
.text-foreground { color: hsl(var(--foreground)); }
.text-card-foreground { color: hsl(var(--card-foreground)); }
.text-primary { color: hsl(var(--primary)); }
.text-primary-foreground { color: hsl(var(--primary-foreground)); }
.text-secondary-foreground { color: hsl(var(--secondary-foreground)); }
.text-accent-foreground { color: hsl(var(--accent-foreground)); }
.text-muted-foreground { color: hsl(var(--muted-foreground)); }
.text-destructive { color: hsl(var(--destructive)); }
.text-destructive-foreground { color: hsl(var(--destructive-foreground)); }

/* Border Colors */
.border-border { border-color: hsl(var(--border)); }
.border-input { border-color: hsl(var(--input)); }

/* Hover States */
.hover\:bg-accent:hover { background-color: hsl(var(--accent)); }
.hover\:bg-secondary:hover { background-color: hsl(var(--secondary)); }
.hover\:bg-primary\/90:hover { background-color: hsl(var(--primary) / 0.9); }
.hover\:bg-muted:hover { background-color: hsl(var(--muted)); }
.hover\:text-foreground:hover { color: hsl(var(--foreground)); }
.hover\:text-accent-foreground:hover { color: hsl(var(--accent-foreground)); }
.hover\:text-muted-foreground:hover { color: hsl(var(--muted-foreground)); }

/* Focus States */
.focus\:bg-accent:focus { background-color: hsl(var(--accent)); }
.focus\:text-accent-foreground:focus { color: hsl(var(--accent-foreground)); }
.focus\:ring-ring:focus { --tw-ring-color: hsl(var(--ring)); }

/* Card Component */
.qmls-card {
    background-color: hsl(var(--card));
    color: hsl(var(--card-foreground));
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
}

/* Button Component */
.qmls-btn {
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.qmls-btn-primary {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.qmls-btn-primary:hover {
    background-color: hsl(var(--primary) / 0.9);
}

.qmls-btn-secondary {
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
}

.qmls-btn-secondary:hover {
    background-color: hsl(var(--secondary) / 0.9);
}

.qmls-btn-ghost {
    background-color: transparent;
    color: hsl(var(--foreground));
}

.qmls-btn-ghost:hover {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.qmls-btn-destructive {
    background-color: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
}

.qmls-btn-destructive:hover {
    background-color: hsl(var(--destructive) / 0.9);
}

/* Input Component */
.qmls-input {
    background-color: hsl(var(--background));
    border: 1px solid hsl(var(--input));
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    color: hsl(var(--foreground));
    transition: border-color 0.2s;
}

.qmls-input:focus {
    outline: none;
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 3px hsl(var(--ring) / 0.1);
}

/* Badge Component */
.qmls-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.qmls-badge-primary {
    background-color: hsl(var(--primary) / 0.1);
    color: hsl(var(--primary));
}

.qmls-badge-secondary {
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
}

.qmls-badge-destructive {
    background-color: hsl(var(--destructive) / 0.1);
    color: hsl(var(--destructive));
}

.qmls-badge-success {
    background-color: hsl(142 76% 36% / 0.1);
    color: hsl(142 76% 36%);
}

/* Alert Component */
.qmls-alert {
    border: 1px solid;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.qmls-alert-info {
    background-color: hsl(var(--primary) / 0.05);
    border-color: hsl(var(--primary) / 0.2);
    color: hsl(var(--primary));
}

.qmls-alert-success {
    background-color: hsl(142 76% 36% / 0.05);
    border-color: hsl(142 76% 36% / 0.2);
    color: hsl(142 76% 36%);
}

.qmls-alert-warning {
    background-color: hsl(38 92% 50% / 0.05);
    border-color: hsl(38 92% 50% / 0.2);
    color: hsl(38 92% 50%);
}

.qmls-alert-error {
    background-color: hsl(var(--destructive) / 0.05);
    border-color: hsl(var(--destructive) / 0.2);
    color: hsl(var(--destructive));
}

/* Table Component */
.qmls-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.qmls-table th {
    background-color: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
    font-weight: 500;
    text-align: left;
    padding: 0.75rem;
    border-bottom: 1px solid hsl(var(--border));
}

.qmls-table td {
    padding: 0.75rem;
    border-bottom: 1px solid hsl(var(--border));
    color: hsl(var(--foreground));
}

.qmls-table tbody tr:hover {
    background-color: hsl(var(--accent) / 0.5);
}

/* Utility Classes */
.rounded-lg { border-radius: var(--radius); }
.rounded-md { border-radius: calc(var(--radius) - 2px); }
.rounded-sm { border-radius: calc(var(--radius) - 4px); }

/* Animations */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

/* Transitions */
.transition-all { transition: all 0.2s; }
.transition-colors { transition: background-color 0.2s, color 0.2s, border-color 0.2s; }

/* Alpine.js Cloak */
[x-cloak] { display: none !important; }