/* ECN Help Desk System Custom Styles */
/* Energy Commission of Nigeria */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --ecn-green: #00A86B;
    --ecn-green-dark: #008855;
    --ecn-green-light: #00C97F;
    --ecn-green-gradient: linear-gradient(135deg, #00A86B 0%, #00C97F 100%);
    --ecn-gray: #6c757d;
    --ecn-light: #f8f9fa;
    --ecn-dark: #1a1a2e;
    --ecn-purple: #6C63FF;
    --ecn-blue: #4F46E5;
    --ecn-orange: #FF6B6B;
    --ecn-yellow: #FFD93D;
    --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 15px 50px rgba(0, 0, 0, 0.15);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Styles */
body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(0, 168, 107, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(76, 70, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

main {
    flex: 1;
    position: relative;
    z-index: 1;
}

/* ECN Brand Colors */
.bg-ecn-green {
    background-color: var(--ecn-green) !important;
}

.text-ecn-green {
    color: var(--ecn-green) !important;
}

.btn-ecn {
    background: var(--ecn-green-gradient);
    border: none;
    color: white;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 168, 107, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-ecn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-ecn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-ecn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 168, 107, 0.35);
    color: white;
}

.btn-outline-ecn {
    color: var(--ecn-green);
    border: 2px solid var(--ecn-green);
    font-weight: 600;
    transition: var(--transition);
    background: transparent;
    position: relative;
    overflow: hidden;
}

.btn-outline-ecn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--ecn-green-gradient);
    transition: left 0.4s ease;
    z-index: -1;
}

.btn-outline-ecn:hover::before {
    left: 0;
}

.btn-outline-ecn:hover {
    color: white;
    border-color: var(--ecn-green-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 168, 107, 0.25);
}

/* Custom Card Styles */
.card-header-ecn {
    background: var(--ecn-green-gradient);
    color: white;
    border-bottom: none;
    font-weight: 700;
    letter-spacing: 0.3px;
    padding: 1.25rem 1.5rem;
}

.card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-5px);
}

/* Status Badges */
.badge {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.badge-status-open {
    background: linear-gradient(135deg, #06B6D4 0%, #3B82F6 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3);
}

.badge-status-in-progress {
    background: linear-gradient(135deg, #F59E0B 0%, #FFD93D 100%);
    color: #1a1a2e;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.badge-status-resolved {
    background: linear-gradient(135deg, #10B981 0%, #00C97F 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.badge-status-closed {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.badge-priority-low {
    background: linear-gradient(135deg, #10B981 0%, #00C97F 100%);
    color: white;
}

.badge-priority-medium {
    background: linear-gradient(135deg, #F59E0B 0%, #FFD93D 100%);
    color: #1a1a2e;
}

.badge-priority-high {
    background: linear-gradient(135deg, #F97316 0%, #FB923C 100%);
    color: white;
}

.badge-priority-urgent {
    background: linear-gradient(135deg, #DC2626 0%, #EF4444 100%);
    color: white;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

/* Dashboard Cards */
.dashboard-card {
    transition: var(--transition);
    border: none;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    overflow: hidden;
    position: relative;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--ecn-green-gradient);
}

.dashboard-card.border-primary::before {
    background: linear-gradient(135deg, #4F46E5 0%, #6C63FF 100%);
}

.dashboard-card.border-info::before {
    background: linear-gradient(135deg, #06B6D4 0%, #3B82F6 100%);
}

.dashboard-card.border-success::before {
    background: linear-gradient(135deg, #10B981 0%, #00C97F 100%);
}

.dashboard-card.border-warning::before {
    background: linear-gradient(135deg, #F59E0B 0%, #FFD93D 100%);
}

.dashboard-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}

.dashboard-card .card-body {
    padding: 2rem;
}

.dashboard-icon {
    font-size: 3rem;
    background: var(--ecn-green-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 4px 8px rgba(0, 168, 107, 0.2));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.dashboard-card .text-primary {
    color: #4F46E5 !important;
}

.dashboard-card .text-info {
    color: #06B6D4 !important;
}

.dashboard-card .text-success {
    color: #10B981 !important;
}

.dashboard-card .text-warning {
    color: #F59E0B !important;
}

.dashboard-card h3 {
    font-weight: 800;
    font-size: 2.5rem;
    margin-top: 1rem;
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--ecn-green) 0%, var(--ecn-green-dark) 100%);
    position: relative;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="1" fill="white" opacity="0.1"/><circle cx="10" cy="90" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
}

.login-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

.login-header {
    background: var(--ecn-green);
    color: white;
    border-radius: 15px 15px 0 0;
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.login-body {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* Form Enhancements */
.form-control:focus {
    border-color: var(--ecn-green);
    box-shadow: 0 0 0 0.2rem rgba(0, 122, 51, 0.25);
}

.form-select:focus {
    border-color: var(--ecn-green);
    box-shadow: 0 0 0 0.2rem rgba(0, 122, 51, 0.25);
}

.form-control,
.form-select {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-control:hover,
.form-select:hover {
    border-color: var(--ecn-green);
}

/* Table Enhancements */
.table {
    border-radius: 12px;
    overflow: hidden;
}

.table th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: var(--ecn-dark);
    font-weight: 700;
    border-top: none;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    padding: 1rem;
    border-bottom: 2px solid var(--ecn-green);
}

.table-hover tbody tr {
    transition: var(--transition);
    cursor: pointer;
}

.table-hover tbody tr:hover {
    background: linear-gradient(90deg, rgba(0, 168, 107, 0.05) 0%, rgba(0, 168, 107, 0.02) 100%);
    transform: scale(1.005);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.table td {
    padding: 1rem;
    vertical-align: middle;
}

/* Ticket Number Styling */
.ticket-number {
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-weight: 700;
    color: var(--ecn-green);
    background: linear-gradient(135deg, rgba(0, 168, 107, 0.1) 0%, rgba(0, 201, 127, 0.15) 100%);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    border: 1px solid rgba(0, 168, 107, 0.2);
    display: inline-block;
}

/* File Upload Styling */
.file-upload-area {
    border: 2px dashed var(--ecn-green);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(0, 122, 51, 0.02) 0%, rgba(0, 122, 51, 0.05) 100%);
}

.file-upload-area:hover {
    background-color: rgba(0, 122, 51, 0.05);
    border-color: var(--ecn-green-dark);
    transform: scale(1.02);
}

.file-upload-area.dragover {
    background-color: rgba(0, 122, 51, 0.1);
    border-color: var(--ecn-green-dark);
    transform: scale(1.05);
}

/* Navigation Enhancements */
.navbar-brand {
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-dark .navbar-nav .nav-link {
    transition: all 0.3s ease;
    border-radius: 5px;
    margin: 0 2px;
}

.navbar-dark .navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.dropdown-menu {
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    overflow: hidden;
}

.dropdown-item {
    transition: all 0.3s ease;
    padding: 10px 20px;
}

.dropdown-item:hover {
    background-color: var(--ecn-green);
    color: white;
    transform: translateX(5px);
}

/* Breadcrumb Styling */
.breadcrumb {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 10px 20px;
    margin-bottom: 20px;
}

.breadcrumb-item a {
    text-decoration: none;
    transition: all 0.3s ease;
}

.breadcrumb-item a:hover {
    transform: translateX(2px);
}

/* Alert Enhancements */
.alert {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-left: 4px solid;
}

.alert-success {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.alert-danger {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
}

.alert-info {
    border-left-color: #17a2b8;
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
}

.alert-warning {
    border-left-color: #ffc107;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
}

/* Loading States */
.btn:disabled {
    opacity: 0.6;
    transform: none !important;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .dashboard-card {
        margin-bottom: 1rem;
    }

    .login-header {
        padding: 1.5rem;
    }

    .login-body {
        padding: 1.5rem;
    }

    .navbar-brand small {
        display: none;
    }

    .table-responsive {
        border-radius: 10px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--ecn-green);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ecn-green-dark);
}

/* Sidebar Navigation */
.sidebar {
    position: sticky;
    top: 0;
    height: calc(100vh - 76px);
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar .nav-link {
    color: #495057;
    border-radius: 8px;
    transition: all 0.3s ease;
    padding: 10px 15px;
    margin-bottom: 2px;
}

.sidebar .nav-link:hover {
    background-color: rgba(0, 122, 51, 0.1);
    color: var(--ecn-green);
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    background-color: var(--ecn-green);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 122, 51, 0.3);
}

.sidebar .nav-link.text-danger:hover {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    transform: translateX(5px);
}

.user-info {
    background: linear-gradient(135deg, rgba(0, 122, 51, 0.1) 0%, rgba(0, 122, 51, 0.05) 100%);
    border-radius: 10px;
    padding: 15px;
}

.avatar {
    font-weight: bold;
    font-size: 1.2rem;
}

/* Responsive Sidebar */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -250px;
        top: 76px;
        z-index: 1000;
        transition: left 0.3s ease;
        background: white;
    }

    .sidebar.show {
        left: 0;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .dashboard-card {
        margin-bottom: 1rem;
    }

    .login-header {
        padding: 1.5rem;
    }

    .login-body {
        padding: 1.5rem;
    }
}

/* Custom Loading Spinner */
.spinner-ecn {
    color: var(--ecn-green);
}

/* Alert Enhancements */
.alert-ecn {
    background-color: rgba(0, 122, 51, 0.1);
    border-color: var(--ecn-green);
    color: var(--ecn-green-dark);
}

/* Knowledge Base Styling */
.kb-article {
    border-left: 4px solid var(--ecn-green);
    transition: all 0.2s ease;
}

.kb-article:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Attachment Preview */
.attachment-preview {
    max-width: 100px;
    max-height: 100px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

/* Modal Fixes */
.modal-header .btn-close {
    position: relative;
    z-index: 1060;
    opacity: 1;
}

.modal-header {
    position: relative;
    z-index: 1055;
}


/* ===================================
   MODAL BACKDROP FIX - CRITICAL
   Prevents backdrop from blocking modal interactions
   =================================== */

/* Ensure modal backdrop is behind modal content */
.modal-backdrop {
    z-index: 1040 !important;
    pointer-events: none !important;
    /* CRITICAL: Allows clicks to pass through */
}

/* Ensure modal is above backdrop */
.modal {
    z-index: 1050 !important;
    pointer-events: auto !important;
    /* Ensure modal itself is clickable */
}

/* Ensure modal dialog is fully interactive */
.modal-dialog {
    z-index: 1051 !important;
    pointer-events: auto !important;
}

/* Ensure modal content is fully interactive */
.modal-content {
    z-index: 1052 !important;
    pointer-events: auto !important;
    position: relative;
}

/* Backdrop opacity */
.modal-backdrop.show {
    opacity: 0.5 !important;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden !important;
    padding-right: 0 !important;
    /* Prevent layout shift */
}

/* Ensure all form elements in modals are clickable */
.modal input,
.modal select,
.modal textarea,
.modal button {
    pointer-events: auto !important;
    z-index: 1053 !important;
    position: relative;
}

/* Fix for multiple modals */
.modal.show {
    display: block !important;
    z-index: 1050 !important;
}

/* Ensure modal header/footer buttons work */
.modal-header,
.modal-body,
.modal-footer {
    pointer-events: auto !important;
    position: relative;
    z-index: 1053 !important;
}

.btn-close-white {
    filter: brightness(0) invert(1);
    opacity: 1;
}

.btn-close-white:hover {
    opacity: 0.8;
}