/* ========================================
   Supply & Demand Platform - Color Scheme
   Based on PowerApps Design Specification
   ======================================== */

:root {
    /* Status Colors */
    --status-in-progress: #17a2b8;
    --status-approved: #28a745;
    --status-rejected: #dc3545;
    --status-imported: #6c757d;
    --status-committed: #007bff;
    --status-cancelled: #ffc107;
    --status-recycled: #6f42c1;

    /* App Colors */
    --supply-primary: #28a745;
    --supply-dark: #1e7e34;
    --demand-primary: #007bff;
    --demand-dark: #0056b3;

    /* Neutral Colors */
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;

    /* Background Colors */
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;

    /* Border Colors */
    --border-color: #dee2e6;
    --border-light: #e0e0e0;
}

/* ========================================
   Global Font Size Adjustments
   ======================================== */

body {
    font-size: 0.875rem; /* 14px - reduced from default 16px */
}

h1 {
    font-size: 2rem; /* 32px - reduced from 2.5rem */
}

h2 {
    font-size: 1.5rem; /* 24px - reduced from 2rem */
}

h3 {
    font-size: 1.25rem; /* 20px - reduced from 1.75rem */
}

h4 {
    font-size: 1.125rem; /* 18px - reduced from 1.5rem */
}

h5 {
    font-size: 1rem; /* 16px - reduced from 1.25rem */
}

h6 {
    font-size: 0.875rem; /* 14px - reduced from 1rem */
}

.lead {
    font-size: 1.125rem; /* 18px - reduced from 1.25rem */
}

.btn {
    font-size: 0.875rem; /* 14px */
    padding: 0.5rem 1rem; /* Slightly reduced padding */
}

.btn-lg {
    font-size: 1rem; /* 16px - reduced from 1.25rem */
    padding: 0.625rem 1.25rem;
}

.btn-sm {
    font-size: 0.8125rem; /* 13px */
    padding: 0.375rem 0.75rem;
}

.card-title {
    font-size: 1.125rem; /* 18px - reduced from 1.25rem */
}

.card-text {
    font-size: 0.875rem; /* 14px */
}

.table {
    font-size: 0.875rem; /* 14px */
}

.form-label {
    font-size: 0.875rem; /* 14px */
}

.form-control, .form-select {
    font-size: 0.875rem; /* 14px */
    padding: 0.5rem 0.75rem;
}

/* Status Badge Styles */
.badge.bg-in-progress {
    background-color: var(--status-in-progress) !important;
    color: white;
}

.badge.bg-approved {
    background-color: var(--status-approved) !important;
    color: white;
}

.badge.bg-rejected {
    background-color: var(--status-rejected) !important;
    color: white;
}

.badge.bg-imported {
    background-color: var(--status-imported) !important;
    color: white;
}

.badge.bg-committed {
    background-color: var(--status-committed) !important;
    color: white;
}

.badge.bg-cancelled {
    background-color: var(--status-cancelled) !important;
    color: #212529;
}

.badge.bg-recycled {
    background-color: var(--status-recycled) !important;
    color: white;
}

/* Stat Card Styles */
.stat-card {
    border-left: 4px solid;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.stat-card.in-progress {
    border-left-color: var(--status-in-progress);
}

.stat-card.approved {
    border-left-color: var(--status-approved);
}

.stat-card.rejected {
    border-left-color: var(--status-rejected);
}

.stat-card.imported {
    border-left-color: var(--status-imported);
}

.stat-card.cancelled {
    border-left-color: var(--status-cancelled);
}

.stat-card.committed {
    border-left-color: var(--status-committed);
}

.stat-card.recycled {
    border-left-color: var(--status-recycled);
}

/* Text Colors */
.text-in-progress {
    color: var(--status-in-progress) !important;
}

.text-approved {
    color: var(--status-approved) !important;
}

.text-rejected {
    color: var(--status-rejected) !important;
}

.text-imported {
    color: var(--status-imported) !important;
}

.text-committed {
    color: var(--status-committed) !important;
}

.text-cancelled {
    color: var(--status-cancelled) !important;
}

.text-recycled {
    color: var(--status-recycled) !important;
}

/* Hover Card Animation */
.hover-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,.15) !important;
}

/* Badge Subtle Styles */
.badge.bg-success-subtle {
    background-color: rgba(40, 167, 69, 0.1) !important;
}

.badge.bg-primary-subtle {
    background-color: rgba(0, 123, 255, 0.1) !important;
}

.badge.border-success-subtle {
    border-color: rgba(40, 167, 69, 0.3) !important;
}

.badge.border-primary-subtle {
    border-color: rgba(0, 123, 255, 0.3) !important;
}

/* Table Styles */
.table-hover tbody tr:hover {
    background-color: rgba(0, 120, 212, 0.05);
}

/* ========================================
   Supply App Sidebar Styles
   ======================================== */

body {
    overflow-x: hidden;
}

#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 240px;
    background: linear-gradient(180deg, #1e7e34 0%, #28a745 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#sidebar.collapsed {
    width: 68px;
}

#sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.625rem 1rem;
    margin: 0.125rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    white-space: nowrap;
    position: relative;
    text-decoration: none;
}

#sidebar .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

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

#sidebar .nav-link i {
    width: 20px;
    font-size: 1.125rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
    text-align: center;
}

#sidebar.collapsed .sidebar-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
    display: none;
}

.sidebar-text {
    transition: opacity 0.3s ease, width 0.3s ease;
    opacity: 1;
}

#sidebar.collapsed .nav-link {
    margin: 0.125rem 0.5rem;
    padding: 0.625rem;
    justify-content: center;
}

#sidebar.collapsed .nav-link i {
    margin: 0;
    width: auto;
}

#sidebar.collapsed .sidebar-brand {
    display: none;
}

#sidebar.collapsed .sidebar-header {
    padding: 1rem 0.5rem;
    justify-content: center;
}

#sidebar.collapsed .sidebar-toggle-top {
    margin: 0 auto;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem 0;
}

.sidebar-content::-webkit-scrollbar {
    width: 4px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.sidebar-brand {
    color: #fff;
    font-size: 1.125rem;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    transition: all 0.2s ease;
    flex: 1;
}

.sidebar-brand:hover {
    color: #fff;
    opacity: 0.9;
}

.sidebar-brand i {
    font-size: 1.5rem;
}

.sidebar-toggle-top {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #fff !important;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.sidebar-toggle-top:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff !important;
}

.sidebar-toggle-top:focus {
    box-shadow: none;
    outline: none;
}

.sidebar-toggle-icon {
    transition: transform 0.3s ease;
}

#sidebar.collapsed .sidebar-toggle-icon {
    transform: rotate(180deg);
}

.sidebar-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0.75rem;
    border: none;
}

.main-content {
    margin-left: 240px;
    min-height: 100vh;
    background-color: var(--bg-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: auto;
    width: calc(100% - 240px);
}

.main-content.expanded {
    margin-left: 68px;
    width: calc(100% - 68px);
}

.top-bar {
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* ========================================
   Demand App Sidebar Styles
   ======================================== */

#sidebar.demand {
    background: linear-gradient(180deg, #0056b3 0%, #007bff 100%);
}

/* ========================================
   Home Page Responsive Layout
   ======================================== */

/* Single Module Layout */
#app-cards-container .col-md-6:only-child {
    max-width: 500px;
    margin: 0 auto;
}

/* Two Modules Layout */
#app-cards-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

/* Responsive breakpoints for app cards */
@media (max-width: 1200px) {
    #app-cards-container .col-lg-5 {
        flex: 0 0 calc(50% - 0.75rem);
        max-width: calc(50% - 0.75rem);
    }
}

@media (max-width: 768px) {
    #app-cards-container .col-md-6,
    #app-cards-container .col-lg-5 {
        flex: 0 0 100%;
        max-width: 100%;
    }

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

    .card-body .d-flex {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-body .flex-grow-1 {
        margin-left: 0 !important;
        margin-top: 0.75rem;
    }
}

/* Authentication/No Access Card Styles */
.card.border-0.shadow-lg {
    border-radius: 8px;
    transition: all 0.3s ease;
}

.card.border-0.shadow-lg:hover {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}

.card-body i[style*="font-size"] {
    display: block;
    margin: 0 auto;
}

/* Button Styles for Home Page */
.btn-lg {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-lg:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Centered Container for Auth Messages */
.row.justify-content-center {
    min-height: 400px;
    display: flex;
    align-items: center;
}

/* Badge Styles for Module Features */
.badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
    font-weight: 500;
}

