/* ===== MODERN ENTERPRISE DASHBOARD THEME ===== */

/* Import Inter font for professional typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* CSS Variables for consistent theming */
:root {
    --primary-600: #1e3a8a;
    --primary-500: #3b82f6;
    --primary-400: #60a5fa;
    --primary-100: #dbeafe;
    --primary-50: #eff6ff;
    
    --gray-900: #0f172a;
    --gray-800: #1e293b;
    --gray-700: #334155;
    --gray-600: #475569;
    --gray-500: #64748b;
    --gray-400: #94a3b8;
    --gray-300: #cbd5e1;
    --gray-200: #e2e8f0;
    --gray-100: #f1f5f9;
    --gray-50: #f8fafc;
    
    --white: #ffffff;
    --success: #059669;
    --warning: #d97706;
    --error: #dc2626;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== GLOBAL STYLES ===== */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--gray-50);
    margin: 0;
    padding: 0;
    color: var(--gray-900);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    background-color: var(--gray-50);
}

/* ===== MODERN SIDEBAR ===== */
.sidebar {
    min-width: 280px;
    max-width: 280px;
    background: linear-gradient(180deg, var(--primary-600) 0%, var(--primary-700, #1e40af) 100%);
    color: var(--white);
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1000;
}

.sidebar.collapsed {
    margin-left: -280px;
}

.sidebar-header {
    padding: 24px 20px;
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header h3::before {
    content: '🚛';
    font-size: 24px;
}

#user-info {
    margin-top: 12px;
    padding: 12px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#user-info small {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: 500;
}

.sidebar ul.components {
    padding: 16px 0;
    margin: 0;
    list-style: none;
}

.sidebar ul li {
    margin: 0;
}

.sidebar ul li a {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition-fast);
    border-left: 3px solid transparent;
    gap: 12px;
}

.sidebar ul li a:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary-400);
    transform: translateX(2px);
}

.sidebar ul li a.active {
    background: rgba(255, 255, 255, 0.15);
    border-left-color: var(--white);
    color: var(--white);
}

.sidebar ul li a::before {
    content: '';
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

.sidebar ul li:first-child a::before { content: '☰'; }
.sidebar ul li:nth-child(2) a::before { content: '📦'; }
.sidebar ul li:nth-child(3) a::before { content: '🖼️'; }
.sidebar ul li:nth-child(4) a::before { content: '💾'; }
.sidebar ul li:nth-child(5) a::before { content: '📊'; }

/* Auth links styling */
.sidebar ul li.border-top {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 16px;
    padding-top: 16px;
}

/* ===== MAIN CONTENT AREA ===== */
#content {
    flex: 1;
    padding: 32px;
    background-color: var(--gray-50);
    transition: var(--transition);
    overflow-x: hidden;
}

/* ===== MODERN CARD DESIGN ===== */
.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--gray-300);
}

.card-header {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    padding: 20px 24px;
    font-weight: 600;
    color: var(--gray-800);
}

.card-body {
    padding: 24px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
}

/* ===== MODERN BUTTONS ===== */
.btn {
    font-family: inherit;
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
    border: 1px solid transparent;
    padding: 10px 16px;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn:focus {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--primary-500);
    color: var(--white);
    border-color: var(--primary-500);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-600);
    border-color: var(--primary-600);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: var(--white);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border-color: var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-200);
    border-color: var(--gray-400);
    color: var(--gray-800);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-600);
    border-color: var(--primary-300);
}

.btn-outline-primary:hover {
    background: var(--primary-50);
    border-color: var(--primary-500);
    color: var(--primary-700);
}

.btn-outline-secondary {
    background: transparent;
    color: var(--gray-600);
    border-color: var(--gray-300);
}

.btn-outline-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    color: var(--gray-700);
}

.btn-outline-secondary.active {
    background: var(--primary-500);
    border-color: var(--primary-500);
    color: var(--white);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

/* ===== MODERN FORM CONTROLS ===== */
.form-control, .form-select {
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    padding: 10px 12px;
    font-size: 14px;
    transition: var(--transition-fast);
    background: var(--white);
    color: var(--gray-900);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.form-label {
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

/* ===== MODERN TABS ===== */
.nav-tabs {
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 24px;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: var(--gray-600);
    font-weight: 500;
    padding: 12px 20px;
    transition: var(--transition-fast);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-600);
    border-bottom-color: var(--primary-300);
    background: var(--primary-50);
}

.nav-tabs .nav-link.active {
    color: var(--primary-600);
    border-bottom-color: var(--primary-500);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

/* ===== TABLES & LISTS ===== */
.table {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table th {
    background: var(--gray-50);
    color: var(--gray-700);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px;
    border-bottom: 2px solid var(--gray-200);
}

.table td {
    padding: 16px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-800);
}

.table tbody tr:hover {
    background: var(--gray-50);
}

/* ===== REQUIREMENT & QUESTION ITEMS ===== */
.question-item, .req-item {
    padding: 16px;
    border-bottom: 1px solid var(--gray-200);
    cursor: pointer;
    transition: var(--transition-fast);
    background: var(--white);
    margin-bottom: 2px;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
}

.question-item:hover, .req-item:hover {
    background: var(--primary-50);
    border-color: var(--primary-300);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.req-item {
    position: relative;
    overflow: hidden;
}

.req-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-500);
    opacity: 0;
    transition: var(--transition-fast);
}

.req-item:hover::before {
    opacity: 1;
}

.req-details {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 8px;
    padding-left: 16px;
    font-weight: 500;
}

/* ===== STATUS BADGES ===== */
.badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: var(--primary-100);
    color: var(--primary-700);
}

.badge-success {
    background: #dcfce7;
    color: var(--success);
}

.badge-warning {
    background: #fef3c7;
    color: var(--warning);
}

.badge-danger {
    background: #fee2e2;
    color: var(--error);
}

.badge-secondary {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* ===== ANSWER OPTIONS ===== */
.answer-option {
    padding: 12px 16px;
    margin: 6px 0;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    cursor: pointer;
    display: block;
    transition: var(--transition-fast);
    font-weight: 500;
}

.answer-option:hover {
    border-color: var(--primary-400);
    background: var(--primary-50);
    transform: translateY(-1px);
}

.answer-option.selected {
    background: var(--primary-500);
    border-color: var(--primary-500);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

/* ===== EPIC MANAGEMENT ===== */
.epic-list-item {
    padding: 16px 20px;
    margin-bottom: 12px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.epic-list-item:hover {
    border-color: var(--primary-300);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.epic-req-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    background: var(--gray-50);
    font-size: 14px;
    color: var(--gray-700);
}

.epic-req-item:last-child {
    border-bottom: none;
}

/* ===== ACCORDION ENHANCEMENTS ===== */
.accordion {
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.accordion-button {
    background: var(--gray-50);
    color: var(--gray-800);
    font-weight: 600;
    border: none;
    padding: 20px 24px;
    transition: var(--transition-fast);
}

.accordion-button:not(.collapsed) {
    background: var(--primary-50);
    color: var(--primary-700);
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.accordion-body {
    padding: 24px;
    background: var(--white);
}

/* ===== SEARCH & FILTERS ===== */
.search-container {
    margin-bottom: 20px;
}

.search-input {
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-lg);
    width: 100%;
    font-size: 14px;
    transition: var(--transition-fast);
    background: var(--white);
}

.search-input:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.search-input::placeholder {
    color: var(--gray-400);
}

/* ===== TREE VIEW ENHANCEMENTS ===== */
#tree-container {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.tree-actions {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    background: var(--gray-50);
}

.tree-instructions {
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid var(--primary-200);
    border-radius: var(--border-radius);
    background: var(--primary-50);
    font-size: 13px;
    color: var(--primary-800);
}

/* ===== LOADING STATES ===== */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--gray-300);
    border-radius: 50%;
    border-top-color: var(--primary-500);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Larger loading spinner */
.loading-lg {
    width: 24px;
    height: 24px;
    border-width: 3px;
}

/* ===== ALERTS & NOTIFICATIONS ===== */
.alert {
    border: none;
    border-radius: var(--border-radius);
    padding: 16px 20px;
    font-weight: 500;
    border-left: 4px solid;
}

.alert-success {
    background: #f0fdf4;
    color: var(--success);
    border-left-color: var(--success);
}

.alert-warning {
    background: #fffbeb;
    color: var(--warning);
    border-left-color: var(--warning);
}

.alert-danger {
    background: #fef2f2;
    color: var(--error);
    border-left-color: var(--error);
}

.alert-info {
    background: var(--primary-50);
    color: var(--primary-700);
    border-left-color: var(--primary-500);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .sidebar {
        min-width: 100%;
        max-width: 100%;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 9999;
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    #content {
        padding: 16px;
        margin-left: 0;
    }
    
    .card-body {
        padding: 16px;
    }
    
    .requirements-container {
        flex-direction: column;
    }
    
    #tree-container {
        width: 100%;
        margin-bottom: 20px;
    }
    
    .requirements-content {
        width: 100%;
    }
}

/* ===== UTILITY CLASSES ===== */
.text-muted {
    color: var(--gray-500) !important;
}

.text-primary {
    color: var(--primary-600) !important;
}

.bg-light {
    background-color: var(--gray-50) !important;
}

.border-light {
    border-color: var(--gray-200) !important;
}

.rounded-lg {
    border-radius: var(--border-radius-lg) !important;
}

.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow-md {
    box-shadow: var(--shadow-md) !important;
}

/* ===== MODERN SCROLLBARS ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
    transition: var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* ===== MAINTAB CONTENT ===== */
.maintabcontent {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.maintabcontent.active {
    display: block;
}

/* ===== PAGE HEADERS ===== */
h1, h2, h3, h4, h5, h6 {
    color: var(--gray-900);
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: 32px; margin-bottom: 16px; }
h2 { font-size: 24px; margin-bottom: 12px; }
h3 { font-size: 20px; margin-bottom: 10px; }
h4 { font-size: 18px; margin-bottom: 8px; }

.page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-200);
}

.page-title h2 {
    margin: 0;
    color: var(--gray-900);
    font-weight: 700;
}

/* ===== PROFESSIONAL ENHANCEMENTS ===== */
.requirements-container {
    display: flex;
    gap: 24px;
    margin-top: 20px;
}

#tree-container {
    width: 25%;
    min-width: 250px;
}

.requirements-content {
    flex: 1;
}

/* Add subtle animations to interactive elements */
.btn, .card, .form-control, .answer-option, .req-item, .question-item {
    will-change: transform;
}

/* Focus indicators for accessibility */
.btn:focus-visible,
.form-control:focus-visible,
.answer-option:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* Modern dropdown styling */
.dropdown-menu {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 8px 0;
    background: var(--white);
}

.dropdown-item {
    padding: 8px 16px;
    color: var(--gray-700);
    transition: var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--gray-50);
    color: var(--gray-900);
}

/* Professional spacing */
.mb-4 { margin-bottom: 24px !important; }
.mt-4 { margin-top: 24px !important; }
.p-3 { padding: 20px !important; }
.px-4 { padding-left: 24px !important; padding-right: 24px !important; }
.py-3 { padding-top: 16px !important; padding-bottom: 16px !important; }

/* ===== ENTERPRISE DETAILS STYLING ===== */
details.accordion-style {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    margin-bottom: 16px;
}

details.accordion-style summary {
    padding: 12px 16px;
    cursor: pointer;
    background: var(--gray-50);
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

details.accordion-style summary:hover {
    background: var(--primary-50);
    color: var(--primary-700);
}

details.accordion-style[open] summary {
    border-bottom: 1px solid var(--gray-200);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    background: var(--primary-50);
    color: var(--primary-700);
}

details.accordion-style div {
    padding: 16px;
    background: var(--white);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* Enhanced list styling */
.list-group-item {
    border: 1px solid var(--gray-200);
    padding: 12px 16px;
    background: var(--white);
    transition: var(--transition-fast);
}

.list-group-item:hover {
    background: var(--gray-50);
    border-color: var(--primary-300);
}

.list-group-item:first-child {
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.list-group-item:last-child {
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* Enhanced filter buttons */
.btn-outline-secondary.active {
    background: var(--primary-500);
    border-color: var(--primary-500);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

/* Professional alerts */
.alert {
    border-radius: var(--border-radius);
    border: none;
    font-weight: 500;
}

.alert-info {
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--primary-100) 100%);
    color: var(--primary-800);
    border-left: 4px solid var(--primary-500);
}

/* Modern select styling */
.form-select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 12px;
    padding-right: 40px;
}

.form-select:focus {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%233b82f6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3E%3C/svg%3E");
}