/* ===== Visitor Management Portal Styles ===== */

/* Body */
.visitor-body {
    background-color: #e8f0fe;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
}

/* Navbar */
.visitor-navbar {
    background: linear-gradient(135deg, #1565c0, #1976d2);
    padding: 0.6rem 1.2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    height: 56px;
}

.visitor-navbar-brand {
    color: #fff !important;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.3px;
}

.visitor-navbar-brand i {
    margin-right: 0.3rem;
}

.visitor-nav-btn {
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    padding: 0.35rem 0.9rem;
}

.sidebar-toggle {
    text-decoration: none;
    padding: 0.2rem 0.4rem;
}

/* ===== Layout Wrapper ===== */
.visitor-wrapper {
    display: flex;
    margin-top: 56px;
    min-height: calc(100vh - 56px);
}

/* ===== Sidebar ===== */
.visitor-sidebar {
    width: 250px;
    min-width: 250px;
    background: #fff;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.06);
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    z-index: 1030;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-profile {
    padding: 1.5rem 1rem 1rem;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.sidebar-avatar {
    font-size: 3rem;
    color: #1976d2;
    line-height: 1;
    margin-bottom: 0.4rem;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
}

.sidebar-user-role {
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    padding: 0.5rem 0;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu-item {
    margin: 2px 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    color: #555;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    background: #e3f2fd;
    color: #1565c0;
    border-left-color: #1976d2;
}

.sidebar-link.active {
    background: #e3f2fd;
    color: #1565c0;
    border-left-color: #1976d2;
    font-weight: 600;
}

.sidebar-link i {
    font-size: 1.1rem;
    width: 1.3rem;
    text-align: center;
}

.sidebar-link-danger:hover {
    background: #fce4ec;
    color: #c62828;
    border-left-color: #c62828;
}

.sidebar-divider {
    height: 1px;
    background: #eee;
    margin: 0.5rem 1rem;
}

/* ===== Main Content ===== */
.visitor-content {
    flex: 1;
    margin-left: 250px;
    padding: 1.5rem 2rem 2rem;
    min-width: 0;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1025;
}

/* Responsive sidebar */
@media (max-width: 991.98px) {
    .visitor-sidebar {
        transform: translateX(-100%);
    }

    .visitor-sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .visitor-content {
        margin-left: 0;
    }
}

/* ===== Dashboard Styles ===== */

/* Page header */
.dash-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.dash-page-title {
    font-weight: 700;
    color: #1565c0;
    margin-bottom: 0.15rem;
    font-size: 1.3rem;
}

.dash-page-title i {
    margin-right: 0.3rem;
}

.dash-page-subtitle {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 0;
}

/* Stat Cards */
.dash-stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border-left: 4px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dash-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.dash-stat-primary { border-left-color: #1976d2; }
.dash-stat-warning { border-left-color: #ff9800; }
.dash-stat-success { border-left-color: #4caf50; }
.dash-stat-info { border-left-color: #00bcd4; }

.dash-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.dash-stat-primary .dash-stat-icon { background: #e3f2fd; color: #1976d2; }
.dash-stat-warning .dash-stat-icon { background: #fff3e0; color: #ff9800; }
.dash-stat-success .dash-stat-icon { background: #e8f5e9; color: #4caf50; }
.dash-stat-info .dash-stat-icon    { background: #e0f7fa; color: #00bcd4; }

.dash-stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
}

.dash-stat-label {
    font-size: 0.8rem;
    color: #888;
    font-weight: 500;
}

/* Chart Cards */
.dash-chart-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.dash-chart-header {
    padding: 1rem 1.25rem 0;
}

.dash-chart-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 0;
}

.dash-chart-title i {
    color: #1976d2;
    margin-right: 0.3rem;
}

.dash-chart-body {
    padding: 1rem 1.25rem 1.25rem;
    flex: 1;
    min-height: 280px;
    position: relative;
}

.dash-chart-body-doughnut {
    min-height: 260px;
}

/* Table Card */
.dash-table-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.dash-table-header {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f0f0f0;
}

.dash-table {
    margin-bottom: 0;
    font-size: 0.875rem;
}

.dash-table thead th {
    background: #f8f9fa;
    color: #666;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: none;
    padding: 0.75rem 1rem;
}

.dash-table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f5f5f5;
}

.dash-table tbody tr:hover {
    background: #f8fbff;
}

.dash-visitor-name {
    font-weight: 600;
    color: #333;
    font-size: 0.85rem;
}

.dash-visitor-email {
    font-size: 0.75rem;
    color: #999;
}

/* ===== Responsive Dashboard ===== */
@media (max-width: 767.98px) {
    .visitor-content {
        padding: 1rem;
    }

    .dash-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .dash-stat-card {
        padding: 1rem;
    }

    .dash-stat-value {
        font-size: 1.3rem;
    }
}

/* Card */
.visitor-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.visitor-card-header {
    background: linear-gradient(135deg, #1565c0, #1976d2);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 600;
    padding: 1rem 1.5rem;
}

.visitor-card-header i {
    margin-right: 0.4rem;
}

.visitor-card-body {
    padding: 1.5rem 2rem 2rem;
}

/* Section titles */
.visitor-section {
    margin-bottom: 1.5rem;
}

.visitor-section-title {
    color: #1565c0;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-bottom: 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #e3f2fd;
}

.visitor-section-title i {
    margin-right: 0.3rem;
}

/* Form labels */
.visitor-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.3rem;
}

.visitor-label i {
    color: #1976d2;
    margin-right: 0.2rem;
}

/* Visitor Type toggle */
.visitor-type-toggle {
    display: flex;
    gap: 0.5rem;
}

.visitor-type-btn {
    border: 2px solid #ccc;
    border-radius: 8px;
    padding: 0.45rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #555;
    background: #fff;
    transition: all 0.2s ease;
    cursor: pointer;
}

.visitor-type-btn:hover {
    border-color: #1976d2;
    color: #1976d2;
}

.visitor-type-btn.active {
    background: #1976d2;
    border-color: #1976d2;
    color: #fff;
}

.visitor-type-btn.active:hover {
    background: #1565c0;
    border-color: #1565c0;
    color: #fff;
}

.visitor-type-btn i {
    margin-right: 0.3rem;
}

/* Upload area */
.visitor-upload-area {
    position: relative;
    border: 2px dashed #b0bec5;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    background: #fafbfc;
    transition: border-color 0.3s ease, background 0.3s ease;
    cursor: pointer;
}

.visitor-upload-area:hover,
.visitor-upload-area.drag-over {
    border-color: #1976d2;
    background: #e3f2fd;
}

.visitor-upload-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.visitor-upload-content {
    pointer-events: none;
}

.visitor-upload-icon {
    font-size: 2.2rem;
    color: #1976d2;
    margin-bottom: 0.5rem;
}

.visitor-upload-icon i {
    background: #e3f2fd;
    border-radius: 50%;
    padding: 0.5rem;
}

.visitor-upload-text {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 0.2rem;
}

.visitor-upload-hint {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 0;
}

.visitor-upload-filename {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #1976d2;
    font-weight: 500;
}

/* Submit button */
.visitor-submit-btn {
    background: linear-gradient(135deg, #1565c0, #1976d2);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    letter-spacing: 0.3px;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.visitor-submit-btn:hover {
    background: linear-gradient(135deg, #0d47a1, #1565c0);
    color: #fff;
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.35);
}

.visitor-submit-btn i {
    margin-right: 0.4rem;
}

/* Form controls refinement */
.visitor-card-body .form-control {
    border-radius: 6px;
    border: 1px solid #ddd;
    padding: 0.55rem 0.75rem;
    font-size: 0.9rem;
}

.visitor-card-body .form-control:focus {
    border-color: #1976d2;
    box-shadow: 0 0 0 0.15rem rgba(25, 118, 210, 0.15);
}

/* Responsive */
@media (max-width: 576px) {
    .visitor-card-body {
        padding: 1rem 1.2rem 1.5rem;
    }

    .visitor-type-toggle {
        flex-direction: column;
    }
}

/* ===== External Layout (public pages, no sidebar) ===== */
.external-content {
    margin-top: 56px;
    padding: 2rem 0 3rem;
    min-height: calc(100vh - 56px - 50px);
}

.external-footer {
    background: #fff;
    border-top: 1px solid #e0e0e0;
    padding: 0.75rem 0;
    font-size: 0.8rem;
    color: #888;
}

/* Visitor dashboard stat value override for text dates */
.dash-stat-card .dash-stat-value {
    word-break: break-word;
}

@media (max-width: 767.98px) {
    .external-content {
        padding: 1rem 0 2rem;
    }
}

/* Searchable Dropdown */
.search-dropdown {
    position: relative;
}

.search-dropdown-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    background: #fff;
}

.search-dropdown-selected span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.search-dropdown-arrow {
    font-size: 0.75rem;
    transition: transform 0.2s;
    margin-left: 0.5rem;
}

.search-dropdown.open .search-dropdown-arrow {
    transform: rotate(180deg);
}

.search-dropdown-menu {
    position: absolute;
    z-index: 1050;
    width: 100%;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    margin-top: 2px;
}

.search-dropdown-search {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #eee;
}

.search-dropdown-search i {
    color: #999;
    font-size: 0.85rem;
}

.search-dropdown-search input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 0.875rem;
}

.search-dropdown-search .spin {
    animation: spin 0.8s linear infinite;
}

/* Screen Loader Overlay */
.visitor-screen-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.visitor-screen-loader-content {
    text-align: center;
    color: #0d6efd;
    font-weight: 500;
}
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

.search-dropdown-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 200px;
    overflow-y: auto;
}

.search-dropdown-list li {
    padding: 0.45rem 0.75rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.15s;
}

.search-dropdown-list li:hover {
    background: #f0f4ff;
}

.search-dropdown-list li.active {
    background: #e8eeff;
    font-weight: 600;
}

.search-dropdown-list li.no-results {
    color: #999;
    text-align: center;
    cursor: default;
    font-style: italic;
}

.search-dropdown-hint {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    color: #888;
    border-top: 1px solid #eee;
    text-align: center;
}

/* ===== Auth ===== */
.visitor-auth-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-top: 2rem;
}

.visitor-auth-header {
    background: linear-gradient(135deg, #0d47a1, #1976d2);
    color: #fff;
    padding: 1.5rem 1.5rem 1.25rem;
}

.visitor-auth-title {
    margin: 0;
    font-weight: 700;
    font-size: 1.35rem;
}

.visitor-auth-title i {
    margin-right: 0.35rem;
}

.visitor-auth-subtitle {
    margin: 0.4rem 0 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.92rem;
}

.visitor-auth-body {
    padding: 1.5rem;
}

.visitor-auth-note {
    background: #f4f8ff;
    border: 1px solid #d7e7ff;
    border-radius: 10px;
    color: #295f9e;
    font-size: 0.88rem;
    padding: 0.85rem 1rem;
}

.visitor-auth-links {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.visitor-auth-links a {
    color: #1565c0;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.visitor-auth-links a:hover {
    text-decoration: underline;
}

@media (max-width: 576px) {
    .visitor-auth-card {
        margin-top: 1rem;
    }

    .visitor-auth-body {
        padding: 1.2rem;
    }

    .visitor-auth-links {
        flex-direction: column;
        gap: 0.5rem;
    }
}
