/*
 * Unified Design System CSS
 * This file provides a consistent design language across the entire application
 */

/* ==========================================
   TYPOGRAPHY SYSTEM
   ========================================== */

/* Headings - Unified Font Sizes & Weights */
h1, .heading-1 {
    font-size: 2.25rem !important; /* 36px */
    font-weight: 800 !important;
    line-height: 1.2 !important;
    letter-spacing: -0.025em !important;
    color: #1f2937 !important;
}

.dark h1, .dark .heading-1 {
    color: #f9fafb !important;
}

h2, .heading-2 {
    font-size: 1.875rem !important; /* 30px */
    font-weight: 700 !important;
    line-height: 1.3 !important;
    letter-spacing: -0.02em !important;
    color: #374151 !important;
}

.dark h2, .dark .heading-2 {
    color: #f3f4f6 !important;
}

h3, .heading-3 {
    font-size: 1.5rem !important; /* 24px */
    font-weight: 700 !important;
    line-height: 1.4 !important;
    letter-spacing: -0.015em !important;
    color: #4b5563 !important;
}

.dark h3, .dark .heading-3 {
    color: #e5e7eb !important;
}

h4, .heading-4 {
    font-size: 1.25rem !important; /* 20px */
    font-weight: 600 !important;
    line-height: 1.5 !important;
    color: #6b7280 !important;
}

.dark h4, .dark .heading-4 {
    color: #d1d5db !important;
}

h5, .heading-5 {
    font-size: 1.125rem !important; /* 18px */
    font-weight: 600 !important;
    line-height: 1.5 !important;
    color: #6b7280 !important;
}

.dark h5, .dark .heading-5 {
    color: #d1d5db !important;
}

h6, .heading-6 {
    font-size: 1rem !important; /* 16px */
    font-weight: 600 !important;
    line-height: 1.5 !important;
    color: #9ca3af !important;
}

.dark h6, .dark .heading-6 {
    color: #9ca3af !important;
}

/* Paragraphs - Unified Sizes */
p, .paragraph {
    font-size: 0.875rem !important; /* 14px */
    line-height: 1.6 !important;
    color: #6b7280 !important;
}

.dark p, .dark .paragraph {
    color: #d1d5db !important;
}

.text-large {
    font-size: 1rem !important; /* 16px */
    line-height: 1.6 !important;
}

.text-small {
    font-size: 0.75rem !important; /* 12px */
    line-height: 1.5 !important;
}

.text-tiny {
    font-size: 0.625rem !important; /* 10px */
    line-height: 1.4 !important;
}

/* ==========================================
   BUTTON SYSTEM - Unified Styles
   ========================================== */


/* Button Sizes */
.btn-xs {
    padding: 0.375rem 0.75rem !important; /* 6px 12px */
    font-size: 0.75rem !important; /* 12px */
}

.btn-sm {
    padding: 0.5rem 1rem !important; /* 8px 16px */
    font-size: 0.8125rem !important; /* 13px */
}

.btn-md {
    padding: 0.625rem 1.25rem !important; /* 10px 20px */
    font-size: 0.875rem !important; /* 14px */
}

.btn-lg {
    padding: 0.75rem 1.5rem !important; /* 12px 24px */
    font-size: 1rem !important; /* 16px */
}

.btn-xl {
    padding: 1rem 2rem !important; /* 16px 32px */
    font-size: 1.125rem !important; /* 18px */
}

/* Primary Button */
.btn-primary,
.bg-primary-500 {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2) !important;
}

.btn-primary:hover,
.bg-primary-500:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%) !important;
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3) !important;
    transform: translateY(-1px) !important;
}

.btn-primary:active {
    transform: translateY(0) !important;
    box-shadow: 0 1px 2px rgba(99, 102, 241, 0.2) !important;
}

/* Secondary Button */
.btn-secondary {
    background-color: #f3f4f6 !important;
    color: #374151 !important;
    border-color: #e5e7eb !important;
}

.btn-secondary:hover {
    background-color: #e5e7eb !important;
    border-color: #d1d5db !important;
    color: #1f2937 !important;
}

.dark .btn-secondary {
    background-color: #374151 !important;
    color: #f9fafb !important;
    border-color: #4b5563 !important;
}

.dark .btn-secondary:hover {
    background-color: #4b5563 !important;
    border-color: #6b7280 !important;
}

/* Success Button */
.btn-success,
.bg-green-500 {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2) !important;
}

.btn-success:hover,
.bg-green-500:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3) !important;
    transform: translateY(-1px) !important;
}

/* Danger Button */
.btn-danger,
.bg-red-600 {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2) !important;
}

.btn-danger:hover,
.bg-red-600:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3) !important;
    transform: translateY(-1px) !important;
}

/* Warning Button */
.btn-warning,
.bg-orange-500 {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 2px 4px rgba(249, 115, 22, 0.2) !important;
}

.btn-warning:hover,
.bg-orange-500:hover {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%) !important;
    box-shadow: 0 4px 8px rgba(249, 115, 22, 0.3) !important;
    transform: translateY(-1px) !important;
}

/* Info Button */
.btn-info,
.bg-indigo-500 {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2) !important;
}

.btn-info:hover,
.bg-indigo-500:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%) !important;
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3) !important;
    transform: translateY(-1px) !important;
}

/* Outline Buttons */
.btn-outline {
    background-color: transparent !important;
    border-width: 2px !important;
}

.btn-outline-primary {
    color: #6366f1 !important;
    border-color: #6366f1 !important;
}

.btn-outline-primary:hover {
    background-color: #6366f1 !important;
    color: #ffffff !important;
}

.dark .btn-outline-primary {
    color: #818cf8 !important;
    border-color: #818cf8 !important;
}

.dark .btn-outline-primary:hover {
    background-color: #818cf8 !important;
    color: #ffffff !important;
}

/* Disabled Button */
.btn:disabled,
.btn.disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* ==========================================
   COLOR SYSTEM - Brand Colors
   ========================================== */

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #6b7280;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f97316;
    --info-color: #3b82f6;
    --light-color: #f3f4f6;
    --dark-color: #1f2937;
}

.dark:root {
    --primary-color: #818cf8;
    --primary-hover: #6366f1;
    --secondary-color: #9ca3af;
    --success-color: #34d399;
    --danger-color: #f87171;
    --warning-color: #fb923c;
    --info-color: #60a5fa;
    --light-color: #374151;
    --dark-color: #111827;
}

/* Text Colors - Unified */
.text-primary {
    color: var(--primary-color) !important;
}

.text-secondary {
    color: var(--secondary-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-info {
    color: var(--info-color) !important;
}

/* Background Colors - Unified */
.bg-primary {
    background-color: var(--primary-color) !important;
    color: #ffffff !important;
}

.bg-secondary {
    background-color: var(--secondary-color) !important;
    color: #ffffff !important;
}

.bg-success {
    background-color: var(--success-color) !important;
    color: #ffffff !important;
}

.bg-danger {
    background-color: var(--danger-color) !important;
    color: #ffffff !important;
}

.bg-warning {
    background-color: var(--warning-color) !important;
    color: #ffffff !important;
}

.bg-info {
    background-color: var(--info-color) !important;
    color: #ffffff !important;
}

/* ==========================================
   SPACING SYSTEM - Consistent Padding/Margin
   ========================================== */

/* Container Spacing */
.container-spacing {
    padding: 1.5rem !important; /* 24px */
}

.section-spacing {
    margin-bottom: 1.5rem !important; /* 24px */
}

.card-spacing {
    padding: 1.25rem !important; /* 20px */
}

@media (min-width: 768px) {
    .container-spacing {
        padding: 2rem !important; /* 32px */
    }

    .section-spacing {
        margin-bottom: 2rem !important; /* 32px */
    }

    .card-spacing {
        padding: 1.5rem !important; /* 24px */
    }
}

/* ==========================================
   ACTIONS (Edit, Delete, View, etc.)
   ========================================== */

/* Action Icons - Consistent Size */
.action-icon {
    width: 1.25rem !important; /* 20px */
    height: 1.25rem !important;
}

.action-icon-sm {
    width: 1rem !important; /* 16px */
    height: 1rem !important;
}

.action-icon-lg {
    width: 1.5rem !important; /* 24px */
    height: 1.5rem !important;
}

/* Action Buttons Container */
.actions-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    flex-wrap: wrap !important;
}

/* Edit Action */
.action-edit {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #ffffff !important;
    padding: 0.5rem 1rem !important;
    border-radius: 0.5rem !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    border: none !important;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2) !important;
}

.action-edit:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3) !important;
}

/* Delete Action */
.action-delete {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: #ffffff !important;
    padding: 0.5rem 1rem !important;
    border-radius: 0.5rem !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    border: none !important;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2) !important;
}

.action-delete:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3) !important;
}

/* View Action */
.action-view {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    color: #ffffff !important;
    padding: 0.5rem 1rem !important;
    border-radius: 0.5rem !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    border: none !important;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2) !important;
}

.action-view:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3) !important;
}

/* Add/Create Action */
.action-add,
.action-create {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
    color: #ffffff !important;
    padding: 0.5rem 1rem !important;
    border-radius: 0.5rem !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    border: none !important;
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.2) !important;
}

.action-add:hover,
.action-create:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(139, 92, 246, 0.3) !important;
}

/* Replicate Action */
.action-replicate,
.action-duplicate {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #ffffff !important;
    padding: 0.5rem 1rem !important;
    border-radius: 0.5rem !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    border: none !important;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2) !important;
}

.action-replicate:hover,
.action-duplicate:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3) !important;
}

/* Back/Cancel Action */
.action-back,
.action-cancel {
    background-color: #f3f4f6 !important;
    color: #6b7280 !important;
    border: 1px solid #d1d5db !important;
    padding: 0.5rem 1rem !important;
    border-radius: 0.5rem !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
}

.action-back:hover,
.action-cancel:hover {
    background-color: #e5e7eb !important;
    color: #374151 !important;
    border-color: #9ca3af !important;
}

.dark .action-back,
.dark .action-cancel {
    background-color: #374151 !important;
    color: #d1d5db !important;
    border-color: #4b5563 !important;
}

.dark .action-back:hover,
.dark .action-cancel:hover {
    background-color: #4b5563 !important;
    color: #f9fafb !important;
    border-color: #6b7280 !important;
}

/* ==========================================
   BADGE SYSTEM - Unified Badges
   ========================================== */

.badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
    padding: 0.25rem 0.75rem !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    border-radius: 9999px !important;
    line-height: 1.4 !important;
}

.badge-primary {
    background-color: #dbeafe !important;
    color: #1e40af !important;
}

.dark .badge-primary {
    background-color: #1e3a8a !important;
    color: #bfdbfe !important;
}

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

.dark .badge-success {
    background-color: #064e3b !important;
    color: #a7f3d0 !important;
}

.badge-danger {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
}

.dark .badge-danger {
    background-color: #7f1d1d !important;
    color: #fecaca !important;
}

.badge-warning {
    background-color: #fef3c7 !important;
    color: #92400e !important;
}

.dark .badge-warning {
    background-color: #78350f !important;
    color: #fde68a !important;
}

.badge-info {
    background-color: #e0e7ff !important;
    color: #3730a3 !important;
}

.dark .badge-info {
    background-color: #312e81 !important;
    color: #c7d2fe !important;
}

.badge-gray {
    background-color: #f3f4f6 !important;
    color: #374151 !important;
}

.dark .badge-gray {
    background-color: #374151 !important;
    color: #d1d5db !important;
}

/* ==========================================
   CARD SYSTEM - Unified Cards
   ========================================== */

.card-unified {
    background-color: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 1rem !important;
    padding: 1.5rem !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
}

.card-unified:hover {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-2px) !important;
}

.dark .card-unified {
    background-color: #1f2937 !important;
    border-color: #374151 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

.dark .card-unified:hover {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.4) !important;
}

.card-header-unified {
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    color: #1f2937 !important;
    margin-bottom: 1rem !important;
    padding-bottom: 0.75rem !important;
    border-bottom: 1px solid #e5e7eb !important;
}

.dark .card-header-unified {
    color: #f9fafb !important;
    border-bottom-color: #374151 !important;
}

/* ==========================================
   FORM ELEMENTS - Unified Styles
   ========================================== */

/* Input Fields */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="date"],
select,
textarea {
    font-size: 0.875rem !important; /* 14px */
    padding: 0.625rem 0.875rem !important; /* 10px 14px */
    border-radius: 0.5rem !important;
    border: 1px solid #d1d5db !important;
    background-color: #ffffff !important;
    color: #374151 !important;
    transition: all 0.2s ease !important;
}

input:focus,
select:focus,
textarea:focus {
    outline: none !important;
    border-color: #6366f1 !important;
    ring: 2px !important;
    ring-color: rgba(99, 102, 241, 0.2) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}

.dark input[type="text"],
.dark input[type="email"],
.dark input[type="password"],
.dark input[type="number"],
.dark input[type="search"],
.dark input[type="tel"],
.dark input[type="url"],
.dark input[type="date"],
.dark select,
.dark textarea {
    background-color: #374151 !important;
    border-color: #4b5563 !important;
    color: #f9fafb !important;
}

.dark input:focus,
.dark select:focus,
.dark textarea:focus {
    border-color: #818cf8 !important;
    ring-color: rgba(129, 140, 248, 0.2) !important;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.1) !important;
}

/* Labels */
label {
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    color: #374151 !important;
    margin-bottom: 0.5rem !important;
    display: inline-block !important;
}

.dark label {
    color: #e5e7eb !important;
}

/* ==========================================
   TABLE SYSTEM - Unified Tables
   ========================================== */

table {
    width: 100% !important;
    border-collapse: collapse !important;
}

table thead th {
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: #6b7280 !important;
    padding: 0.75rem 1rem !important;
    background-color: #f9fafb !important;
    border-bottom: 2px solid #e5e7eb !important;
}

.dark table thead th {
    color: #9ca3af !important;
    background-color: #1f2937 !important;
    border-bottom-color: #374151 !important;
}

table tbody td {
    font-size: 0.875rem !important;
    color: #374151 !important;
    padding: 1rem !important;
    border-bottom: 1px solid #e5e7eb !important;
}

.dark table tbody td {
    color: #d1d5db !important;
    border-bottom-color: #374151 !important;
}

table tbody tr:hover {
    background-color: #f9fafb !important;
}

.dark table tbody tr:hover {
    background-color: #374151 !important;
}

/* ==========================================
   ICON SYSTEM - Consistent Icons
   ========================================== */

.icon-xs {
    width: 0.875rem !important;
    height: 0.875rem !important;
}

.icon-sm {
    width: 1rem !important;
    height: 1rem !important;
}

.icon-md {
    width: 1.25rem !important;
    height: 1.25rem !important;
}

.icon-lg {
    width: 1.5rem !important;
    height: 1.5rem !important;
}

.icon-xl {
    width: 2rem !important;
    height: 2rem !important;
}

.icon-2xl {
    width: 2.5rem !important;
    height: 2.5rem !important;
}

/* ==========================================
   BORDER RADIUS SYSTEM
   ========================================== */

.rounded-unified {
    border-radius: 0.5rem !important;
}

.rounded-unified-lg {
    border-radius: 0.75rem !important;
}

.rounded-unified-xl {
    border-radius: 1rem !important;
}

.rounded-unified-2xl {
    border-radius: 1.25rem !important;
}

.rounded-unified-3xl {
    border-radius: 1.5rem !important;
}

/* ==========================================
   ANIMATION SYSTEM
   ========================================== */

.transition-unified {
    transition: all 0.2s ease !important;
}

.transition-slow {
    transition: all 0.3s ease !important;
}

.transition-fast {
    transition: all 0.15s ease !important;
}

/* Hover Effects */
.hover-lift:hover {
    transform: translateY(-2px) !important;
}

.hover-scale:hover {
    transform: scale(1.05) !important;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3) !important;
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

/* Flexbox Utilities */
.flex-center {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.flex-between {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.flex-start {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
}

.flex-end {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
}

/* Gap Utilities */
.gap-unified {
    gap: 0.5rem !important;
}

.gap-unified-lg {
    gap: 1rem !important;
}

.gap-unified-xl {
    gap: 1.5rem !important;
}

/* ==========================================
   RESPONSIVE UTILITIES
   ========================================== */

@media (max-width: 640px) {
    h1, .heading-1 {
        font-size: 1.75rem !important; /* 28px */
    }

    h2, .heading-2 {
        font-size: 1.5rem !important; /* 24px */
    }

    h3, .heading-3 {
        font-size: 1.25rem !important; /* 20px */
    }

    .btn, .ti-btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.8125rem !important;
    }
}

