/* Custom White/Purple Glass Theme */
:root {
    --primary-color: #7D2AE8;
    /* Canva Purple Revised */
    --secondary-color: #6002EE;
    /* Deep Violet */
    --accent-color: #d946ef;
    /* Fuchsia */

    /* Override Bootstrap's blue primary with our purple */
    --bs-primary: #7D2AE8;
    --bs-primary-rgb: 125, 42, 232;
    --bs-link-color: #7D2AE8;
    --bs-link-color-rgb: 125, 42, 232;
    --bs-link-hover-color: #6002EE;
    --bs-link-hover-color-rgb: 96, 2, 238;
    --bs-info: #7D2AE8;
    --bs-info-rgb: 125, 42, 232;

    /* Light Theme Backgrounds */
    --bg-body: #f9fafb;
    /* Gray-50 */
    --glass-bg: rgba(255, 255, 255, 0.85);
    /* Frosted Glass */
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-shadow: rgba(125, 42, 232, 0.15);
    /* Purple shadow */

    --text-main: #000000;
    /* Pure Black for max contrast */
    --text-muted: #374151;
    /* Gray-700 - Much darker */

    --radius-xl: 1.5rem;
    --radius-lg: 1rem;
}

/* Force Bootstrap primary to purple everywhere */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

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

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

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

/* btn-primary → purple */
.btn-primary {
    --bs-btn-bg: #7D2AE8;
    --bs-btn-border-color: #7D2AE8;
    --bs-btn-hover-bg: #6002EE;
    --bs-btn-hover-border-color: #6002EE;
    --bs-btn-active-bg: #5501D4;
    --bs-btn-active-border-color: #5501D4;
    --bs-btn-disabled-bg: #7D2AE8;
    --bs-btn-disabled-border-color: #7D2AE8;
    --bs-btn-focus-shadow-rgb: 125, 42, 232;
}

/* btn-outline-primary → purple outline */
.btn-outline-primary {
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important;
}

.btn-check:checked+.btn-outline-primary,
.btn-check:active+.btn-outline-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important;
}

/* Badge overrides */
.badge.bg-primary {
    background-color: var(--primary-color) !important;
}

.badge.bg-primary.bg-opacity-10 {
    background-color: rgba(125, 42, 232, 0.1) !important;
}

.badge.bg-info.bg-opacity-10 {
    background-color: rgba(125, 42, 232, 0.1) !important;
}

/* Spinner primary */
.spinner-border.text-primary {
    color: var(--primary-color) !important;
}

/* Mobile-compact render pages */
@media (max-width: 768px) {
    .upload-area {
        height: 150px !important;
    }

    .upload-area i.fa-3x {
        font-size: 1.5rem !important;
    }

    .card-body {
        padding: 0.75rem !important;
    }

    .card-body .card-title {
        font-size: calc(0.75rem + 0.2vw) !important;
        margin-bottom: 0.5rem !important;
    }
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'IranYekan', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
    line-height: 1.7;
}

/* Force darker text for readability */
.text-muted {
    color: var(--text-muted) !important;
}

/* Animated Background Gradients & Blobs */
.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.25;
    /* Reduced opacity to help text readability */
    z-index: -1;
    animation: blob-float 15s infinite ease-in-out;
}

.blob-purple {
    background: var(--primary-color);
}

.blob-pink {
    background: var(--accent-color);
}

@keyframes blob-float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(20px, -20px) scale(1.1);
    }
}

/* Glassmorphism Cards */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: 0 10px 30px -5px var(--glass-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.custom-hover-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -5px rgba(125, 42, 232, 0.2);
    /* Purple glow on hover */
    border-color: rgba(125, 42, 232, 0.3);
}

/* Typography & Gradients */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #111827;
}

.text-gradient {
    background: linear-gradient(135deg, #7D2AE8, #d946ef);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Form Styles */
.form-control,
.form-select {
    background-color: #fff;
    border: 1px solid #d1d5db;
    color: #111827;
    border-radius: 0.75rem;
    padding: 0.8rem 1rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.form-control:focus,
.form-select:focus {
    background-color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(125, 42, 232, 0.1);
}

/* Buttons */
.btn-primary {
    background: #7D2AE8;
    /* Solid color per user preference usually better than gradient for "Canva style" */
    border: none;
    border-radius: 1rem;
    padding: 0.8rem 1.6rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(125, 42, 232, 0.3);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #6002EE;
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(125, 42, 232, 0.4);
}

@media (max-width: 768px) {
    .btn-lg-mobile-fix {
        padding: 0.5rem 1rem !important;
        font-size: 0.95rem !important;
        width: 100%;
        /* Full width on mobile looks cleaner if stacked */
        margin-bottom: 0.5rem;
    }
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.navbar .nav-link {
    color: #374151 !important;
    font-weight: 600;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: var(--primary-color) !important;
}

/* Helpers */
.text-gray-300 {
    color: #d1d5db !important;
}

/* Lighter gray for dark backgrounds */
.text-white-forced {
    color: #fff !important;
}