/* Custom styles for Savannah AI Voice Platform */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    color: #f3f4f6; /* Lighter default text for dark background */
}

/* Sidebar styles */
.sidebar {
    width: 280px;
    flex-shrink: 0;
}

/* Mobile sidebar styles */
@media (max-width: 1023px) {
    .sidebar {
        width: 280px;
        max-width: 80vw;
    }
}

.sidebar-header {
    flex-shrink: 0;
}

.sidebar-footer {
    flex-shrink: 0;
}

.sidebar-link {
    position: relative;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.3s ease;
}

.sidebar-link:hover {
    color: #ffffff;
}

.sidebar-link-active {
    background: rgba(255, 255, 255, 0.1);
    font-weight: 600;
    color: #ffffff;
}

.sidebar-link-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #a78bfa; /* Light purple accent */
    border-radius: 0 4px 4px 0;
}

/* Animated gradient background - Darker Purple/Blue Theme */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.bg-animated-gradient {
    /* Deep Navy, Dark Violet, Midnight Blue, Dark Indigo */
    background: linear-gradient(-45deg, #0f172a, #312e81, #2e1065, #1e1b4b);
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

/* Icon animations */
.animate-spin {
    animation: spin 1s linear infinite;
}

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

.animate-pulse-slow {
    animation: pulse-slow 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-slow {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .7;
    }
}

.animate-bounce-subtle {
    animation: bounce-subtle 2s infinite;
}

@keyframes bounce-subtle {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

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

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

.animate-glow {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        filter: drop-shadow(0 0 5px rgba(139, 92, 246, 0.5));
    }
    to {
        filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.8));
    }
}

/* Card hover effects */
.stat-card {
    transition: all 0.3s ease;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3); /* Darker shadow */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

/* Darker Gradients for Cards */
.stat-card-gradient {
    /* Indigo to Dark Purple */
    background: linear-gradient(135deg, #3730a3 0%, #4c1d95 100%);
    color: white;
}

.stat-card-gradient-2 {
    /* Dark Violet to Deep Magenta */
    background: linear-gradient(135deg, #5b21b6 0%, #831843 100%);
    color: white;
}

.stat-card-gradient-3 {
    /* Midnight Blue to Royal Blue */
    background: linear-gradient(135deg, #172554 0%, #1e40af 100%);
    color: white;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Status badges with glow */
.status-active {
    background-color: #059669; /* Darker green */
    color: #ecfdf5;
    box-shadow: 0 0 10px rgba(5, 150, 105, 0.4);
}

.status-draft {
    background-color: #4b5563;
    color: #f3f4f6;
}

.status-paused {
    background-color: #d97706; /* Darker amber */
    color: #fffbeb;
    box-shadow: 0 0 10px rgba(217, 119, 6, 0.4);
}

/* Form improvements - Dark Mode Styled */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
    background-color: rgba(15, 23, 42, 0.6); /* Dark background */
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #f3f4f6;
    padding: 0.5rem 0.75rem;
    transition: all 0.3s ease;
    border-radius: 0.5rem;
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="tel"]::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #8b5cf6; /* Violet highlight */
    background-color: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

/* Button enhancements */
.btn-primary {
    /* Deep Indigo to Violet Gradient */
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
    color: white;
    border: none;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(67, 56, 202, 0.5);
    filter: brightness(1.1);
}

/* Shimmer effect for loading - Adjusted for dark mode */
.shimmer {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Glass morphism effect */
.glass {
    background: rgba(15, 23, 42, 0.4); /* Darker tint */
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* NEW: Darkened glass modal for better contrast */
.modal-glass {
    background: rgba(15, 23, 42, 0.95); /* Nearly opaque dark background */
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
    /* Ensure the modal content is on top of everything, including the sidebar (z-index: 40) */
    z-index: 50;
}

/* Modal overlay fix: ensure the overlay is at least as high as the modals in campaigns.ftl and leads.ftl (z-index: 50) */
.fixed.inset-0.z-10,
.fixed.inset-0.z-20,
.fixed.inset-0.z-30 {
    /* Override lower z-index values to ensure proper overlay */
    z-index: 50 !important;
}


/* Fade in animation */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide in from left */
.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale in animation */
.scale-in {
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Mobile Responsive Styles */
@media (max-width: 640px) {
    /* Stack stat cards vertically */
    .stat-card {
        margin-bottom: 1rem;
    }

    /* Adjust card padding on mobile */
    .glass.backdrop-blur-md {
        padding: 1rem;
    }

    /* Adjust table font sizes */
    table th,
    table td {
        font-size: 0.75rem;
        padding: 0.5rem;
    }

    /* Make buttons full width on small screens */
    .btn-primary {
        width: 100%;
        justify-content: center;
    }

    /* Adjust modal width on mobile */
    .modal-container {
        max-width: 95vw;
    }
}

/* Tablet responsive styles */
@media (min-width: 641px) and (max-width: 1023px) {
    .stat-card {
        font-size: 0.9rem;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Increase button sizes for touch */
    button,
    a.btn-primary,
    .sidebar-link {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }

    /* Remove hover effects on touch devices */
    .stat-card:hover {
        transform: none;
    }
}