/* Custom CSS for DTR Management System with Sidebar */

/* Sidebar Styles */
#sidebar {
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom Scrollbar for Sidebar */
#sidebar::-webkit-scrollbar {
    width: 6px;
}

#sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

#sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

#sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Navigation Links in Sidebar */
.nav-tab {
    display: block;
    width: 100%;
    padding: 6px 16px;
    text-align: left;
    transition: all 0.3s ease;
    background-color: transparent;
    border: none;
    color: #e2e8f0;
    text-decoration: none;
    border-left: 4px solid transparent;
    font-size: 0.85rem;
}

.nav-tab:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-left-color: rgba(255, 255, 255, 0.3);
}

.nav-tab.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-weight: 600;
    border-left-color: #ffffff;
}

.nav-tab i {
    width: 16px;
    margin-right: 8px;
    text-align: center;
    font-size: 0.8rem;
}

/* Navigation Groups */
.nav-group {
    margin: 4px 0;
}

.nav-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    color: #cbd5e0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-group-header:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.nav-group-header i:first-child {
    width: 20px;
    margin-right: 12px;
}

.group-arrow {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    margin-left: auto;
}

.nav-group-content {
    max-height: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    opacity: 0 !important;
    transition: max-height 0.3s ease, opacity 0.3s ease, visibility 0.3s !important;
}

.nav-group-content.expanded {
    max-height: 2000px !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.nav-tab-sub {
    padding-left: 56px;
    font-size: 0.95rem;
}

/* Desktop - Sidebar always visible */
@media (min-width: 1024px) {
    #sidebar {
        transform: translateX(0) !important;
    }
}

/* Mobile Sidebar */
@media (max-width: 1023px) {
    #sidebar {
        transform: translateX(-100%);
    }
    
    #sidebar.open {
        transform: translateX(0);
    }
    
    .flex-1.ml-64 {
        margin-left: 0 !important;
    }
}

/* Desktop Sidebar Collapsed State */
#sidebar.collapsed {
    width: 80px;
}

#sidebar.collapsed h1,
#sidebar.collapsed p,
#sidebar.collapsed #userRoleBadge,
#sidebar.collapsed .nav-tab span {
    opacity: 0;
    pointer-events: none;
}

#sidebar.collapsed .nav-tab {
    padding: 12px 20px;
    justify-content: center;
}

#sidebar.collapsed .nav-tab i {
    margin-right: 0;
}

.main-content.sidebar-collapsed {
    margin-left: 80px;
}

/* Sidebar Toggle Animation */
.sidebar-toggle {
    transition: all 0.3s ease;
}

/* Loading animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* File upload area */
#uploadArea {
    transition: all 0.3s ease;
}

#uploadArea:hover {
    border-color: #3b82f6;
    background-color: #f8fafc;
}

/* Progress bar animation */
#progressBar {
    transition: width 0.5s ease-in-out;
}

/* DTR Table styling */
.dtr-table {
    font-size: 12px;
    line-height: 1.3;
}

.dtr-table th,
.dtr-table td {
    padding: 6px 8px;
    border: 1px solid #d1d5db;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .nav-tab {
        font-size: 14px;
    }
    
    main {
        padding: 16px;
    }
    
    #pageTitle {
        font-size: 18px;
    }
}

@media (max-width: 640px) {
    #sidebar {
        width: 280px;
    }
    
    header {
        padding: 0 16px;
    }
    
    #userDisplayName {
        display: none;
    }
}

/* Smooth transitions */
* {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

/* Custom scrollbar */
.overflow-x-auto::-webkit-scrollbar {
    height: 6px;
}

.overflow-x-auto::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.overflow-x-auto::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.overflow-x-auto::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Header Styles */
header {
    transition: all 0.3s ease;
}

/* Main Content Transitions */
main {
    transition: all 0.3s ease;
}

/* Print styles for DTR */
@media print {
    body * {
        visibility: hidden;
    }
    
    #dtrPreview, #dtrPreview * {
        visibility: visible;
    }
    
    #dtrPreview {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    
    #sidebar, header {
        display: none !important;
    }
    
    .flex-1.ml-64 {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

/* Sidebar Header Styling */
#sidebar h1 {
    font-size: 14px;
    line-height: 1.2;
}

#sidebar p {
    font-size: 10px;
    line-height: 1.2;
}

/* Role Badge Styling */
#userRoleBadge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Mobile Hamburger Button */
#mobileMenuBtn {
    transition: all 0.2s ease;
}

#mobileMenuBtn:hover {
    background-color: #f3f4f6;
    transform: scale(1.05);
}