/* ============================================================================
   Islamic Finance Compliance System - Main Stylesheet
   ============================================================================ */

/* CSS Variables */
:root {
    /* Primary Purple Gradient Colors */
    --color-primary-50: #f5f3ff;
    --color-primary-100: #ede9fe;
    --color-primary-200: #ddd6fe;
    --color-primary-300: #c4b5fd;
    --color-primary-400: #a78bfa;
    --color-primary-500: #8b5cf6;
    --color-primary-600: #7c3aed;
    --color-primary-700: #6d28d9;
    --color-primary-800: #5b21b6;
    --color-primary-900: #4c1d95;
    
    /* Gradient */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* 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-in-out;
    --transition-normal: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;
}

/* Global Styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* RTL Support */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
    font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
}

[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

/* Arabic Font Rendering */
.font-arabic {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
    font-weight: 400;
}

/* English Font Rendering */
.font-english {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-weight: 400;
}

/* ============================================================================
   Buttons (Note: Using Tailwind classes directly in HTML instead of @apply)
   ============================================================================ */

/* Keep these as utility classes that extend Tailwind */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================================
   Form Elements (Use Tailwind classes directly in HTML)
   ============================================================================ */

.form-input:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
}

/* ============================================================================
   Loading Spinner
   ============================================================================ */

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

.spinner-primary {
    border-color: rgba(124, 58, 237, 0.3);
    border-top-color: #7c3aed;
}

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

/* Thinking Animation (3 dots) */
.thinking-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.thinking-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    opacity: 0.4;
    animation: thinking 1.4s infinite ease-in-out;
}

.thinking-dots span:nth-child(1) {
    animation-delay: 0s;
}

.thinking-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.thinking-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes thinking {
    0%, 60%, 100% {
        opacity: 0.4;
        transform: scale(1);
    }
    30% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* ============================================================================
   Toast Notifications
   ============================================================================ */

.toast {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    min-width: 320px;
    max-width: 28rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.3s ease-out;
}

.toast-success {
    background-color: #059669;
    color: white;
}

.toast-error {
    background-color: #dc2626;
    color: white;
}

.toast-warning {
    background-color: #eab308;
    color: white;
}

.toast-info {
    background-color: #2563eb;
    color: white;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* ============================================================================
   Chat Interface
   ============================================================================ */

.chat-message.user {
    flex-direction: row-reverse;
    margin-right: auto;
}

.chat-message.assistant {
    margin-left: auto;
}

.chat-bubble.user {
    background-color: var(--color-primary-600);
    color: white;
}

.chat-bubble.assistant {
    background-color: white;
    border: 1px solid #e5e7eb;
}

/* ============================================================================
   Utility Classes
   ============================================================================ */

.gradient-primary {
    background: var(--gradient-primary);
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.scrollbar-thin {
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
}

.scrollbar-thin::-webkit-scrollbar {
    width: 6px;
}

.scrollbar-thin::-webkit-scrollbar-track {
    background: transparent;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.5);
    border-radius: 3px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background-color: rgba(156, 163, 175, 0.7);
}

/* ============================================================================
   Print Styles
   ============================================================================ */

@media print {
    .no-print {
        display: none !important;
    }
}
