/**
 * Angular Material Theme Generator - Professional Styles
 * Modern, clean and elegant design
 */

/* ===== Google Fonts Import ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ===== CSS Variables ===== */
:root {
    /* Colors */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --secondary: #0ea5e9;
    --accent: #06b6d4;
    
    /* Neutrals */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Semantic */
    --success: #10b981;
    --success-light: #d1fae5;
    --error: #ef4444;
    --error-light: #fee2e2;
    --warning: #f59e0b;
    
    /* Backgrounds */
    --bg-gradient-start: #0f172a;
    --bg-gradient-mid: #0c4a6e;
    --bg-gradient-end: #0369a1;
    
    /* Glass effect */
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.2);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --shadow-xl: 0 35px 60px -15px rgb(0 0 0 / 0.3);
    --shadow-glow: 0 0 60px rgba(59, 130, 246, 0.3);
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    
    /* Borders */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-gradient-start);
    background: linear-gradient(135deg, 
        var(--bg-gradient-start) 0%, 
        var(--bg-gradient-mid) 50%, 
        var(--bg-gradient-end) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(14, 165, 233, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(6, 182, 212, 0.08) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
}

/* ===== Header ===== */
.page-title {
    font-size: clamp(1.75rem, 5vw, 3rem);
    font-weight: 700;
    color: white;
    text-align: center;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.page-title .bi-palette {
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-right: 0.25rem;
}

.page-title span {
    transition: all var(--transition);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.page-title span:hover {
    text-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
}

.subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    font-weight: 400;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

/* ===== Main Card ===== */
.main-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    overflow: hidden;
    position: relative;
}

.main-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
}

/* ===== Form Styles ===== */
.form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.optional-label {
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--gray-400);
}

.required-star {
    color: var(--error);
    font-weight: 700;
}

/* Input Group */
.input-group {
    position: relative;
}

.color-input {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    background: white;
    color: var(--gray-800);
    transition: all var(--transition);
    width: 100%;
}

.color-input:hover {
    border-color: var(--gray-300);
}

.color-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.color-input::placeholder {
    color: var(--gray-400);
}

/* Color Picker */
.color-picker {
    width: 52px;
    height: 52px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    padding: 0;
    overflow: hidden;
    transition: transform var(--transition);
    flex-shrink: 0;
}

.color-picker:hover {
    transform: scale(1.05);
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 4px;
}

.color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* ===== Buttons ===== */
.btn-generate {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    padding: 1rem 2rem;
    color: white;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

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

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.4);
}

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

.btn-generate:active {
    transform: translateY(0);
}

.btn-copy {
    background: var(--success);
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    color: white;
    transition: all var(--transition);
}

.btn-copy:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* ===== Color Chips ===== */
.color-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gray-100);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
    transition: all var(--transition);
}

.color-chip:hover {
    background: var(--gray-200);
    transform: translateY(-1px);
}

.color-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

/* ===== Theme Badge ===== */
.theme-badge {
    background: linear-gradient(135deg, var(--gray-800), var(--gray-900));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ===== Code Block ===== */
.code-block {
    background: var(--gray-900);
    border-radius: var(--radius);
    padding: 1.5rem;
    max-height: 450px;
    overflow: auto;
    border: 1px solid var(--gray-700);
    position: relative;
}

.code-block::before {
    content: 'CSS';
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--gray-700);
    color: var(--gray-400);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.code-block pre {
    margin: 0;
    color: var(--gray-300);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Scrollbar styling */
.code-block::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.code-block::-webkit-scrollbar-track {
    background: var(--gray-800);
    border-radius: 4px;
}

.code-block::-webkit-scrollbar-thumb {
    background: var(--gray-600);
    border-radius: 4px;
}

.code-block::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* ===== Error Box ===== */
.error-box {
    background: var(--error-light);
    border: 1px solid #fca5a5;
    border-radius: var(--radius);
    color: #991b1b;
}

.error-box h3 {
    color: #b91c1c;
}

.error-box pre {
    background: white;
    padding: 1rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    overflow-x: auto;
    border: 1px solid #fecaca;
}

/* ===== Back Link ===== */
.back-link {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: all var(--transition);
}

.back-link:hover {
    color: var(--primary-dark);
    gap: 0.5rem;
}

/* ===== Success Header ===== */
.success-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 1.5rem;
}

.success-header h2 {
    color: var(--gray-800);
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.success-header .bi-check-circle-fill {
    color: var(--success);
}

/* ===== Footer ===== */
.footer-text {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.875rem;
    text-align: center;
}

.footer-text a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color var(--transition);
}

.footer-text a:hover {
    color: white;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-card {
    animation: fadeInUp 0.6s ease-out;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .page-title {
        font-size: 1.75rem;
    }
    
    .subtitle {
        font-size: 0.95rem;
        padding: 0 1rem;
    }
    
    .main-card {
        border-radius: var(--radius-lg);
        margin: 0 -0.5rem;
    }
    
    .success-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .color-picker {
        width: 46px;
        height: 46px;
    }
    
    .btn-generate {
        padding: 0.875rem 1.5rem;
    }
}

/* ===== Focus visible for accessibility ===== */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ===== Selection ===== */
::selection {
    background: var(--primary);
    color: white;
}
