/* ============================================
   ChurchHub OS - Coptic Inspired Theme
   Majestic & Spiritual Design System
   ============================================ */

:root {
    /* Dynamic Church Colors (overridden by ChurchMiddleware) */
    --church-primary: #B8860B;
    --church-secondary: #8B4513;
    --church-accent: #DAA520;
    
    /* Coptic Gold Palette */
    --coptic-gold: #D4AF37;
    --coptic-gold-light: #F5DEB3;
    --coptic-gold-dark: #B8860B;
    
    /* Sacred Burgundy */
    --sacred-burgundy: #800020;
    --sacred-burgundy-light: #A0173B;
    --sacred-burgundy-dark: #5C0015;
    
    /* Mystical Purple */
    --mystical-purple: #663399;
    --mystical-purple-light: #8B5CF6;
    --mystical-purple-dark: #4C1D95;
    
    /* Divine Blue */
    --divine-blue: #1E3A8A;
    --divine-blue-light: #3B82F6;
    --divine-blue-dark: #1E1B4B;
    
    /* Holy White & Shadows */
    --holy-white: #FDFCFB;
    --altar-shadow: rgba(0, 0, 0, 0.15);
    --incense-glow: rgba(212, 175, 55, 0.2);
    
    /* Typography */
    --font-coptic: 'Georgia', 'Times New Roman', serif;
    --font-body: 'Cairo', 'Segoe UI', sans-serif;
    
    /* Spacing & Rhythm */
    --rhythm-xs: 0.25rem;
    --rhythm-sm: 0.5rem;
    --rhythm-md: 1rem;
    --rhythm-lg: 1.5rem;
    --rhythm-xl: 2.5rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
}

/* ============================================
   Coptic Pattern Backgrounds
   ============================================ */

.coptic-pattern {
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, var(--incense-glow) 35px, var(--incense-glow) 70px),
        repeating-linear-gradient(-45deg, transparent, transparent 35px, var(--incense-glow) 35px, var(--incense-glow) 70px);
}

.cross-pattern {
    background-image: 
        linear-gradient(0deg, transparent 24%, var(--coptic-gold-light) 25%, var(--coptic-gold-light) 26%, transparent 27%, transparent 74%, var(--coptic-gold-light) 75%, var(--coptic-gold-light) 76%, transparent 77%, transparent),
        linear-gradient(90deg, transparent 24%, var(--coptic-gold-light) 25%, var(--coptic-gold-light) 26%, transparent 27%, transparent 74%, var(--coptic-gold-light) 75%, var(--coptic-gold-light) 76%, transparent 77%, transparent);
    background-size: 50px 50px;
}

.icon-border {
    background: 
        linear-gradient(135deg, var(--coptic-gold) 25%, transparent 25%),
        linear-gradient(225deg, var(--coptic-gold) 25%, transparent 25%),
        linear-gradient(45deg, var(--coptic-gold) 25%, transparent 25%),
        linear-gradient(315deg, var(--coptic-gold) 25%, transparent 25%);
    background-size: 20px 20px;
    background-position: 0 0, 10px 0, 10px -10px, 0px 10px;
}

/* ============================================
   Golden Gradient Effects
   ============================================ */

.golden-gradient {
    background: linear-gradient(135deg, 
        var(--coptic-gold-dark) 0%, 
        var(--coptic-gold) 50%, 
        var(--coptic-gold-light) 100%
    );
}

.sacred-gradient {
    background: linear-gradient(135deg, 
        var(--sacred-burgundy-dark) 0%, 
        var(--sacred-burgundy) 50%, 
        var(--sacred-burgundy-light) 100%
    );
}

.divine-gradient {
    background: linear-gradient(135deg, 
        var(--divine-blue-dark) 0%, 
        var(--divine-blue) 50%, 
        var(--divine-blue-light) 100%
    );
}

.mystical-gradient {
    background: linear-gradient(135deg, 
        var(--mystical-purple-dark) 0%, 
        var(--mystical-purple) 50%, 
        var(--mystical-purple-light) 100%
    );
}

/* ============================================
   Glassmorphism Components
   ============================================ */

.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px var(--altar-shadow);
    border-radius: var(--radius-lg);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   Sacred Buttons & Interactive Elements
   ============================================ */

.btn-sacred {
    background: var(--church-primary);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-sacred:hover {
    background: var(--church-secondary);
    border-color: var(--church-accent);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.btn-golden {
    background: linear-gradient(135deg, var(--coptic-gold-dark), var(--coptic-gold));
    color: white;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    border: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-golden::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-golden:hover::before {
    left: 100%;
}

.btn-golden:hover {
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.5);
    transform: translateY(-3px) scale(1.02);
}

/* ============================================
   Majestic Cards with Liturgical Borders
   ============================================ */

.liturgical-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--rhythm-lg);
    box-shadow: 0 10px 30px var(--altar-shadow);
    border: 3px solid transparent;
    border-image: linear-gradient(135deg, var(--coptic-gold), var(--sacred-burgundy), var(--coptic-gold)) 1;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.liturgical-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, 
        var(--coptic-gold), 
        var(--sacred-burgundy), 
        var(--mystical-purple), 
        var(--coptic-gold)
    );
}

.liturgical-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

/* ============================================
   Icon Glow Effect (for Coptic crosses)
   ============================================ */

.icon-glow {
    filter: drop-shadow(0 0 8px var(--coptic-gold));
    transition: filter 0.3s ease;
}

.icon-glow:hover {
    filter: drop-shadow(0 0 15px var(--coptic-gold)) drop-shadow(0 0 25px var(--coptic-gold-light));
}

/* ============================================
   Typography - Spiritual & Majestic
   ============================================ */

.text-coptic {
    font-family: var(--font-coptic);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.text-sacred {
    background: linear-gradient(135deg, var(--coptic-gold), var(--sacred-burgundy));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.heading-majestic {
    font-family: var(--font-coptic);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--sacred-burgundy);
    text-align: center;
    text-shadow: 2px 2px 4px var(--altar-shadow);
    margin-bottom: var(--rhythm-lg);
    position: relative;
    padding-bottom: var(--rhythm-md);
}

.heading-majestic::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--coptic-gold), transparent);
}

/* ============================================
   Navigation Bar - Cathedral Style
   ============================================ */

.navbar-cathedral {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px var(--altar-shadow);
    border-bottom: 3px solid var(--coptic-gold);
}

.navbar-cathedral .nav-link {
    color: var(--sacred-burgundy);
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    transition: all 0.3s ease;
    position: relative;
}

.navbar-cathedral .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--coptic-gold);
    transition: width 0.3s ease;
}

.navbar-cathedral .nav-link:hover::before,
.navbar-cathedral .nav-link.active::before {
    width: 80%;
}

/* ============================================
   AI Chat Widget - Spiritual Assistant
   ============================================ */

.ai-chat-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 400px;
    max-height: 600px;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--coptic-gold);
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.ai-chat-header {
    background: linear-gradient(135deg, var(--sacred-burgundy), var(--mystical-purple));
    color: white;
    padding: var(--rhythm-md);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    display: flex;
    align-items: center;
    gap: var(--rhythm-sm);
}

.ai-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--rhythm-md);
    background: linear-gradient(to bottom, #fafafa, white);
}

.ai-message {
    margin-bottom: var(--rhythm-md);
    display: flex;
    gap: var(--rhythm-sm);
}

.ai-message.user {
    flex-direction: row-reverse;
}

.ai-message-content {
    max-width: 75%;
    padding: var(--rhythm-sm) var(--rhythm-md);
    border-radius: var(--radius-md);
    line-height: 1.6;
}

.ai-message.user .ai-message-content {
    background: var(--divine-blue);
    color: white;
    border-bottom-right-radius: 0;
}

.ai-message.ai .ai-message-content {
    background: white;
    border: 1px solid var(--coptic-gold-light);
    color: #333;
    border-bottom-left-radius: 0;
}

.ai-chat-input {
    padding: var(--rhythm-md);
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: var(--rhythm-sm);
}

.ai-chat-input input {
    flex: 1;
    border: 2px solid var(--coptic-gold-light);
    border-radius: var(--radius-md);
    padding: var(--rhythm-sm) var(--rhythm-md);
}

.ai-chat-input button {
    background: var(--coptic-gold);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: var(--rhythm-sm) var(--rhythm-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-chat-input button:hover {
    background: var(--coptic-gold-dark);
    transform: scale(1.05);
}

/* ============================================
   Animations
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.shimmer {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(212, 175, 55, 0.2) 50%, 
        transparent 100%
    );
    background-size: 1000px 100%;
}

/* ============================================
   Dark Mode - Warm Spiritual Tones
   ============================================ */

@media (prefers-color-scheme: dark) {
    :root {
        --holy-white: #1a1a1a;
        --altar-shadow: rgba(0, 0, 0, 0.5);
    }
    
    body {
        background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
        color: #e0e0e0;
    }
    
    .liturgical-card {
        background: rgba(30, 30, 30, 0.9);
        color: #e0e0e0;
    }
    
    .navbar-cathedral {
        background: rgba(20, 20, 20, 0.95);
    }
    
    .navbar-cathedral .nav-link {
        color: var(--coptic-gold-light);
    }
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 768px) {
    .ai-chat-widget {
        width: calc(100% - 2rem);
        bottom: 1rem;
        right: 1rem;
    }
    
    .heading-majestic {
        font-size: 1.75rem;
    }
}

/* ============================================
   Global Improvements
   ============================================ */

* {
    scroll-behavior: smooth;
}

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(135deg, #f5f3f0 0%, #fff8f0 100%);
    font-family: 'Cairo', 'Segoe UI', sans-serif;
}

/* Smooth Transitions */
a, button, input, select, textarea {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Professional Shadows */
.shadow-professional {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.shadow-hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* RTL Support Optimization */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

/* Responsive Typography */
@media (max-width: 768px) {
    h1 {
        font-size: 1.75rem !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
    }
    
    h3 {
        font-size: 1.25rem !important;
    }
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 1rem;
    height: 1rem;
    margin-left: 0.5rem;
    border: 2px solid #D4AF37;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Selection Styling */
::selection {
    background: #D4AF37;
    color: white;
}

::-moz-selection {
    background: #D4AF37;
    color: white;
}

/* Focus Styles */
*:focus-visible {
    outline: 2px solid #D4AF37;
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.3);
}

