/* ===================================
   Modern Workflow Theme System
   Clean, Minimal, Professional
   =================================== */

/* ===================================
   CSS Variables - Light Theme
   =================================== */
:root {
    /* Primary Blue - Asana-inspired */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;

    /* 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;

    /* Semantic Colors */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    /* Background Colors */
    --bg-app: #fafafa;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-hover: #f3f4f6;

    /* Text Colors */
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;

    /* Border Colors */
    --border-light: #e5e7eb;
    --border-medium: #d1d5db;
    --border-dark: #9ca3af;

    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --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);
    --shadow-focus: 0 0 0 3px rgba(59, 130, 246, 0.1);

    /* Spacing Scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout */
    --sidebar-width: 240px;
    --header-height: 64px;
}

/* ===================================
   Dark Theme
   =================================== */
[data-theme="dark"] {
    --bg-app: #0f1419;
    --bg-sidebar: #1a1f25;
    --bg-card: #1a1f25;
    --bg-secondary: #0f1419;
    --bg-hover: #2a2f35;

    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-tertiary: #6b7280;

    --border-light: #2a2f35;
    --border-medium: #374151;
    --border-dark: #4b5563;

    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

/* ===================================
   Base Styles
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-app);
}

/* ===================================
   Layout Components
   =================================== */
.workflow-app {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* Main Area */
.workflow-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.workflow-header {
    height: var(--header-height);
    padding: 0 var(--space-6);
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-shrink: 0;
}

.header-title {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    gap: var(--space-2);
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.btn-ghost {
    background: transparent;
}

/* Main Content */
.workflow-content {
    flex: 1;
    overflow-y: auto;
    background-color: var(--bg-app);
}

/* ===================================
   Button Styles
   =================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--primary-600);
    color: white;
    border-color: var(--primary-600);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-700);
    border-color: var(--primary-700);
}

.btn-secondary {
    background-color: white;
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--bg-hover);
}

[data-theme="dark"] .btn-secondary {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

[data-theme="dark"] .btn-secondary:hover:not(:disabled) {
    background-color: var(--bg-hover);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 15px;
}

/* ===================================
   Card Styles
   =================================== */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-header {
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--border-light);
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
}

.card-body {
    padding: var(--space-6);
}

/* ===================================
   Utility Classes
   =================================== */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary-600);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Flexbox Utilities */
.d-flex {
    display: flex;
}

.justify-content-center {
    justify-content: center;
}

.align-items-center {
    align-items: center;
}

.flex-column {
    flex-direction: column;
}

/* Sizing */
.vh-100 {
    height: 100vh;
}

.w-100 {
    width: 100%;
}

/* Background */
.bg-light {
    background-color: var(--bg-secondary);
}

/* Text */
.text-center {
    text-align: center;
}

.fw-bold {
    font-weight: 700;
}

.fst-italic {
    font-style: italic;
}

/* Spacing */
.mb-3 {
    margin-bottom: var(--space-3);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.pt-5 {
    padding-top: var(--space-10);
}

.pb-5 {
    padding-bottom: var(--space-10);
}

.px-4 {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
}

/* Shadow */
.shadow-lg {
    box-shadow: var(--shadow-lg);
}

/* Form Controls */
.form-control {
    width: 100%;
    padding: 10px 12px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: var(--shadow-focus);
}

.form-control::placeholder {
    color: var(--text-tertiary);
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

/* Alerts */
.alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    margin-bottom: var(--space-4);
}

.alert-danger {
    background-color: #fee;
    border-color: #fcc;
    color: #c00;
}

[data-theme="dark"] .alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background-color: #efe;
    border-color: #cfc;
    color: #0a0;
}

[data-theme="dark"] .alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #86efac;
}

/* Login Specific */
.auth-layout {
    width: 100%;
    height: 100vh;
    background-color: var(--bg-app);
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

/* ===================================
   Modal Close Button - Dark Mode Support
   =================================== */
.btn-close {
    filter: var(--btn-close-filter, invert(0));
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.btn-close:hover {
    opacity: 1;
}

[data-theme="dark"] .btn-close,
body.dark-mode .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ===================================
   Sidebar User Profile with Settings
   =================================== */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md, 6px);
    color: var(--text-secondary);
    background-color: transparent;
    transition: all 0.2s ease;
    text-decoration: none;
    margin-left: auto;
}

.user-settings-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-hover);
}

.user-settings-btn i {
    font-size: 18px;
}

/* ===================================
   Responsive
   =================================== */
@media (max-width: 768px) {
    /* Responsive styles moved to component-specific CSS files */
}
