/* Code Puppy - Global Styles & Dark Theme Variables */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');


/* CSS Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Dark Theme Color Palette */
:root {
    /* Primary Colors */
    --cp-primary: #3b82f6;
    --cp-primary-hover: #2563eb;
    --cp-primary-light: #60a5fa;
    
    /* Dark Background Colors */
    --cp-bg-primary: #0f172a;
    --cp-bg-secondary: #1e293b;
    --cp-bg-tertiary: #334155;
    --cp-bg-card: #1e293b;
    --cp-bg-card-hover: #334155;
    
    /* Text Colors */
    --cp-text-primary: #f8fafc;
    --cp-text-secondary: #cbd5e1;
    --cp-text-muted: #94a3b8;
    
    /* Accent Colors */
    --cp-accent-success: #10b981;
    --cp-accent-warning: #f59e0b;
    --cp-accent-error: #ef4444;
    
    /* Border Colors */
    --cp-border: #475569;
    --cp-border-light: #64748b;
    
    /* Shadow */
    --cp-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    --cp-shadow-light: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Base Typography */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--cp-text-primary);
    background: linear-gradient(135deg, var(--cp-bg-primary) 0%, var(--cp-bg-secondary) 100%);
    min-height: 100vh;
}

/* Typography Scale */
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; line-height: 1.2; }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); font-weight: 600; line-height: 1.3; }
h3 { font-size: clamp(1.25rem, 3vw, 1.875rem); font-weight: 600; line-height: 1.4; }
h4 { font-size: 1.5rem; font-weight: 500; }
p { font-size: 1rem; line-height: 1.6; }

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.text-center { text-align: center; }
.text-primary { color: var(--cp-primary); }
.text-secondary { color: var(--cp-text-secondary); }
.text-muted { color: var(--cp-text-muted); }

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--cp-text-secondary);
}

.form-input,
.form-textarea,
.form-select,
select.form-select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--cp-bg-secondary);
    border: 2px solid var(--cp-border);
    border-radius: 0.5rem;
    font-size: 1rem;
    color: var(--cp-text-primary);
    transition: all 0.3s ease;
    font-family: inherit;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Specific styling for select elements */
.form-select,
select.form-select,
select[class*="form-select"] {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.25rem;
    padding-right: 2.5rem !important;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus,
select.form-select:focus {
    outline: none;
    border-color: var(--cp-primary);
    background-color: var(--cp-bg-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Focus state for select with updated arrow color */
.form-select:focus,
select.form-select:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%233b82f6' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Validation */
.valid.modified:not([type=checkbox]) {
    border-color: var(--cp-accent-success);
}

.invalid {
    border-color: var(--cp-accent-error);
}

.validation-message {
    color: var(--cp-accent-error);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Blazor Error UI */
#blazor-error-ui {
    background: var(--cp-accent-error);
    bottom: 0;
    box-shadow: var(--cp-shadow);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: white;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }
}
