﻿html {
    font-size: 12px;
}

@media (min-width: 768px) {
    html {
        font-size: 14px;
    }
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
    background-color: #f8f9fa;
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Buttons & focus */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* Layout Wrapper */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* -----------------
   Sidebar
------------------ */
.sidebar {
    width: 240px;
    background-color: #343a40;
    color: #fff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 1200;
    transform: translateX(0); /* visible by default */
    transition: transform 0.3s ease;
}

    .sidebar .brand {
        font-size: 1.3rem;
        font-weight: bold;
        padding: 15px;
        text-align: center;
        border-bottom: 1px solid #495057;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
    }

.brand-logo {
    max-width: 70px;
    height: auto;
    border-radius: 35px;
}

.brand-text {
    font-size: 1rem;
    line-height: 1.3;
    margin-top: 5px;
}

.sidebar .nav-link {
    color: #adb5bd;
    padding: 12px 20px;
    font-weight: 500;
    transition: background 0.3s, color 0.3s;
}

    .sidebar .nav-link:hover,
    .sidebar .nav-link.active {
        background-color: #495057;
        color: #fff !important;
    }

.sidebar .nav-group {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #868e96;
    padding: 10px 20px 5px;
}

/* -----------------
   Overlay
------------------ */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .overlay.active {
        display: block;
        opacity: 1;
    }
/* -----------------
   Content Area
------------------ */
.content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    margin-left: 240px; /* desktop offset */
}

.topbar {
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-logo {
    display: block;
    max-height: 20px;
    margin-right: 10px;
    width: auto;
}

main {
    flex-grow: 1;
    padding: 20px;
}

/* Footer */
footer {
    background-color: #000;
    color: #aaa;
    padding: 10px 0;
    text-align: center;
}

    footer a {
        color: #fff;
        text-decoration: none;
    }

        footer a:hover {
            text-decoration: underline;
        }

/* -----------------
   Mobile Sidebar
------------------ */
/* Mobile Fix */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%); /* hidden off-screen */
        width: 240px; /* or 220px, your choice */
    }

        .sidebar.show {
            transform: translateX(0);
        }

    .content {
        margin-left: 0 !important; /* override desktop offset */
        width: 100%;
        overflow-x: hidden;
    }

    body {
        overflow-x: hidden; /* no horizontal scroll */
    }

    .mobile-logo {
    }

    .brand-text {
        display: none;
    }

    .topbar-user-info {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .topbar-user-details {
        margin-top: 5px;
    }
}

/* -----------------
   Desktop Sidebar
------------------ */
@media (min-width: 992px) {
    .sidebar {
        transform: translateX(0) !important;
        width: 240px;
    }

    .overlay {
        display: none !important;
    }

    .content {
        margin-left: 240px;
    }
}
/* -----------------
   Delivery Challans (Mobile)
------------------ */
@media (max-width: 767.98px) {
    .table-responsive {
        border-radius: 0.5rem;
        overflow: hidden;
    }

    .table thead {
        display: none;
    }

    .table tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 0.5rem;
        background: white;
    }

    .table td {
        display: block;
        text-align: right;
        padding: 0.75rem;
        position: relative;
        border-bottom: 1px solid #dee2e6;
    }

        .table td:last-child {
            border-bottom: none;
        }

        .table td::before {
            content: attr(data-label);
            position: absolute;
            left: 0.75rem;
            top: 50%;
            transform: translateY(-50%);
            font-weight: 600;
            color: #495057;
            text-transform: uppercase;
            font-size: 0.8rem;
        }

    /*.action-buttons-mobile .d-flex {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }*/

    .action-buttons-mobile .btn {
        width: 100%;
        justify-content: center;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* -----------------
   General Mobile Forms
------------------ */
@media (max-width: 767.98px) {
    .form-label {
        font-weight: 600;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .d-flex.justify-content-end {
        flex-direction: column;
    }
}

/* -----------------
   Animations
------------------ */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .permission-card {
        background: #2a2a2a;
        border-color: #444 !important;
    }

    .permission-active {
        background: rgba(67, 97, 238, 0.15);
    }
}

/* Ensure data labels are properly set for mobile */
@media (max-width: 767.98px) {
    /* Add any very specific mobile adjustments that aren't covered by site.js */
    .detail-item {
        padding: 1rem 0;
    }

    .action-buttons-mobile .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* card*/
@media (max-width: 767.98px) {
    .card {
        border-radius: 0;
        margin-left: -12px;
        margin-right: -12px;
        width: calc(100% + 24px);
    }
}

@media (max-width: 767.98px) {
    .card-text {
        font-size: 0.9rem;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Mobile responsive styles */
@media (max-width: 767.98px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .avatar-profile {
        width: 80px !important;
        height: 80px !important;
        font-size: 2rem !important;
    }

    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 1rem;
    }


}


/* Mobile responsive styles */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }

    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
}

#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Spinner animation */
.spinner {
    border: 6px solid #f3f3f3;
    border-top: 6px solid #3498db;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}
