/* Custom styles for the auth client application */

html, body {
    height: 100%;
    font-size: 15px;
}

/* Sidebar styles */
.sidebar {
    min-height: 100vh;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
}

.sidebar .nav-link {
    color: #333;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
}

.sidebar .nav-link:hover {
    background-color: #e9ecef;
    color: #0d6efd;
}

.sidebar .nav-link.active {
    background-color: #0d6efd;
    color: white;
}

.sidebar .nav-link.active-parent {
    background-color: #e7f1ff;
    color: #0d6efd;
}

.sidebar .nav-link i {
    width: 16px;
    text-align: center;
}

/* Accordion Sidebar Styles */
.accordion-toggle {
    cursor: pointer;
}

.accordion-arrow {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.accordion-toggle.expanded .accordion-arrow {
    transform: rotate(180deg);
}

/* Submenu Styles */
.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    opacity: 0;
    position: relative;
}

.submenu.show {
    max-height: 500px;
    opacity: 1;
}

.submenu-item {
    position: relative;
}

.submenu-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    color: #666;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    font-size: 0.9rem;
    border-radius: 0.375rem;
    margin: 0.125rem 0.5rem;
}

.submenu-link:hover {
    background-color: #f0f0f0;
    color: #0d6efd;
}

.submenu-link.active {
    background-color: #e7f1ff;
    color: #0d6efd;
    font-weight: 500;
}

.submenu-link.disabled {
    color: #adb5bd;
    pointer-events: none;
}

.submenu-indicator {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #dee2e6;
    transition: background-color 0.2s ease;
}

.submenu-link:hover .submenu-indicator,
.submenu-link.active .submenu-indicator {
    background-color: #0d6efd;
}

/* Vertical connector line for submenus */
.submenu::before {
    content: '';
    position: absolute;
    left: 1.75rem;
    top: 0;
    bottom: 0.5rem;
    width: 1px;
    background-color: #dee2e6;
}

.sidebar-brand {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 1rem !important;
}

/* User info in sidebar */
.user-info {
    padding: 1rem;
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

/* Main content area */
.content-area {
    min-height: calc(100vh - 200px);
}

/* Login page styles */
.login-container {
    width: 1200px;
    max-width: 95vw;
}

.login-container .card {
    border: none;
    border-radius: 1rem;
    width: 100%;
}

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

/* Ensure login container is responsive */
.container-fluid .row {
    margin: 0;
}

/* Login page specific responsiveness */
@media (max-width: 1250px) {
    .login-container {
        width: 95vw;
        max-width: 1200px;
    }
}

@media (max-width: 768px) {
    .login-container {
        width: 90vw;
        max-width: 600px;
    }
    
    .card-body {
        padding: 3rem 2rem !important;
    }
}

@media (max-width: 576px) {
    .login-container {
        width: 95vw;
        max-width: 400px;
    }
    
    .card-body {
        padding: 2rem 1.5rem !important;
    }
}

@media (max-width: 400px) {
    .login-container {
        width: 98vw;
    }
    
    .card-body {
        padding: 1.5rem 1rem !important;
    }
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .sidebar {
        display: none !important;
    }
    
    .content-area {
        min-height: auto;
    }
    
    /* Make main content full width on mobile */
    main.col-md-9 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* Custom alert styles */
.alert {
    border-radius: 0.5rem;
}

/* Button enhancements */
.btn {
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
    text-decoration: none !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 1.125rem;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-btn {
    width: 300px;
    max-width: 80%;
}

/* Card enhancements */
.card {
    transition: box-shadow 0.2s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* Badge styles */
.badge {
    font-size: 0.875em;
    padding: 0.5em 0.75em;
}

/* Form enhancements */
.form-control:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Top navigation bar */
.border-bottom {
    border-color: #dee2e6 !important;
}

/* Burger menu styling */
.dropdown-toggle::after {
    display: none;
}

.dropdown-menu {
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
    min-width: 200px;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    transition: all 0.2s ease-in-out;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #0d6efd;
}

.dropdown-item i {
    width: 16px;
    text-align: center;
}

/* Button group alignment */
.btn-toolbar .btn-group {
    margin-right: 0.5rem;
}

.btn-group .btn {
    border-radius: 0.375rem !important;
    margin-right: 0.25rem;
}

.btn-group .dropdown {
    margin-left: 0.25rem;
}

/* Hide burger menu on desktop, show only on mobile */
.burger-menu {
    display: none;
}

@media (max-width: 767.98px) {
    .burger-menu {
        display: block;
    }
}

/* Loading spinner for future use */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Utility classes */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Animation for page transitions */
.content-area {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Status indicators */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-indicator.online {
    background-color: #28a745;
}

.status-indicator.offline {
    background-color: #dc3545;
}

.status-indicator.pending {
    background-color: #ffc107;
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ============================================
   RESPONSIVE IMPROVEMENTS
   ============================================ */

/* Desktop recommended banner for complex pages */
.desktop-recommended-banner {
    display: none;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    border: 1px solid #ffc107;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    align-items: center;
    gap: 0.75rem;
}

.desktop-recommended-banner i {
    font-size: 1.25rem;
    color: #856404;
}

.desktop-recommended-banner .banner-text {
    flex: 1;
    color: #856404;
    font-size: 0.9rem;
}

.desktop-recommended-banner .banner-text strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

@media (max-width: 991.98px) {
    .desktop-recommended-banner {
        display: flex;
    }
}

/* Hide columns on mobile for tables */
@media (max-width: 767.98px) {
    .hide-mobile {
        display: none !important;
    }
    
    /* Stack filter rows on mobile */
    .filter-row-mobile .col-md-2,
    .filter-row-mobile .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
        margin-bottom: 0.5rem;
    }
    
    .filter-row-mobile .col-md-1 {
        flex: 0 0 100%;
        max-width: 100%;
        text-align: center !important;
        margin-top: 0.5rem;
    }
    
    /* Job form improvements */
    .job-form-row .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .job-form-row .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .job-form-row .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    /* Billing page action buttons - stack on mobile */
    .billing-actions {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch !important;
    }
    
    .billing-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Accordion header improvements for mobile */
    .accordion-button {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .accordion-button .badge {
        font-size: 0.75rem;
    }
    
    /* Table cell padding reduction on mobile */
    .table-responsive .table td,
    .table-responsive .table th {
        padding: 0.5rem 0.35rem;
        font-size: 0.85rem;
    }
    
    /* Card header flex wrap */
    .card-header.d-flex {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .card-header .btn-group {
        width: 100%;
    }
    
    .card-header .btn-group .btn {
        flex: 1;
    }
}

/* Tablet breakpoint improvements */
@media (max-width: 991.98px) and (min-width: 768px) {
    .filter-row-tablet .col-md-2 {
        flex: 0 0 33.333%;
        max-width: 33.333%;
        margin-bottom: 0.5rem;
    }
    
    .filter-row-tablet .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
        margin-bottom: 0.5rem;
    }
}

/* Submenu in burger menu */
.burger-submenu {
    padding-left: 1rem;
    border-left: 2px solid #dee2e6;
    margin-left: 0.5rem;
}

.burger-submenu .dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    color: #666;
}

.burger-submenu .dropdown-item:hover {
    color: #0d6efd;
}

.dropdown-header-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dropdown-header-toggle i.fa-chevron-down {
    transition: transform 0.2s ease;
    font-size: 0.75rem;
}

.dropdown-header-toggle.expanded i.fa-chevron-down {
    transform: rotate(180deg);
}
