/* ============================================
   iSpark Common Styles
   Shared across all pages
   ============================================ */

/* CSS Variables */
:root {
    --primary: #d5271a;
    --primary-dark: #b01f13;
    --primary-light: #e84a3e;
    --accent: #7a7e81;
    --accent-light: #9ba0a3;
    
    /* Platform colors */
    --snowflake: #29b5e8;
    --snowflake-light: #e6f7fd;
    --databricks: #FF3621;
    --databricks-light: #fff5f4;
    --fabric: #1F6B4A;
    --fabric-dark: #155838;
    --fabric-light: #E8F5EE;
    
    /* Neutral colors */
    --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;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 200ms ease;
    --transition-slow: 300ms ease;
}

/* Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Button Styles */
.btn-primary {
    background-color: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all var(--transition-slow);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(213, 39, 26, 0.3);
}

.btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary {
    background-color: var(--accent);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all var(--transition-slow);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #5a5e61;
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all var(--transition-slow);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-outline:hover:not(:disabled) {
    background-color: var(--primary);
    color: white;
}

/* Loading Spinner */
.spinner {
    width: 3rem;
    height: 3rem;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-small {
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-large {
    width: 4rem;
    height: 4rem;
    border: 5px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-overlay.hidden {
    display: none;
}

.loading-overlay-content {
    text-align: center;
    background-color: white;
    padding: 3rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 400px;
}

.loading-overlay-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.loading-overlay-subtext {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-fact {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-dimension {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-ai {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

/* Card Styles */
.card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.card-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--gray-200);
}

.card-body {
    padding: var(--spacing-lg);
}

/* Form Styles */
.form-input {
    width: 100%;
    padding: 0.625rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: all var(--transition-normal);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(213, 39, 26, 0.1);
}

.form-select {
    width: 100%;
    padding: 0.625rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background-color: white;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(213, 39, 26, 0.1);
}

/* Utility Classes */
.text-primary {
    color: var(--primary);
}

.text-accent {
    color: var(--accent);
}

.bg-primary {
    background-color: var(--primary);
}

.border-primary {
    border-color: var(--primary);
}

/* Platform-specific colors */
.text-fabric {
    color: var(--fabric);
}

.bg-fabric {
    background-color: var(--fabric);
}

.bg-fabric:hover {
    background-color: var(--fabric-dark);
}

.bg-fabric-light {
    background-color: var(--fabric-light);
}

.border-fabric {
    border-color: var(--fabric);
}

.text-snowflake {
    color: var(--snowflake);
}

.text-databricks {
    color: var(--databricks);
}

/* Visibility utilities - renamed to avoid Tailwind conflict */
.is-hidden {
    display: none !important;
}

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

/* Flexbox utilities */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

/* Animation utilities */
.transition-all {
    transition: all var(--transition-slow);
}

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

