/* ===========================
   Velonic-Inspired Dashboard Styles
   =========================== */

/* Reset and Base */
html {
    overflow-x: hidden;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

body {
    background-color: #fafbfe;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    overflow-x: hidden;
    position: relative;
    width: 100%;
    min-height: 100vh;
}

/* Wrapper */
.wrapper {
    height: 100vh;
    overflow: hidden;
    display: flex;
    position: relative;
}

/* ===== Leftside Menu (Sidebar) ===== */
.leftside-menu {
    width: 260px;
    background: #313a46;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 10;
    transition: all .2s ease-in-out;
}

.logo-box {
    background-color: #313a46;
    height: 70px;
    line-height: 70px;
    padding: 0 20px;
}

.logo-box .logo {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo-box .logo i {
    color: #727cf5;
    font-size: 24px;
}

.logo-sm {
    display: none;
}

.logo-lg {
    display: flex;
}

/* Sidebar Navigation */
.side-nav {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.side-nav-title {
    padding: 12px 20px;
    color: #8391a2;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 700;
    margin-top: 10px;
}

.side-nav-item {
    position: relative;
}

.side-nav-link {
    color: #8391a2;
    display: flex;
    align-items: center;
    padding: 10px 20px;
    font-size: 14px;
    transition: all .3s;
    text-decoration: none;
}

.side-nav-link:hover {
    color: #ffffff;
    background-color: rgba(255,255,255,.05);
}

.side-nav-link.active {
    color: #727cf5;
    background-color: rgba(114,124,245,.15);
    border-left: 3px solid #727cf5;
}

.side-nav-link i {
    font-size: 18px;
    min-width: 24px;
    margin-right: 10px;
}

/* Collapsed Sidebar Styles (Desktop only) */
@media (min-width: 769px) {
    .leftside-menu.collapsed {
        width: 70px;
    }

    .leftside-menu.collapsed .logo-box {
        text-align: center;
    }

    .leftside-menu.collapsed .logo-lg {
        display: none !important;
    }

    .leftside-menu.collapsed .logo-sm {
        display: block !important;
    }

    .leftside-menu.collapsed .side-nav-title {
        display: none;
    }

    .leftside-menu.collapsed .side-nav-link {
        justify-content: center;
        padding: 10px 0;
        position: relative;
    }

    .leftside-menu.collapsed .side-nav-link i {
        margin-right: 0;
    }

    .leftside-menu.collapsed .side-nav-link span {
        position: absolute;
        left: 70px;
        background: #313a46;
        padding: 10px 15px;
        border-radius: 0 5px 5px 0;
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        transition: all .3s;
        z-index: 1000;
        box-shadow: 2px 2px 8px rgba(0,0,0,.2);
    }

    .leftside-menu.collapsed .side-nav-link:hover span {
        opacity: 1;
        visibility: visible;
    }
}

/* ===== Content Page ===== */
.content-page {
    margin-left: 260px;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100vh;
    flex: 1;
    min-width: 0;
    transition: margin-left .3s;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.content-page.sidebar-collapsed {
    margin-left: 70px;
}

/* ===== Content Wrapper (contains content only) ===== */
.content-wrapper {
    min-height: calc(100vh - 70px - 80px); /* viewport - navbar - footer */
    padding-top: 70px; /* Height of navbar */
    padding-bottom: 80px; /* Height of footer + spacing */
    width: 100%;
}

/* ===== Navbar Custom (Topbar) ===== */
.navbar-custom {
    background-color: #ffffff;
    box-shadow: 0 0 35px 0 rgba(154,161,171,.15);
    height: 70px;
    padding: 0 20px;
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    z-index: 9;
    display: flex;
    align-items: center;
    transition: left .3s;
}

.sidebar-collapsed .navbar-custom {
    left: 70px;
}

/* Responsive: Full width navbar on mobile */
@media (max-width: 768px) {
    .navbar-custom {
        left: 0 !important;
        z-index: 900 !important;
        position: fixed !important;
        width: 100%;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

.topbar-menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.topbar-menu-right {
    margin-left: auto;
}

.topbar-menu .nav-link {
    color: #6c757d;
    padding: 0.5rem;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.topbar-menu .nav-link:hover {
    color: #727cf5;
}

.button-toggle-menu {
    border: none;
    background: none;
    font-size: 24px;
    color: #6c757d;
    padding: 8px;
    cursor: pointer;
    display: none; /* Hidden on desktop */
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
}

/* Show hamburger menu on tablet and mobile */
@media (max-width: 768px) {
    .button-toggle-menu {
        display: inline-flex;
    }
}

.button-toggle-menu:hover {
    color: #727cf5;
}

.button-toggle-menu i {
    font-size: 24px;
    line-height: 1;
}

.account-user-avatar {
    display: inline-block;
}

.account-user-name {
    font-weight: 600;
    color: #313a46;
}

.dropdown-menu-animated {
    animation: dropdown-animate .3s;
}

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

.noti-icon-badge {
    background-color: #f1556c;
    border-radius: 10px;
    color: #ffffff;
    display: inline-block;
    font-size: 11px;
    height: 18px;
    line-height: 18px;
    min-width: 18px;
    position: absolute;
    right: -5px;
    text-align: center;
    top: -5px;
}

/* ===== Content Area ===== */
.content {
    padding: 0;
    flex: 1;
    width: 100%;
}

.content .container-fluid {
    width: 100% !important;
    max-width: none !important;
    padding-left: 20px;
    padding-right: 20px;
    padding-top: 20px;
    padding-bottom: 80px; /* Footer height + extra spacing */
}

/* ===== Footer ===== */
.footer {
    background-color: #ffffff;
    border-top: 1px solid #f1f3fa;
    color: #98a6ad;
    padding: 19px 20px;
    position: fixed;
    bottom: 0;
    left: 260px;
    right: 0;
    z-index: 8;
    transition: left .3s;
}

.footer.sidebar-collapsed {
    left: 70px;
}

.footer-links a {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .footer {
        left: 0 !important;
    }
}

/* ===== Cards ===== */
.card {
    border: 1px solid #f1f3fa;
    box-shadow: 0 0 35px 0 rgba(154,161,171,.15);
    margin-bottom: 24px;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid #f1f3fa;
    padding: 15px 20px;
}

.card-body {
    padding: 20px;
}

/* Page Title */
.page-title-box {
    padding: 20px 0;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #313a46;
}

/* Buttons */
.btn-primary {
    background-color: #727cf5;
    border-color: #727cf5;
}

.btn-primary:hover {
    background-color: #5c68d4;
    border-color: #5c68d4;
}

.btn-success {
    background-color: #0acf97;
    border-color: #0acf97;
}

.btn-success:hover {
    background-color: #09b580;
    border-color: #09b580;
}

/* Mobile sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.show {
    display: block;
}

/* ===== Responsive Styles ===== */

/* Tablet and below (768px) */
@media (max-width: 768px) {
    /* Fix wrapper on mobile */
    .wrapper {
        height: 100vh;
        overflow: hidden;
        position: fixed;
        width: 100%;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }

    /* Hide sidebar by default on mobile */
    .leftside-menu {
        transform: translateX(-100%) !important;
        z-index: 1000 !important;
        transition: transform 0.3s ease-in-out !important;
        width: 260px !important;
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        overflow-y: auto !important;
        display: block !important;
        visibility: visible !important;
    }

    /* Show sidebar when toggled */
    .leftside-menu.collapsed {
        transform: translateX(0) !important;
    }

    /* Content takes full width on mobile */
    .content-page {
        margin-left: 0 !important;
        width: 100%;
        height: 100vh;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .content-page.sidebar-collapsed {
        margin-left: 0 !important;
    }

    /* Reduce padding on mobile */
    .content {
        padding: 80px 12px 80px; /* Add bottom padding for footer */
    }

    .content .container-fluid {
        padding-bottom: 20px; /* Reduced spacing on mobile */
    }

    /* Smaller page title */
    .page-title {
        font-size: 16px;
    }

    .page-title-box {
        padding: 12px 0;
    }

    /* Card spacing */
    .card {
        margin-bottom: 16px;
    }

    .card-body {
        padding: 15px;
    }

    /* Footer */
    .footer {
        padding: 15px 0;
        font-size: 13px;
    }

    /* Navbar adjustments */
    .navbar-custom {
        padding: 0 12px;
        height: 60px;
    }

    .button-toggle-menu {
        font-size: 20px;
    }

    /* Contact cards - full width on mobile */
    .contact-card {
        margin-bottom: 16px;
    }

    /* Contact avatar - smaller on mobile */
    .contact-avatar {
        width: 60px;
        height: 60px;
        font-size: 22px;
    }

    /* Dropdowns */
    .dropdown-menu {
        font-size: 14px;
    }

    /* Admin panel - stack columns */
    .col-xl-3,
    .col-lg-4,
    .col-lg-8 {
        margin-bottom: 16px;
    }

    /* Tables - responsive scroll */
    .table-responsive {
        font-size: 13px;
    }

    /* Hide username text on small screens */
    .account-user-name {
        display: none !important;
    }

    /* Smaller buttons on mobile */
    .btn {
        font-size: 13px;
        padding: 6px 12px;
    }

    .btn-sm {
        font-size: 12px;
        padding: 4px 8px;
    }
}

/* Small mobile devices (480px and below) */
@media (max-width: 480px) {
    /* Even more compact spacing */
    .content {
        padding: 70px 8px 8px;
    }

    .navbar-custom {
        padding: 0 8px;
        height: 55px;
    }

    .card-body {
        padding: 12px;
    }

    /* Stack action buttons vertically on very small screens */
    .d-flex.gap-2.justify-content-center {
        flex-direction: column;
        gap: 8px !important;
    }

    .d-flex.gap-2.justify-content-center .btn {
        width: 100%;
    }

    /* Contact cards */
    .contact-avatar {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }

    /* Smaller badges */
    .badge {
        font-size: 11px;
        padding: 3px 8px;
    }

    /* Page title */
    .page-title {
        font-size: 15px;
    }

    /* Hide bell icon text, show icon only */
    .topbar-menu-right {
        gap: 4px;
    }

    .nav-link {
        padding: 0.3rem !important;
    }
}

/* Large tablets (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .content {
        padding: 90px 16px 16px;
    }

    /* Contact cards - 2 per row on tablet */
    .col-xxl-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Print styles */
@media print {
    .leftside-menu,
    .navbar-custom,
    .footer,
    .button-toggle-menu,
    .btn,
    #blazor-error-ui {
        display: none !important;
    }

    .content-page {
        margin-left: 0 !important;
    }

    .content {
        padding: 0 !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

#blazor-error-ui {
    background-color: #f8d7da;
    color: #721c24;
    padding: 1rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    text-align: center;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.5rem;
    font-size: 1.5rem;
}

/* Form validation */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

/* Contact List Styles */
.contact-card {
    transition: all .3s;
}

.contact-card:hover {
    box-shadow: 0 0 45px 0 rgba(154,161,171,.3);
    transform: translateY(-5px);
}

.contact-card a {
    text-decoration: none;
}

.contact-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 28px;
    font-weight: 600;
}

/* Soft Button Styles */
.btn-soft-info {
    background-color: rgba(57, 175, 209, 0.18);
    border-color: transparent;
    color: #39afd1;
}

.btn-soft-info:hover {
    background-color: #39afd1;
    border-color: #39afd1;
    color: #ffffff;
}

.btn-soft-success {
    background-color: rgba(10, 207, 151, 0.18);
    border-color: transparent;
    color: #0acf97;
}

.btn-soft-success:hover {
    background-color: #0acf97;
    border-color: #0acf97;
    color: #ffffff;
}

/* Badge Styles */
.badge {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
}

.badge-soft-primary {
    background-color: rgba(114, 124, 245, 0.18);
    color: #727cf5;
}

.badge-soft-success {
    background-color: rgba(10, 207, 151, 0.18);
    color: #0acf97;
}

.badge-soft-info {
    background-color: rgba(57, 175, 209, 0.18);
    color: #39afd1;
}

.badge-soft-warning {
    background-color: rgba(255, 188, 53, 0.18);
    color: #ffbc35;
}

.badge-soft-danger {
    background-color: rgba(241, 85, 108, 0.18);
    color: #f1556c;
}

.badge-soft-secondary {
    background-color: rgba(131, 145, 162, 0.18);
    color: #8391a2;
}

.badge-soft-purple {
    background-color: rgba(106, 90, 205, 0.18);
    color: #6a5acd;
}

/* ===== Search Bar Styles ===== */
.app-search .form-control {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding-left: 40px;
    font-size: 14px;
    height: 38px;
    background-color: #fff;
    transition: all 0.2s;
}

.app-search .form-control:focus {
    border-color: #727cf5;
    box-shadow: 0 0 0 0.2rem rgba(114, 124, 245, 0.15);
}

.app-search .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #98a6ad;
    pointer-events: none;
    font-size: 16px;
}

/* Mobile Search Bar Styles */
.app-search-mobile .form-control {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding-left: 30px;
    font-size: 0.875rem;
    height: 32px;
    background-color: #fff;
    transition: all 0.2s;
}

.app-search-mobile .form-control:focus {
    border-color: #727cf5;
    box-shadow: 0 0 0 0.15rem rgba(114, 124, 245, 0.15);
}

.app-search-mobile .search-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #98a6ad;
    pointer-events: none;
    font-size: 0.875rem;
}