/**
 * Iragni Theme - 'The Spiders'
 * Tricolor Design: Spider Black, Web Silk, Gold Thread
 */

/* CSS Variables */
:root {
    /* Primary Colors */
    --spider-black: #0D0D0D;
    --spider-black-light: #1A1A1A;
    
    /* Secondary Colors */
    --web-silk: #1A1A2E;
    --web-grey: #2D2D44;
    --web-light: #3D3D5C;
    
    /* Accent Colors - Gold Thread */
    --gold-thread: #D4AF37;
    --gold-light: #E5C158;
    --gold-dark: #B8941F;
    --gold-muted: #8B7355;
    
    /* Text Colors */
    --text-primary: #F5F5F5;
    --text-secondary: #B8B8C8;
    --text-muted: #8892A0;
    
    /* Status Colors */
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    
    /* Web Gradients */
    --web-gradient: linear-gradient(135deg, var(--web-silk) 0%, var(--web-grey) 100%);
    --gold-gradient: linear-gradient(135deg, var(--gold-thread) 0%, var(--gold-light) 50%, var(--gold-dark) 100%);
    --dark-gradient: linear-gradient(180deg, var(--spider-black) 0%, var(--spider-black-light) 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-gold: 0 0 20px rgba(212, 175, 55, 0.2);
    
    /* Borders */
    --border-subtle: 1px solid rgba(255, 255, 255, 0.1);
    --border-gold: 1px solid var(--gold-thread);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--spider-black);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
}

.text-gold { color: var(--gold-thread) !important; }
.text-gold-light { color: var(--gold-light) !important; }
.text-muted { color: var(--text-muted) !important; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--gold-gradient);
    color: var(--spider-black);
    box-shadow: var(--shadow-gold);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
}

.btn-secondary {
    background: var(--web-grey);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: var(--web-light);
    border-color: var(--gold-thread);
}

.btn-outline {
    background: transparent;
    color: var(--gold-thread);
    border: 2px solid var(--gold-thread);
}

.btn-outline:hover {
    background: var(--gold-thread);
    color: var(--spider-black);
}

/* Cards */
.card {
    background: var(--web-silk);
    border: var(--border-subtle);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(212, 175, 55, 0.3);
    box-shadow: var(--shadow-lg);
}

.card-gold {
    border: 1px solid var(--gold-thread);
    box-shadow: var(--shadow-gold);
}

/* Navigation */
.navbar {
    background: rgba(13, 13, 13, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--gold-thread);
    text-decoration: none;
}

.navbar-brand:hover {
    color: var(--gold-light);
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--gold-thread);
    background: rgba(212, 175, 55, 0.1);
}

/* Spider Web Background Pattern */
.web-pattern {
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(212, 175, 55, 0.03) 0%, transparent 50%),
        linear-gradient(180deg, var(--spider-black) 0%, var(--spider-black-light) 100%);
    position: relative;
}

.web-pattern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(45deg, transparent 48%, rgba(212, 175, 55, 0.02) 49%, rgba(212, 175, 55, 0.02) 51%, transparent 52%),
        linear-gradient(-45deg, transparent 48%, rgba(212, 175, 55, 0.02) 49%, rgba(212, 175, 55, 0.02) 51%, transparent 52%);
    background-size: 60px 60px;
    pointer-events: none;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
    transform: translateY(-50%);
    pointer-events: none;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    background: linear-gradient(135deg, #F5F5F5 0%, var(--gold-thread) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
}

/* Service Cards */
.service-card {
    background: var(--web-silk);
    border: var(--border-subtle);
    border-radius: 1rem;
    padding: 2rem;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gold-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.service-card:hover {
    transform: translateY(-8px);
    border-color: var(--gold-thread);
    box-shadow: var(--shadow-lg);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-icon {
    width: 60px;
    height: 60px;
    background: var(--web-grey);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-thread);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.service-card:hover .service-icon {
    background: var(--gold-thread);
    color: var(--spider-black);
}

/* Forms */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--web-grey);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--gold-thread);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Kanban Board */
.kanban-column {
    background: var(--spider-black-light);
    border-radius: 0.75rem;
    padding: 1rem;
    min-height: 400px;
    border: var(--border-subtle);
}

.kanban-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    margin-bottom: 1rem;
    border-bottom: var(--border-subtle);
}

.kanban-count {
    background: var(--web-grey);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.kanban-card {
    background: var(--web-silk);
    border: var(--border-subtle);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: grab;
    transition: all 0.2s;
}

.kanban-card:hover {
    border-color: rgba(212, 175, 55, 0.4);
    transform: translateX(4px);
}

.kanban-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

/* DataTable Custom */
.datatable-dark {
    background: transparent !important;
}

.datatable-dark thead th {
    background: var(--web-grey) !important;
    color: var(--gold-thread) !important;
    border-bottom: 2px solid var(--gold-thread) !important;
    font-weight: 600;
}

.datatable-dark tbody td {
    background: var(--web-silk) !important;
    color: var(--text-primary) !important;
    border-bottom: var(--border-subtle) !important;
}

.datatable-dark tbody tr:hover td {
    background: var(--web-grey) !important;
}

/* Leaflet Map Custom */
.leaflet-custom {
    border-radius: 0.75rem;
    overflow: hidden;
    border: var(--border-subtle);
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}

.badge-new { background: rgba(59, 130, 246, 0.2); color: #60A5FA; }
.badge-contacted { background: rgba(245, 158, 11, 0.2); color: #FBBF24; }
.badge-qualified { background: rgba(139, 92, 246, 0.2); color: #A78BFA; }
.badge-proposal { background: rgba(99, 102, 241, 0.2); color: #818CF8; }
.badge-negotiation { background: rgba(249, 115, 22, 0.2); color: #FB923C; }
.badge-won { background: rgba(16, 185, 129, 0.2); color: #34D399; }
.badge-lost { background: rgba(239, 68, 68, 0.2); color: #F87171; }

/* Priority Indicators */
.priority-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.priority-high { background: var(--danger); }
.priority-medium { background: var(--info); }
.priority-low { background: var(--text-muted); }

/* Admin Sidebar */
.admin-sidebar {
    background: var(--spider-black-light);
    border-right: var(--border-subtle);
    width: 280px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover,
.sidebar-link.active {
    color: var(--gold-thread);
    background: rgba(212, 175, 55, 0.1);
    border-left-color: var(--gold-thread);
}

.sidebar-link i {
    width: 24px;
    text-align: center;
}

/* Analytics Cards */
.analytics-card {
    background: var(--web-silk);
    border-radius: 1rem;
    padding: 1.5rem;
    border: var(--border-subtle);
}

.analytics-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold-thread);
}

.analytics-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Animations */
@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse-gold {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(212, 175, 55, 0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.animate-spin-slow {
    animation: spin-slow 20s linear infinite;
}

.animate-pulse-gold {
    animation: pulse-gold 2s ease-in-out infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--spider-black);
}

::-webkit-scrollbar-thumb {
    background: var(--web-grey);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold-thread);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--web-silk);
    border: var(--border-subtle);
    border-radius: 1rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: all 0.3s;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--web-silk);
    border: var(--border-subtle);
    border-left: 4px solid var(--gold-thread);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

/* ── Spider Weaving Animations ── */
@keyframes weave-strand {
    0%   { stroke-dashoffset: 158; opacity: 0; }
    12%  { opacity: 1; }
    65%  { stroke-dashoffset: 0;   opacity: 1; }
    85%  { stroke-dashoffset: 0;   opacity: 1; }
    100% { stroke-dashoffset: 158; opacity: 0; }
}

@keyframes weave-silk {
    0%,  20% { opacity: 0; }
    35%, 80% { opacity: 0.85; }
    100%     { opacity: 0; }
}

@keyframes spider-breathe {
    0%, 100% { transform: translateY(0px); }
    50%      { transform: translateY(-4px); }
}

.weaving-strand {
    animation: weave-strand 6s ease-in-out 0.5s infinite;
}

.weaving-silk {
    animation: weave-silk 6s ease-in-out 0.5s infinite;
}

.spider-sway {
    transform-box: fill-box;
    transform-origin: center;
    animation: spider-breathe 4s ease-in-out infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .admin-sidebar.active {
        transform: translateX(0);
    }
}
