/* General Styles */
:root {
    --flvn-primary: #342275;
    --flvn-primary-dark: #2a1c5f;
    --flvn-primary-light: #4a2c85;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin: 0;
    padding: 0;
    background-color: #ffffff;
    color: #333333;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* Navigation Styles */
.navbar-brand-logo {
    height: 32px;
    width: auto;
}

/* Custom navbar vertical padding */
.navbar {
    padding-top: 17px !important;
    padding-bottom: 17px !important;
}

/* Main content padding with better spacing for admin/customer pages */
.main-content {
    padding: 2rem;
    margin-left: 250px;
    min-height: calc(100vh - 80px);
    background-color: #f8f9fa;
    color: #333333;
}

/* Enhanced modern cards for admin/customer pages */
.modern-card {
    background: #ffffff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.modern-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.modern-card-header {
    background: linear-gradient(135deg, var(--flvn-primary), var(--flvn-primary-light));
    color: white;
    padding: 1.5rem;
    border: none;
    margin: 0;
}

.modern-card-body {
    padding: 2rem;
}

/* Sidebar Styles - Enhanced */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    background-color: var(--flvn-primary);
    color: white;
    z-index: 1000;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background-color: var(--flvn-primary);
}

.sidebar-brand {
    color: white;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.sidebar-brand img {
    height: 24px !important;
    width: auto !important;
    margin-right: 8px;
}

.sidebar-brand:hover {
    color: rgba(255, 255, 255, 0.8);
}

.sidebar-sticky {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--flvn-primary);
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    border: none;
    background: none;
    text-align: left;
    width: 100%;
    text-decoration: none;
    border-radius: 0;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Sidebar nav-link and button consistency */
.sidebar .nav-link {
    border-radius: 6px !important;
    color: #fff !important;
    background: none;
    transition: background 0.2s;
}
.sidebar .nav-link.active,
.sidebar .nav-link:focus,
.sidebar .nav-link:hover {
    background: var(--flvn-primary) !important;
    color: #fff !important;
}
.sidebar .nav-item form .nav-link.btn {
    color: #fff !important;
    background: none;
    border: none;
    border-radius: 6px !important;
    padding-left: 1rem;
    text-align: left;
}
.sidebar .nav-item form .nav-link.btn:focus,
.sidebar .nav-item form .nav-link.btn:hover {
    background: var(--flvn-primary) !important;
    color: #fff !important;
}

/* Enhanced User Section in Sidebar */
.sidebar-user-section {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.05);
    margin-top: auto;
}

.user-avatar {
    transition: all 0.3s ease;
}

.user-avatar:hover {
    background-color: rgba(255, 255, 255, 0.3) !important;
}

/* Card styles - ensure readability */
.card {
    background-color: #ffffff;
    color: #333333;
    border: 1px solid #dee2e6;
    border-radius: 6px; /* Updated border radius */
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: #f8f9fa;
    color: #333333;
    border-bottom: 1px solid #dee2e6;
    border-radius: 6px 6px 0 0 !important; /* Updated border radius */
}

.card-body {
    background-color: #ffffff;
    color: #333333;
}

/* Table styles */
.table {
    color: #333333;
    background-color: #ffffff;
}

.table-light {
    background-color: #f8f9fa;
    color: #333333;
}

.table-hover tbody tr:hover {
    background-color: rgba(52, 34, 117, 0.05);
}

/* Alert styles */
.alert {
    color: #333333;
    border-radius: 8px;
}

.alert-success {
    background-color: #d1edff;
    border-color: #bee5eb;
    color: #0c5460;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* Button styles - fix readability issues */
.btn-primary {
    background-color: var(--flvn-primary);
    border-color: var(--flvn-primary);
    color: white;
    border-radius: 6px; /* Updated border radius */
}

.btn-primary:hover {
    background-color: var(--flvn-primary-dark);
    border-color: var(--flvn-primary-dark);
    color: white !important;
    transform: translateY(-1px);
}

.btn-outline-primary {
    border-color: var(--flvn-primary);
    color: var(--flvn-primary);
    border-radius: 6px; /* Updated border radius */
}

.btn-outline-primary:hover {
    background-color: var(--flvn-primary);
    border-color: var(--flvn-primary);
    color: white !important;
    transform: translateY(-1px);
}

/* Welcome Header Styles */
.welcome-header {
    color: var(--flvn-primary); /* Set text color to purple */
}

/* Circle Icon Styles */
.circle-icon {
    background-color: var(--flvn-primary-light);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
}

/* AUTH PAGE STYLES - REMOVED EXTERNAL BACK BUTTON */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--flvn-primary) 0%, var(--flvn-primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 20px;
    margin: 0;
}

.floating-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.floating-shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
    pointer-events: none;
}

.floating-shape:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 10%;
    left: 20%;
    animation-delay: 0s;
}

.floating-shape:nth-child(2) {
    width: 120px;
    height: 120px;
    top: 60%;
    right: 20%;
    animation-delay: 2s;
}

.floating-shape:nth-child(3) {
    width: 60px;
    height: 60px;
    bottom: 20%;
    left: 70%;
    animation-delay: 4s;
}

.auth-container {
    position: relative;
    z-index: 50;
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
}

/* Auth card styling - FIXED LOGO SIZE */
.auth-page .card {
    background: white;
    border: none;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
    z-index: 50;
}

.auth-page .card-body {
    padding: 2.5rem;
    background: white;
    color: #333;
}

/* FIXED LOGO SIZE IN AUTH PAGES */
.auth-page .card-body img {
    height: 50px !important;
    width: auto !important;
    max-width: 150px !important;
}

/* Form controls in auth pages */
.auth-page .form-control {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 16px;
    color: #333;
    position: relative;
    z-index: 10;
}

.auth-page .form-control:focus {
    background-color: white;
    border-color: var(--flvn-primary);
    box-shadow: 0 0 0 0.2rem rgba(52, 34, 117, 0.25);
    color: #333;
}

/* Button styles in auth pages - FIXED READABILITY */
.auth-page .btn-primary {
    background-color: var(--flvn-primary);
    border-color: var(--flvn-primary);
    color: white !important;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 8px;
    position: relative;
    z-index: 10;
    transition: all 0.3s ease;
}

.auth-page .btn-primary:hover,
.auth-page .btn-primary:focus,
.auth-page .btn-primary:active {
    background-color: var(--flvn-primary-dark) !important;
    border-color: var(--flvn-primary-dark) !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 34, 117, 0.3);
}

.auth-page .btn-outline-primary {
    border-color: var(--flvn-primary);
    color: var(--flvn-primary) !important;
    background-color: transparent;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 8px;
    position: relative;
    z-index: 10;
    transition: all 0.3s ease;
}

.auth-page .btn-outline-primary:hover,
.auth-page .btn-outline-primary:focus,
.auth-page .btn-outline-primary:active {
    background-color: var(--flvn-primary) !important;
    border-color: var(--flvn-primary) !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 34, 117, 0.3);
}

/* Links in auth pages */
.auth-page a {
    color: var(--flvn-primary) !important;
    text-decoration: none;
    position: relative;
    z-index: 10;
    transition: all 0.3s ease;
}

.auth-page a:hover {
    color: var(--flvn-primary-dark) !important;
    text-decoration: underline;
}

/* Labels and text in auth pages */
.auth-page .form-label {
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
}

.auth-page h2 {
    color: var(--flvn-primary);
    font-weight: bold;
    font-size: 1.75rem;
}

.auth-page .text-muted {
    color: #6c757d !important;
}

/* Alerts in auth pages */
.auth-page .alert {
    border-radius: 8px;
    border: none;
    position: relative;
    z-index: 10;
}

.auth-page .alert-success {
    background-color: #d1edff;
    color: #0c5460;
}

.auth-page .alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

/* Form validation */
.auth-page .text-danger {
    color: #dc3545 !important;
    font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .auth-container {
        margin: 0 15px;
    }
    
    .auth-page .card-body {
        padding: 2rem 1.5rem;
    }
}

/* Conversation styles */
.conversation-container {
    background: white !important;
    padding: 1rem;
    /* Remove max-height and overflow-y for auto height */
}

.message-item {
    border-bottom: 1px solid #dee2e6;
    background-color: #ffffff;
    color: #333333;
    padding: 15px;
    transition: background-color 0.3s ease;
}

.message-item:hover {
    background-color: #f8f9fa;
}

.message-item:last-child {
    border-bottom: none;
}

/* Conversation message styles */
.conversation-container {
    background: white !important;
    padding: 1rem;
}

.message-item {
    max-width: 85%;
    margin: 0.5rem 0;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: #f8f9fa;
    color: #222;
}

.message-from-admin {
    margin-right: auto;
    text-align: left;
    background: #f1f1f3;
    border-top-left-radius: 4px;
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.message-from-customer {
    margin-left: auto;
    text-align: right;
    background: rgba(52,34,117,0.08);
    border-top-right-radius: 4px;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.message-item .message-content {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-weight: 500;
}

/* Ensure sender info uses darker text */
.message-item strong, .message-item small {
    color: #111 !important;
}

/* Button group spacing so action buttons have space between them */
.btn-group .btn {
    margin-right: 0.35rem;
}

.btn-group .btn:last-child {
    margin-right: 0;
}

/* Ensure invoice amounts use consistent font weight */
.table .text-amount {
    font-weight: 700;
}

/* Utility to right-align message timestamps on small screens */
@media (max-width: 576px) {
    .message-item {
        max-width: 100%;
    }
}

/* Text colors for readability */
.text-muted {
    color: #6c757d !important;
}

/* Footer styles */
footer {
    background-color: var(--flvn-primary) !important;
    color: white !important;
}

footer a {
    color: rgba(255, 255, 255, 0.8) !important;
}

footer a:hover {
    color: white !important;
}

/* Badge styles */
.badge {
    color: white;
    border-radius: 6px;
}

/* Badges for ticket/invoice statuses */
.badge-open {
    background-color: var(--flvn-primary) !important;
    color: white !important;
}

.badge-inprogress {
    background-color: var(--flvn-primary) !important;
    color: white !important;
}

.badge-closed {
    background-color: var(--flvn-primary) !important;
    color: white !important;
}

.badge-default {
    background-color: #6c757d !important;
    color: white !important;
}

.badge-pending {
    background-color: #ffcc00 !important;
    color: #222 !important;
}

.badge-paid {
    background-color: var(--flvn-primary) !important;
    color: white !important;
}

/* Overdue badge (red) */
.badge-overdue {
    background-color: #dc3545 !important;
    color: white !important;
}

/* Smooth scroll for sections with proper offset */
section {
    scroll-margin-top: 80px;
}

/* Modern dashboard enhancements */
.bg-gradient {
    background: linear-gradient(135deg, var(--flvn-primary) 0%, var(--flvn-primary-light) 100%) !important;
}

.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

/* Enhanced button group styling */
.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.btn-group .btn:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Page header styling for admin/customer pages */
.page-header {
    background: linear-gradient(135deg, var(--flvn-primary), var(--flvn-primary-light));
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(52, 34, 117, 0.2);
}

.content-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    margin-bottom: 2rem;
}

/* Theme overrides to enforce FLVN purple across UI */
:root {
    --flvn-primary: #342275;
    --flvn-primary-dark: #2a1c5f;
    --flvn-primary-light: #4a2c85;
}

/* Ensure consistent border radius across cards and buttons */
.card,
.auth-page .card,
.service-card,
.feature-item {
    border-radius: 6px !important;
}

.card-header {
    border-radius: 6px 6px 0 0 !important;
}

.btn,
.btn-primary,
.btn-outline-primary,
.btn-success,
.btn-info,
.btn-warning,
.btn-outline-success,
.btn-outline-info,
.btn-outline-warning {
    border-radius: 6px !important;
}

/* Override Bootstrap color utilities to use FLVN purple */
.text-primary,
.text-success,
.text-info {
    color: var(--flvn-primary) !important;
}

.bg-primary,
.bg-success,
.bg-info {
    background-color: var(--flvn-primary) !important;
    color: white !important;
}

/* Make all button variants use the purple theme */
.btn-primary,
.btn-success,
.btn-info,
.btn-warning {
    background-color: var(--flvn-primary) !important;
    border-color: var(--flvn-primary) !important;
    color: white !important;
}

.btn-outline-primary,
.btn-outline-success,
.btn-outline-info,
.btn-outline-warning {
    border-color: var(--flvn-primary) !important;
    color: var(--flvn-primary) !important;
    background-color: transparent !important;
}

.btn-outline-primary:hover,
.btn-outline-success:hover,
.btn-outline-info:hover,
.btn-outline-warning:hover {
    background-color: var(--flvn-primary) !important;
    color: white !important;
}

/* Welcome header styling for customer dashboard */
.welcome-header .card-body,
.welcome-header h1,
.welcome-header p {
    color: var(--flvn-primary) !important;
}

/* If welcome-header uses bg-gradient, ensure text remains readable */
.welcome-header.bg-gradient {
    background: #ffffff !important;
}

/* Circle icon used in overview cards */
.circle-icon {
    background-color: var(--flvn-primary) !important;
    color: white !important;
    border-radius: 50% !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
}

/* Adjust small variants */
.circle-icon .bi {
    font-size: 1.25rem;
}

/* Ensure badges have readable white text on colored backgrounds */
.badge {
    color: white !important;
    border-radius: 6px !important;
}

/* Table hover using subtle purple */
.table-hover tbody tr:hover {
    background-color: rgba(52, 34, 117, 0.04) !important;
}

/* Additional overrides for customer dashboard specifics */

/* Force purple text for card bodies that use bg-gradient (welcome header) */
.card.bg-gradient .card-body,
.card.bg-gradient .card-body h1,
.card.bg-gradient .card-body h2,
.card.bg-gradient .card-body h3,
.card.bg-gradient .card-body p {
    color: var(--flvn-primary) !important;
}

/* Ensure icons inside circular backgrounds are visible (white) */
.rounded-circle i,
.rounded-circle .bi,
.circle-icon i,
.circle-icon .bi {
    color: white !important;
}

/* Enforce global 6px radius even if inline styles present */
.card,
.card-header,
.card-body,
.btn,
service-card,
feature-item,
.auth-page .card {
    border-radius: 6px !important;
}

/* Make small circle sizes consistent */
.bg-opacity-10.p-3.rounded-circle,
.circle-icon {
    width: 48px !important;
    height: 48px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* If any element still forces white text in welcome area, override it */
.card.bg-gradient .text-white {
    color: var(--flvn-primary) !important;
}

/* Ensure secondary buttons also use purple theme */
.btn-secondary,
.btn-outline-secondary {
    background-color: var(--flvn-primary) !important;
    border-color: var(--flvn-primary) !important;
    color: white !important;
}

.btn-outline-secondary:hover {
    background-color: var(--flvn-primary-dark) !important;
    color: white !important;
}

/* Ensure circle-icon spacing on smaller screens */
@media (max-width: 576px) {
    .circle-icon {
        width: 42px !important;
        height: 42px !important;
    }
}

/* Sidebar adjustments: ensure Main Site and Logout share same styling as nav links */
.sidebar .nav-item .btn {
    width: 100%;
    text-align: left;
    padding-left: 1rem;
}

.sidebar .nav-item form {
    margin: 0;
}

/* Ensure small spacing between sidebar nav items */
.sidebar .nav.flex-column .nav-item {
    margin-bottom: 0.35rem;
}

/* Make Change Password button use primary styling */
.btn.btn-primary.w-100, .btn-primary {
    border-radius: 6px !important;
}

/* Improved hero-graphic icon animation and spacing */
.hero-graphic .floating-elements {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 48px;
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
    padding-top: 32px;
    padding-bottom: 32px;
}
.hero-graphic .floating-card {
    background: rgba(255,255,255,0.08);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(52,34,117,0.12);
    padding: 32px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.3s;
    animation: floatY 2.5s ease-in-out infinite;
    animation-delay: var(--delay, 0s);
}
@keyframes floatY {
    0% { transform: translateY(0); }
    50% { transform: translateY(-22px) scale(1.08); box-shadow: 0 8px 32px rgba(52,34,117,0.18); }
    100% { transform: translateY(0); }
}
.hero-graphic .floating-card:hover {
    box-shadow: 0 12px 36px rgba(52,34,117,0.22);
    transform: scale(1.12);
}

/* Extra spacing for Index page sections */
.index-section {
    padding-top: 10rem !important;
    padding-bottom: 10rem !important;
}

/* Ensure hero section keeps its full height but doesn't get extra top padding */
.hero-section.index-section {
    padding-top: 0 !important;
    min-height: 100vh;
}

/* Status Pill Styles - Standardized across all pages */
.status-pill {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    display: inline-block;
    border: none;
}

/* Ticket Status Pills */
.status-ticket-new {
    background-color: #dc3545;
    color: white;
}

.status-ticket-open {
    background-color: #007bff;
    color: white;
}

.status-ticket-in-progress {
    background-color: #ffc107;
    color: #212529;
}

.status-ticket-resolved {
    background-color: #28a745;
    color: white;
}

.status-ticket-closed {
    background-color: #6c757d;
    color: white;
}

/* Invoice Status Pills */
.status-invoice-pending {
    background-color: #dc3545;
    color: white;
}

.status-invoice-paid {
    background-color: #28a745;
    color: white;
}

.status-invoice-partially-paid {
    background-color: #ffc107;
    color: #212529;
}

.status-invoice-overdue {
    background-color: #dc3545;
    color: white;
}

.status-invoice-cancelled {
    background-color: #6c757d;
    color: white;
}

/* Override existing badge styles to use new status pills */
.badge.bg-success,
.badge.bg-warning,
.badge.bg-danger,
.badge.bg-secondary,
.badge.bg-primary {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Utility classes for quick status styling */
.text-status-open { color: #dc3545 !important; }
.text-status-closed { color: #6f42c1 !important; }
.text-status-pending { color: #dc3545 !important; }
.text-status-paid { color: #28a745 !important; }
.text-status-overdue { color: #dc3545 !important; }
.text-status-cancelled { color: #6f42c1 !important; }

/* Sidebar navigation separators and categories */
.nav-separator {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.2);
    margin: 0.5rem 1rem;
}

.nav-category {
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
}

/* Ensure admin logout button remains white */
.sidebar .btn-outline-light {
    color: white !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

.sidebar .btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: white !important;
    color: white !important;
}