/* ==========================================================================
   Large Desktop Styles (1200px and up)
   ========================================================================== */
@media (min-width: 1200px) {
    body {
        font-size: 16px;
        padding-top: 80px;
        /* Space for fixed navbar */
    }

    .navbar,
    .navbar.navbar-expand-lg {
        display: block !important;
        position: fixed !important;
        top: 0 !important;
        width: 100% !important;
        z-index: 1030 !important;

    }


    /* Large desktop layout */
    .container-fluid {
        max-width: 1400px;
        margin: 0 auto;
    }

    .stats-row {
        flex-wrap: nowrap;
        overflow-x: visible;
        gap: 1.5rem;
    }

    .stats-row>div {
        min-width: 250px;
        flex: 1 1 auto;
    }

    /* Enhanced spacing for large screens */
    .card,
    .main-card,
    .sidebar-card {
        margin-bottom: 2rem;
    }

    /* Modal adjustments for large desktop */
    .modal-dialog {
        margin: 1.75rem auto;
        max-width: 900px;
    }

    .modal-xl {
        max-width: 1200px;
    }
}

/* Confirmation Modal Styles */
.confirmation-modal .modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
}

.confirmation-modal .modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px 16px 0 0;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.confirmation-modal .modal-title {
    font-weight: 600;
    font-size: 1.25rem;
    margin: 0;
}

.confirmation-modal .modal-body {
    padding: 2rem;
    text-align: center;
}

.confirmation-modal .modal-body .modal-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.confirmation-modal .modal-body .modal-message {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.confirmation-modal .modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1.5rem 2rem;
    border-radius: 0 0 16px 16px;
    justify-content: center;
    gap: 1rem;
}

.confirmation-modal .btn-cancel {
    background: rgba(108, 117, 125, 0.1);
    border: 1px solid rgba(108, 117, 125, 0.3);
    color: #6c757d;
    padding: 0.75rem 2rem;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.confirmation-modal .btn-cancel:hover {
    background: rgba(108, 117, 125, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.confirmation-modal .btn-confirm {
    background: linear-gradient(135deg, #dc3545, #c82333);
    border: none;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.confirmation-modal .btn-confirm:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.confirmation-modal .btn-confirm.restore {
    background: linear-gradient(135deg, #28a745, #218838);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.confirmation-modal .btn-confirm.restore:hover {
    background: linear-gradient(135deg, #218838, #1e7e34);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

/* Restore Button Styles */
.btn-restore {
    background: linear-gradient(135deg, #28a745, #218838);
    border: none;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-restore:hover {
    background: linear-gradient(135deg, #218838, #1e7e34);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
    color: white;
}

.btn-restore:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.btn-restore i {
    transition: transform 0.3s ease;
}

.btn-restore:hover i {
    transform: scale(1.1);
}

/* Status Message Styles */
.status-message {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1060;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    max-width: 400px;
    font-weight: 500;
    animation: slideInRight 0.5s ease-out;
}

.status-message.success {
    background: rgba(40, 167, 69, 0.9);
    color: white;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.status-message.error {
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Mobile Responsiveness Styles */
/* Target screens 768px and below */

@media (max-width: 768px) {

    /* General adjustments */
    body {
        font-size: 14px;
        padding-top: 0 !important;
        /* Remove top padding for mobile to hide top navbar */
        padding-bottom: 90px;
        min-height: 100vh;
        /* Space for bottom nav */
        margin-bottom: 10px;
    }

    /* Hide the top navbar on mobile */
    .navbar {
        display: none !important;
    }

    /* Style the bottom navigation bar */
    .bottom-nav {
        position: fixed;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 20px);
        max-width: 400px;
        height: 65px;
        background: rgba(255, 255, 255, 0.85);
        -webkit-backdrop-filter: blur(15px);
        backdrop-filter: blur(15px);
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        border-radius: 32.5px;
        display: flex;
        justify-content: space-around;
        align-items: center;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        z-index: 1050;
        padding: 0 10px;
        margin-bottom: 10px;
        position: fixed;
        /* Re-affirm for indicator */
    }

    .bottom-nav::before {
        content: '';
        position: absolute;
        width: 50px;
        /* Width of the indicator */
        height: 50px;
        /* Height of the indicator */
        background-color: var(--primary-color);
        border-radius: 50%;
        left: 0;
        /* Define a starting edge for the transform */
        top: 8px;
        /* Start inside the nav bar */
        transform: translateX(var(--indicator-offset, 0px)) translateY(-33px);
        /* Move with JS */
        transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
        /* Bouncy transition */
        box-shadow: 0 0 15px rgba(13, 110, 253, 0.5);
        z-index: -1;
        /* Behind the icons */
    }

    .bottom-nav a {
        flex: 1;
        text-align: center;
        color: var(--text-secondary);
        text-decoration: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 100%;
        position: relative;
        z-index: 1;
        transition: color 0.3s ease;
    }

    .bottom-nav a>span {
        display: none;
    }

    .bottom-nav a .icon {
        font-size: 1.5rem;
        transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    }

    .bottom-nav a.active {
        color: white !important;
    }

    .bottom-nav a.active .icon {
        transform: translateY(-32.5px);
    }

    .bg-gradient-primary {
        height: 40vh;
        min-height: 40vh;
        padding: 1rem 1rem;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    .bg-gradient-primary h1 {
        font-size: 1.5rem;
    }

    .bg-gradient-primary p {
        font-size: 1rem;
    }

    .col-md-6.d-flex.align-items-center.justify-content-center {
        height: 60vh;
        min-height: 60vh;
        overflow-y: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        padding: 0 1rem;
    }

    .card.shadow-lg.border-0 {
        width: 100% !important;
        max-width: 400px;
        margin: 0 auto;
    }

    /* Input group adjustments */
    .input-group-text {
        padding: 0.75rem;
    }

    /* Alert adjustments */
    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    /* Badge adjustments */
    .badge {
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    /* Pagination adjustments */
    .pagination .page-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
        font-weight: 500;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Custom scrollbar adjustments */
    ::-webkit-scrollbar {
        width: 6px;
    }

    /* Animation adjustments */
    .fade-in,
    .slide-in {
        animation-duration: 0.4s;
    }

    /* Specific dashboard adjustments */
    .row.mb-4 .col-lg-2 {
        margin-bottom: 1rem;
    }

    .main-container {
        padding: 1rem 0.6rem 2rem 0.6rem;
    }

    /* Hide table and show card view container on mobile (dashboard only) */
    .dashboard-page .table-responsive {
        display: none !important;
    }

    .dashboard-page #particularsCardView {
        display: block !important;
    }

    .dashboard-page #usersCardView {
        display: block !important;
    }

    /* Card view styles */
    #particularsCardView .particular-card,
    #usersCardView .particular-card {
        background: rgba(255, 255, 255, 0.95);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(0, 0, 0, 0.1);
        border-radius: 12px;
        padding: 1rem;
        margin-bottom: 1rem;
        box-shadow: var(--shadow-md);
    }

    #particularsCardView .particular-card h6,
    #usersCardView .particular-card h6 {
        margin: 0 0 0.5rem 0;
        font-weight: 600;
        font-size: 1rem;
        color: var(--text-primary);
    }

    #particularsCardView .particular-field,
    #usersCardView .particular-field {
        margin-bottom: 0.25rem;
        font-size: 0.875rem;
        color: var(--text-secondary);
    }

    #particularsCardView .particular-field strong,
    #usersCardView .particular-field strong {
        color: var(--text-primary);
    }

    /* Adjust buttons in card view */
    #particularsCardView .btn-group,
    #usersCardView .btn-group {
        margin-top: 0.5rem;
    }

    /* Adjust pagination for card view */
    nav[aria-label="Page navigation"] {
        margin-top: 1rem;
    }

    /* Admin user table specific: allow visibility and wrapping */
    #userTable th,
    #userTable td {
        white-space: normal;
    }

    #userTable th:nth-child(9),
    #userTable td:nth-child(9) {
        width: 35%;
    }

    .navbar-brand {
        font-size: 1.1rem;
    }

    .stats-number {
        font-size: 1.5rem;
    }

    .table th:nth-child(9),
    #userTable td:nth-child(9) {
        width: 50%;
    }

    /* Adjust login card */
    .card.shadow-lg {
        margin: 10px;
        width: auto;
    }

    .card-body.p-5 {
        padding: 1.5rem !important;
    }

    /* Adjust background text */
    .bg-gradient-primary h1 {
        font-size: 1.5rem;
    }

    .bg-gradient-primary p {
        font-size: 0.9rem;
    }

    .sidebar-card {
        margin-bottom: 10px;

    }

    /* Sidebar adjustments for mobile */
    .sidebar-card {
        border-radius: 16px;
        margin-bottom: 1rem;
    }

    .main-card {
        border-radius: 16px;
    }

    /* Show Quick Actions above content on mobile */
    .col-lg-3.col-md-4 {
        display: block !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 1rem;
        order: 0;
    }

    .col-lg-9.col-md-8 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        order: 1;
    }

    /* Stats row: remove horizontal scroll and wrap cards */
    .stats-row {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .stats-row>div {
        min-width: calc(50% - 0.25rem);
        flex: 1 1 calc(50% - 0.25rem);
    }

    /* Mobile Bulk Actions Bar - Floating Popup */
    #mobileBulkActions {
        position: fixed;
        bottom: 70px;
        /* Above the bottom nav */
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        -webkit-backdrop-filter: blur(15px);
        backdrop-filter: blur(15px);
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        z-index: 1049;
        /* Below bottom nav but above content */
        transform: translateY(100%);
        opacity: 0;
        transition: all 0.3s ease;
        display: none;
    }

    #mobileBulkActions.show {
        transform: translateY(0);
        opacity: 1;
        display: flex !important;
        visibility: visible !important;
    }

    .bulk-actions-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        min-height: 50px;
    }

    .selected-info {
        font-weight: 600;
        color: var(--text-primary);
        font-size: 0.9rem;
    }

    .action-buttons {
        display: flex;
        gap: 8px;
    }

    .action-buttons .btn {
        padding: 8px 12px;
        font-size: 0.8rem;
        border-radius: 8px;
        min-width: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .action-buttons .btn i {
        font-size: 0.9rem;
    }

    /* Curved select hover for mobile */
    .form-select {
        border-radius: 12px;
    }

    .form-select:hover {
        background-color: rgba(13, 110, 253, 0.1);
        border-color: #0d6efd;
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
        transition: all 0.3s ease;
    }

    select option:hover {
        background-color: rgba(13, 110, 253, 0.15);
        border-radius: 6px;
        padding-left: 8px;
    }

    /* Mobile Confirmation Modal Adjustments */
    .confirmation-modal .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }

    .confirmation-modal .modal-header {
        padding: 1.25rem 1.5rem;
    }

    .confirmation-modal .modal-body {
        padding: 1.5rem;
    }

    .confirmation-modal .modal-body .modal-icon {
        font-size: 2.5rem;
    }

    .confirmation-modal .modal-body .modal-message {
        font-size: 1rem;
    }

    .confirmation-modal .modal-footer {
        padding: 1.25rem 1.5rem;
        flex-direction: column;
        gap: 0.75rem;
    }

    .confirmation-modal .modal-footer .btn {
        width: 100%;
        padding: 0.875rem;
    }

    /* Mobile Status Message Adjustments */
    .status-message {
        left: 10px;
        right: 10px;
        max-width: none;
        font-size: 0.9rem;
    }

    /* Mobile Restore Button Adjustments */
    .btn-restore {
        min-height: 44px;
        /* Touch-friendly height */
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
        border-radius: 12px;
        width: 100%;
        /* Full width on mobile for better accessibility */
        margin-bottom: 0.5rem;
    }

    .btn-restore i {
        font-size: 1rem;
        margin-right: 0.5rem;
    }

    /* Mobile Card Restore Button */
    #deletedParticularsCardView .btn-restore {
        min-height: 40px;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        border-radius: 8px;
        width: auto;
        /* Not full width in cards */
        margin: 0;
    }

    #deletedParticularsCardView .btn-restore i {
        font-size: 0.9rem;
        margin-right: 0.25rem;
    }
}

/* New styles for redesigned register page */
@media (max-width: 768px) {
    body.register-body {
        background-attachment: scroll;
        /* Better performance on mobile */
    }

    .glass-card {
        margin: 0.5rem;
        padding: 1.5rem !important;
        border-radius: 16px;
    }

    .register-header i {
        font-size: 2.5rem !important;
    }

    .form-control {
        min-height: 50px;
        /* Touch-friendly */
        font-size: 16px;
    }

    .btn-register {
        min-height: 50px;
        border-radius: 10px;
    }

    #togglePassword {
        right: 0.8rem;
    }
}

@media (min-width: 769px) {
    .glass-card {
        -webkit-backdrop-filter: blur(20px) !important;
        backdrop-filter: blur(20px) !important;
    }
}