/* ============================================
   BRAND COLORS & BASE STYLES
   ============================================ */
:root {
  --brand-primary: #1b75bb;
  --brand-secondary: #4b5eaa;
  --brand-accent: #27bdbe;
  --brand-warning: #f48220;
  --gradient-orange: #f58a22;
  --gradient-blue: #009fce;
}

.bg-primary { background-color: var(--brand-primary) !important; }
.bg-secondary { background-color: var(--brand-secondary) !important; }
.btn-accent { background-color: var(--brand-accent); color: #fff; }
.btn-warning { background-color: var(--brand-warning); border-color: var(--brand-warning); }
.navbar-brand { letter-spacing: .5px; }
.card-header { font-weight: 600; }

/* ============================================
   NAVBAR - ORANGE TO BLUE GRADIENT
   ============================================ */
.navbar-custom-gradient {
    background-image: linear-gradient(to right, #f58a22 33%, #009fce 100%) !important;
}

/* Ensure text contrast on gradient navbar */
.navbar-custom-gradient .navbar-brand,
.navbar-custom-gradient .nav-link,
.navbar-custom-gradient .navbar-text {
    color: white !important;
}

.navbar-custom-gradient .nav-link:hover {
    color: #fff3e0 !important;
}

/* ACTIVE TAB HIGHLIGHTING */
.navbar-custom-gradient .nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.navbar-custom-gradient .nav-link.active {
    color: white !important;
    font-weight: 600;
}

.navbar-custom-gradient .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 3px;
    background-color: white;
    border-radius: 2px;
}

/* Hover effect for non-active links */
.navbar-custom-gradient .nav-link:not(.active):hover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 1px;
    transition: all 0.3s ease;
}

/* ============================================
   GLOBAL GRADIENT STYLES FOR ALL PAGES
   Applied to card headers, buttons, etc.
   ============================================ */

/* Global Gradient Header Style - Orange to Blue */
.gradient-header {
    background: linear-gradient(to right, #f58a22 33%, #009fce 100%) !important;
    color: white !important;
}

/* Apply gradient to ALL blue background card headers automatically */
.card-header.bg-primary,
.card-header.bg-info {
    background: linear-gradient(to right, #f58a22 33%, #009fce 100%) !important;
    color: white !important;
}

/* Reusable gradient class for card headers */
.card-header-gradient {
    background-image: linear-gradient(to right, #f58a22 33%, #009fce 100%) !important;
    color: white !important;
    border-bottom: none !important;
}

/* Card title text color on gradient backgrounds */
.gradient-header .card-title,
.card-header-gradient .card-title,
.card-header.bg-primary .card-title,
.card-header.bg-info .card-title {
    color: white !important;
}

/* Ensure all text elements are white on gradient backgrounds */
.gradient-header h1,
.gradient-header h2,
.gradient-header h3,
.gradient-header h4,
.gradient-header h5,
.gradient-header h6,
.card-header-gradient h1,
.card-header-gradient h2,
.card-header-gradient h3,
.card-header-gradient h4,
.card-header-gradient h5,
.card-header-gradient h6,
.card-header.bg-primary h1,
.card-header.bg-primary h2,
.card-header.bg-primary h3,
.card-header.bg-primary h4,
.card-header.bg-primary h5,
.card-header.bg-primary h6,
.card-header.bg-info h1,
.card-header.bg-info h2,
.card-header.bg-info h3,
.card-header.bg-info h4,
.card-header.bg-info h5,
.card-header.bg-info h6 {
    color: white !important;
}

/* Icons on gradient backgrounds */
.gradient-header i,
.card-header-gradient i,
.card-header.bg-primary i,
.card-header.bg-info i {
    color: white !important;
}

/* Badge adjustments on gradient headers */
.gradient-header .badge.bg-light,
.card-header-gradient .badge.bg-light,
.card-header.bg-primary .badge.bg-light,
.card-header.bg-info .badge.bg-light {
    background-color: rgba(255, 255, 255, 0.9) !important;
    color: #333 !important;
}

/* Links on gradient backgrounds */
.gradient-header a,
.card-header-gradient a,
.card-header.bg-primary a,
.card-header.bg-info a {
    color: rgba(255, 255, 255, 0.9);
}

.gradient-header a:hover,
.card-header-gradient a:hover,
.card-header.bg-primary a:hover,
.card-header.bg-info a:hover {
    color: white;
    text-decoration: underline;
}

/* Small text on gradient backgrounds */
.gradient-header small,
.card-header-gradient small,
.card-header.bg-primary small,
.card-header.bg-info small {
    color: rgba(255, 255, 255, 0.85);
}

/* ============================================
   BUTTONS - GRADIENT STYLES FOR ALL BUTTONS
   ============================================ */

/* Primary button gradient - applies to ALL primary buttons */
.btn-primary,
button.btn-primary,
a.btn-primary {
    background: linear-gradient(to right, #f58a22, #009fce) !important;
    border: none !important;
    color: white !important;
    transition: all 0.3s ease;
}

.btn-primary:hover,
button.btn-primary:hover,
a.btn-primary:hover {
    background: linear-gradient(to right, #e47a12, #0089be) !important;
    border: none !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-primary:active,
button.btn-primary:active,
a.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Success button - GREEN COLOR */
.btn-success,
button.btn-success,
a.btn-success {
    background-color: #28a745 !important;
    background-image: none !important;
    border: none !important;
    color: white !important;
    transition: all 0.3s ease;
}

.btn-success:hover,
button.btn-success:hover,
a.btn-success:hover {
    background-color: #218838 !important;
    background-image: none !important;
    border: none !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-success:active,
button.btn-success:active,
a.btn-success:active {
    background-color: #1e7e34 !important;
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Info button gradient (for cyan buttons like "Create Mentor Account") */
.btn-info,
button.btn-info,
a.btn-info {
    background: linear-gradient(to right, #f58a22, #009fce) !important;
    border: none !important;
    color: white !important;
    transition: all 0.3s ease;
}

.btn-info:hover,
button.btn-info:hover,
a.btn-info:hover {
    background: linear-gradient(to right, #e47a12, #0089be) !important;
    border: none !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* ============================================
   SPECIAL BADGES WITH GRADIENT
   ============================================ */

/* Info badges (like "Full Project Duration", "1 Projects") */
.badge.bg-info {
    background: linear-gradient(to right, #f58a22, #009fce) !important;
    color: white !important;
    border: none !important;
}

/* Primary badges */
.badge.bg-primary {
    background: linear-gradient(to right, #f58a22, #009fce) !important;
    color: white !important;
    border: none !important;
}

/* ============================================
   TABLE HEADERS - BLACK BACKGROUND WITH WHITE TEXT
   ============================================ */

/* Dark table headers - BLACK BACKGROUND, WHITE TEXT */
.table-dark,
thead.table-dark,
.table thead.table-dark th,
.table-dark th,
.table-dark thead th,
.table-dark tbody th,
.table thead th {
    background-color: #212529 !important;
    background-image: none !important;
    color: white !important;
    border-color: #32383e !important;
}

/* Ensure table headers in all tables have white text */
.table thead th,
#analyticsTable thead th,
.table-responsive .table thead th,
.table-striped thead th,
.table-hover thead th {
    background-color: #212529 !important;
    background-image: none !important;
    color: white !important;
}

/* ============================================
   REPORTS PAGE - PROJECT CARDS STYLING
   ============================================ */

/* Hide Registration status badges on project cards */
.card-header .badge.bg-success,
.card-header .badge.bg-secondary,
.card-header span.badge:not(.bg-info) {
    display: none !important;
}

/* Keep batch name badges visible */
.card-header .badge.bg-info {
    display: inline-block !important;
    background: linear-gradient(to right, #f58a22, #009fce) !important;
    color: white !important;
}

/* Domain badge styling - Remove highlight, change to black text */
.card-body small .badge.bg-secondary,
.card-body small .badge.bg-info:not([class*="Project"]) {
    background-color: transparent !important;
    color: #000 !important;
    border: 1px solid #dee2e6;
    font-weight: normal;
    padding: 0.25em 0.5em;
}

/* Specific targeting for Domain text */
.card-body small.text-muted {
    color: #495057 !important;
}

.card-body small.text-muted strong {
    color: #212529 !important;
}

/* Clean up card header layout after removing status badge */
.card-header {
    padding: 1rem;
}

.card-header .d-flex {
    align-items: flex-start;
}

.card-header h6 {
    margin-bottom: 0.5rem;
    color: #212529;
}

/* Project team badge styling - keep gradient */
.card-body .badge[class*="Project"],
.card-body .badge[class*="project"] {
    background: linear-gradient(to right, #f58a22, #009fce) !important;
    color: white !important;
    font-weight: 500;
    padding: 0.35em 0.65em;
    border: none !important;
}

/* View Analytics button styling */
.card-body .btn-primary {
    background: linear-gradient(to right, #f58a22, #009fce) !important;
    border: none !important;
    color: white !important;
    width: 100%;
    transition: all 0.3s ease;
}

.card-body .btn-primary:hover {
    background: linear-gradient(to right, #e47a12, #0089be) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* ============================================
   RESPONSIVE FONT SIZING
   ============================================ */
@media (max-width: 768px) {
    h1, .h1 {
        font-size: 1.75rem;
    }
    h2, .h2 {
        font-size: 1.5rem;
    }
    h3, .h3 {
        font-size: 1.25rem;
    }
}

/* ============================================
   NAVBAR RESPONSIVE TWEAKS
   ============================================ */
@media (max-width: 576px) {
    .navbar .btn { 
        padding: .25rem .5rem; 
        font-size: .875rem; 
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Hover shadow effect for cards */
.hover-shadow {
    transition: box-shadow 0.3s ease-in-out;
}

.hover-shadow:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Input groups styling */
.input-group.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
    border-radius: 0.375rem;
    overflow: hidden;
}

/* Table styling */
.table-hover tbody tr:hover {
    background-color: rgba(245, 138, 34, 0.05);
}

/* Sticky table header */
.sticky-top {
    position: sticky;
    top: 0;
    z-index: 10;
}

/* ============================================
   MODAL HEADERS WITH GRADIENT
   ============================================ */
.modal-header.bg-primary,
.modal-header.bg-info,
.modal-header.bg-success {
    background: linear-gradient(to right, #f58a22 33%, #009fce 100%) !important;
    color: white !important;
}

.modal-header.bg-primary .modal-title,
.modal-header.bg-info .modal-title,
.modal-header.bg-success .modal-title {
    color: white !important;
}

.modal-header.bg-primary .btn-close,
.modal-header.bg-info .btn-close,
.modal-header.bg-success .btn-close {
    filter: brightness(0) invert(1);
}

/* ============================================
   ALERT STYLING
   ============================================ */
.alert {
    border-radius: 0.5rem;
    border-left: 4px solid;
}

.alert-info {
    border-left-color: #009fce;
}

.alert-warning {
    border-left-color: #f58a22;
}

/* ============================================
   PROGRESS BARS
   ============================================ */
.progress {
    background-color: #e9ecef;
    border-radius: 0.5rem;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* ============================================
   BREADCRUMB STYLING
   ============================================ */
.breadcrumb-item + .breadcrumb-item::before {
    color: #6c757d;
}

.breadcrumb-item.active {
    color: #f58a22;
}

/* ============================================
   SPECIFIC BUTTON CLASSES USED IN YOUR APP
   ============================================ */

/* Export buttons in reports page */
.btn-sm.btn-success {
    background-color: #28a745 !important;
    background-image: none !important;
    border: none !important;
    color: white !important;
}

.btn-sm.btn-success:hover {
    background-color: #218838 !important;
    background-image: none !important;
    transform: translateY(-1px);
}

.btn-sm.btn-primary {
    background: linear-gradient(to right, #f58a22, #009fce) !important;
    border: none !important;
    color: white !important;
}

.btn-sm.btn-primary:hover {
    background: linear-gradient(to right, #e47a12, #0089be) !important;
    transform: translateY(-1px);
}

/* "View Details" buttons */
.btn.btn-info.btn-sm,
.btn.btn-primary.btn-sm {
    background: linear-gradient(to right, #f58a22, #009fce) !important;
    border: none !important;
    color: white !important;
}

/* "View Attendance" buttons */
a.btn.btn-primary,
button.btn.btn-primary {
    background: linear-gradient(to right, #f58a22, #009fce) !important;
    border: none !important;
    color: white !important;
}

/* ============================================
   OVERRIDE ANY CONFLICTING BOOTSTRAP STYLES
   ============================================ */

/* Force gradient on all Bootstrap primary variants */
.btn-primary:not(:disabled):not(.disabled),
.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active {
    background: linear-gradient(to right, #f58a22, #009fce) !important;
    border: none !important;
    color: white !important;
}

/* Keep success button GREEN */
.btn-success:not(:disabled):not(.disabled),
.btn-success:not(:disabled):not(.disabled):active,
.btn-success:not(:disabled):not(.disabled).active {
    background-color: #28a745 !important;
    background-image: none !important;
    border: none !important;
    color: white !important;
}

.btn-info:not(:disabled):not(.disabled),
.btn-info:not(:disabled):not(.disabled):active,
.btn-info:not(:disabled):not(.disabled).active {
    background: linear-gradient(to right, #f58a22, #009fce) !important;
    border: none !important;
    color: white !important;
}

/* Remove focus outlines that might conflict */
.btn-primary:focus,
.btn-info:focus {
    box-shadow: 0 0 0 0.2rem rgba(245, 138, 34, 0.5) !important;
}

.btn-success:focus {
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5) !important;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .navbar,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .gradient-header,
    .card-header-gradient,
    .card-header.bg-primary,
    .card-header.bg-info {
        background: #333 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ============================================
   ENSURE TEXT READABILITY ON ALL GRADIENT BUTTONS
   ============================================ */

.btn-primary *,
.btn-info *,
.badge.bg-primary *,
.badge.bg-info * {
    color: white !important;
}

/* Ensure success button text is white */
.btn-success *,
.badge.bg-success * {
    color: white !important;
}

/* Icon colors on gradient buttons */
.btn-primary i,
.btn-info i {
    color: white !important;
}

/* Icon colors on success buttons */
.btn-success i {
    color: white !important;
}