/* ============================================
   TujaraHub - Modern Website Design System
   ============================================ */

/* Global Resets & Base Styles */
* {
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Container Constraints */
.container,
.container-fluid {
    max-width: 100%;
    overflow-x: hidden;
}

/* ============================================
   MODERN NAVBAR STYLES
   ============================================ */

.modern-navbar {
    background: rgba(26, 26, 46, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(74, 144, 226, 0.2);
    position: sticky;
    top: 0;
    z-index: 1030;
    width: 100%;
    overflow: visible !important;
}

.modern-navbar .container-fluid {
    padding: 0 1rem;
    overflow: visible !important;
}

.navbar-collapse {
    overflow: visible !important;
}

/* Enhanced Brand */
.brand-enhanced {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.brand-enhanced:hover {
    background: rgba(74, 144, 226, 0.1);
    transform: scale(1.02);
}

.brand-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.brand-subtitle {
    font-size: 0.7rem;
    color: #4a90e2;
    font-weight: 500;
    line-height: 1;
}

/* Navbar Navigation */
.navbar-nav {
    gap: 0.25rem;
    align-items: stretch;
    overflow: visible !important;
}

.navbar-nav .dropdown {
    position: static;
}

.navbar-nav .dropdown-menu {
    position: absolute !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
}

/* Section Labels */
.nav-section-label {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    margin-top: 0.25rem;
}

.nav-section-label span {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #4a90e2;
    opacity: 0.6;
}

/* Enhanced Nav Links */
.nav-link-enhanced {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem !important;
    margin: 0.125rem 0.25rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 0.9rem;
}

.nav-link-enhanced::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 2px;
    background: #4a90e2;
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.nav-link-enhanced:hover {
    background: rgba(74, 144, 226, 0.15);
    color: #fff !important;
    transform: translateX(3px);
}

.nav-link-enhanced:hover::before {
    transform: scaleY(1);
}

.nav-link-enhanced.active {
    background: rgba(74, 144, 226, 0.2);
    color: #fff !important;
    font-weight: 600;
}

.nav-link-enhanced.active::before {
    transform: scaleY(1);
}

.nav-link-enhanced i {
    font-size: 1rem;
    width: 18px;
    text-align: center;
}

/* Feature Badges */
.feature-badge {
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 10px;
    background: #28a745;
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    margin-left: auto;
}

.ai-badge {
    background: linear-gradient(135deg, #9b59b6 0%, #e74c3c 100%);
}

/* Nav Divider */
.nav-divider {
    width: 1px;
    height: 30px;
    background: rgba(74, 144, 226, 0.2);
    margin: 0 0.5rem;
    align-self: center;
}

/* Dropdowns */
.dropdown-menu,
.dropdown-menu-enhanced {
    background: rgba(26, 26, 46, 0.98) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(74, 144, 226, 0.3) !important;
    border-radius: 10px !important;
    padding: 0.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7) !important;
    margin-top: 0.5rem !important;
    min-width: 200px;
    z-index: 1050 !important;
}

.dropdown-menu-wide {
    min-width: 280px;
}

.dropdown-menu .dropdown-header,
.dropdown-menu-enhanced .dropdown-header {
    color: #4a90e2 !important;
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.75rem 0.75rem 0.5rem;
}

.dropdown-menu .dropdown-item,
.dropdown-menu-enhanced .dropdown-item {
    padding: 0.65rem 0.75rem;
    border-radius: 6px;
    margin: 0.125rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85) !important;
    background: transparent;
}

.dropdown-menu .dropdown-item i,
.dropdown-menu-enhanced .dropdown-item i {
    font-size: 1rem;
    width: 20px;
}

.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus,
.dropdown-menu-enhanced .dropdown-item:hover,
.dropdown-menu-enhanced .dropdown-item:focus {
    background: rgba(74, 144, 226, 0.2) !important;
    color: #fff !important;
    transform: translateX(3px);
}

.dropdown-menu .dropdown-divider,
.dropdown-menu-enhanced .dropdown-divider {
    border-color: rgba(74, 144, 226, 0.2);
    margin: 0.5rem 0;
}

/* Navbar Tools */
.navbar-tools {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    margin-left: auto;
    padding-left: 1rem;
}

/* Connection Indicator */
.connection-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: rgba(40, 167, 69, 0.15);
    border-radius: 20px;
    border: 1px solid rgba(40, 167, 69, 0.3);
    flex-shrink: 0;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #28a745;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.6);
}

.status-text {
    font-size: 0.8rem;
    color: #28a745;
    font-weight: 600;
    white-space: nowrap;
}

/* User Menu */
.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: rgba(74, 144, 226, 0.1);
    border: 1px solid rgba(74, 144, 226, 0.3);
    border-radius: 20px;
    color: white;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.user-menu-btn:hover {
    background: rgba(74, 144, 226, 0.2);
    border-color: rgba(74, 144, 226, 0.5);
}

.user-avatar i {
    font-size: 1.5rem;
    color: #4a90e2;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    white-space: nowrap;
}

.user-name {
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1;
}

.user-role {
    font-size: 0.65rem;
    color: #4a90e2;
    line-height: 1;
}

.user-dropdown {
    min-width: 260px;
}

.user-profile-header {
    padding: 1rem;
    background: rgba(74, 144, 226, 0.15);
    border-radius: 8px;
    margin: 0.5rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.profile-avatar i {
    font-size: 2.5rem;
    color: #4a90e2;
}

.profile-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: white;
}

.profile-email {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ============================================
   MAIN CONTENT STYLES
   ============================================ */

main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

/* Cards */
.card {
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(74, 144, 226, 0.2);
}

.card-header {
    background: rgba(74, 144, 226, 0.1);
    border-bottom: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 12px 12px 0 0 !important;
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background: rgba(74, 144, 226, 0.05);
    border-top: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 0 0 12px 12px !important;
}

/* Tables */
.table {
    color: rgba(255, 255, 255, 0.9);
}

.table-responsive {
    border-radius: 8px;
    background: rgba(26, 26, 46, 0.5);
}

.table thead th {
    background: rgba(74, 144, 226, 0.15);
    border-bottom: 2px solid rgba(74, 144, 226, 0.3);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background: rgba(74, 144, 226, 0.1);
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #357abd 0%, #2868a6 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #000;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.3);
}

/* Forms */
.form-control,
.form-select {
    background: rgba(26, 26, 46, 0.5);
    border: 1px solid rgba(74, 144, 226, 0.3);
    color: #fff;
    border-radius: 8px;
    padding: 0.625rem 0.875rem;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    background: rgba(26, 26, 46, 0.7);
    border-color: #4a90e2;
    box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.25);
    color: #fff;
}

.form-label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.5rem;
}

/* Alerts */
.alert {
    border-radius: 10px;
    border: none;
    backdrop-filter: blur(10px);
    animation: slideInDown 0.3s ease;
}

@keyframes slideInDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.alert-success {
    background: rgba(40, 167, 69, 0.2);
    border-left: 4px solid #28a745;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.2);
    border-left: 4px solid #dc3545;
}

.alert-warning {
    background: rgba(255, 193, 7, 0.2);
    border-left: 4px solid #ffc107;
}

.alert-info {
    background: rgba(23, 162, 184, 0.2);
    border-left: 4px solid #17a2b8;
}

/* Badges */
.badge {
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    font-weight: 600;
}

/* Modal Enhancements */
.modal-content {
    background: rgba(26, 26, 46, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(74, 144, 226, 0.3);
    border-radius: 12px;
}

.modal-header {
    border-bottom: 1px solid rgba(74, 144, 226, 0.2);
    background: rgba(74, 144, 226, 0.1);
}

.modal-footer {
    border-top: 1px solid rgba(74, 144, 226, 0.2);
}

/* Footer */
footer {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(74, 144, 226, 0.2);
    margin-top: 3rem;
}

/* Offline Banner */
#offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ffc107;
    color: #000;
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    z-index: 1040;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Extra Large Screens (1400px+) */
@media (min-width: 1400px) {
    .container-fluid {
        max-width: 1600px;
        margin: 0 auto;
    }
    
    main .container-fluid {
        padding: 0 2rem;
    }
    
    .card {
        min-height: auto;
    }
    
    .row > [class*="col-"] {
        margin-bottom: 1.5rem;
    }
}

/* Large Screens (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .container-fluid {
        max-width: 1320px;
        margin: 0 auto;
    }
    
    main .container-fluid {
        padding: 0 1.5rem;
    }
}

/* Desktop Screens (992px+) */
@media (min-width: 992px) {
    .navbar-nav {
        flex-wrap: nowrap;
    }
    
    .nav-link-enhanced {
        padding: 0.5rem 0.65rem !important;
        font-size: 0.875rem;
    }
    
    .nav-link-enhanced span {
        display: inline;
    }
    
    .nav-section-label {
        display: none;
    }
    
    .nav-divider {
        display: block;
    }
    
    .table-responsive {
        overflow-x: auto;
    }
    
    .table {
        width: 100%;
        table-layout: auto;
    }
    
    .table th,
    .table td {
        white-space: nowrap;
        padding: 0.75rem 1rem;
    }
    
    .dashboard-cards .card {
        height: 100%;
    }
    
    .card:hover {
        transform: translateY(-3px);
    }
}

/* Medium Screens (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .container-fluid {
        padding: 0 1rem;
    }
    
    .nav-link-enhanced {
        padding: 0.5rem 0.5rem !important;
        font-size: 0.85rem;
    }
    
    .nav-link-enhanced i {
        font-size: 0.9rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* Tablet and Mobile (max 991px) */
@media (max-width: 991px) {
    .navbar-tools {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(74, 144, 226, 0.2);
        width: 100%;
    }
    
    .nav-divider {
        display: none;
    }
    
    .connection-indicator,
    .user-menu-btn {
        width: 100%;
        justify-content: center;
    }
    
    .nav-section-label {
        margin-top: 0.75rem;
        display: flex;
    }
    
    main {
        padding: 1rem 0;
    }
    
    .card:hover {
        transform: none;
    }
}

/* Small Mobile (max 576px) */
@media (max-width: 576px) {
    .brand-name {
        font-size: 1.1rem;
    }
    
    .brand-logo {
        width: 35px;
        height: 35px;
        font-size: 1.1rem;
    }
    
    .nav-link-enhanced {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem !important;
    }
    
    .table th,
    .table td {
        padding: 0.4rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.875rem;
    }
    
    h1, .h1 {
        font-size: 1.5rem;
    }
    
    h2, .h2 {
        font-size: 1.25rem;
    }
    
    h3, .h3 {
        font-size: 1.1rem;
    }
}

/* Print Styles */
@media print {
    .modern-navbar,
    .navbar-tools,
    footer,
    .btn,
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .card {
        border: 1px solid #ddd !important;
        background: white !important;
        box-shadow: none !important;
    }
}

/* Utility Classes */
.text-purple {
    color: #9b59b6 !important;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(26, 26, 46, 0.5);
}

::-webkit-scrollbar-thumb {
    background: rgba(74, 144, 226, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 144, 226, 0.7);
}

/* Printer Status Button */
#printer-status-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    transition: all 0.3s ease;
}

#printer-status-btn.btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    border: none;
    color: white;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.4);
}

#printer-status-btn.btn-outline-secondary {
    border: 1px dashed rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.6);
}

#printer-status-btn:hover {
    transform: scale(1.05);
}
