/*
 * Highbrook Homes Portal - Staff Portal Specific Styles
 * Only used by: Staff Portal
 * RESTORED TO ORIGINAL STYLING (pre-refactor)
 */

/* ========================================
   STAFF PORTAL SPECIFIC STYLES
   ======================================== */

/* Override body for Staff Portal pages - light grey background */
body.staff-portal,
body.with-gradient {
    background: #f5f7fa;  /* Light grey like Build Team Portal */
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

/* Header Wrapper - Full-width purple gradient background */
.header-wrapper {
    background: linear-gradient(135deg, #B89FD9 0%, #490E6F 100%);
    width: 100%;
    box-shadow: 0 4px 20px rgba(73, 14, 111, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 100;
}

.header {
    background: transparent;  /* Let wrapper gradient show through */
    color: white;
    padding: 15px 0;  /* Restored original padding - breadcrumb moved to body */
    border-radius: 0;  /* Square edges like Build Team */
    box-shadow: none;  /* Wrapper has the shadow */
    margin-bottom: 0;
}

.header h1 {
    color: white;
    margin-bottom: 5px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.user-info {
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    font-weight: 500;
}

/* Hamburger button - white icon on purple header */
.hamburger-button span {
    background: white;
    border-radius: 4px;
    height: 2px; /* Sleeker lines */
    transition: all 0.3s;
}

.hamburger-button:hover span {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* Breadcrumb Wrapper - Sits tight against purple header in body content */
.breadcrumb-wrapper {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    margin: 0;
    padding: 0;  /* No padding - ultra compact */
}

/* Override container padding for breadcrumb only */
.breadcrumb-wrapper .container {
    padding-top: 0;
    padding-bottom: 0;
}

/* Breadcrumb Navigation - Black text, body content area */
.breadcrumb {
    margin: 0;
    padding: 0;  /* No padding at all */
    line-height: 1;  /* Tight line height */
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.8125rem;  /* Restored original font size */
    color: #333;
    line-height: 1;  /* Tight line height */
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
    content: '›';
    margin: 0 0.5rem;
    color: #999;
    font-size: 1rem;
}

.breadcrumb-link {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-link:hover {
    color: #007bff;
    text-decoration: underline;
}

.breadcrumb-current {
    color: #333;
    font-weight: 500;
}

/* Mobile responsive - breadcrumbs now visible on mobile (Nov 9, 2025) */

/* Quick Update Button - styled for white header */
#quick-update-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

#quick-update-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.welcome-card {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.welcome-card h2 {
    color: var(--primary-purple);
    margin-bottom: 20px;
    font-size: 32px;
}

.welcome-card p {
    color: #666;
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 30px;
}

.user-details {
    background: var(--bg-light);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-top: 30px;
    text-align: left;
}

.user-details h3 {
    color: #333;
    margin-bottom: 15px;
}

.user-details p {
    color: #666;
    margin: 8px 0;
    font-size: 16px;
}

.user-details strong {
    color: #333;
}

.logout-form {
    margin-top: 30px;
}

/* Button styles are in components.css */

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
}

.status-badge.active {
    background: var(--success-bg);
    color: var(--success-text);
}

.status-badge.inactive {
    background: var(--error-bg);
    color: var(--error-text);
}

.error-card {
    background: var(--error-bg);
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    margin-top: 20px;
    color: var(--error-text);
    border-left: 4px solid #c53030;
}

/* Container - Full-width layout standard for ALL Staff Portal pages
 * Responsive padding system:
 * - Mobile (<480px): 15px edge padding
 * - Tablet (480-768px): 20px edge padding
 * - Desktop (768-1600px): 30px edge padding
 * - Large monitors (>1600px): 40px edge padding
 *
 * IMPORTANT: This overrides base.css .container (which has max-width: 1200px)
 */
.container {
    padding-left: 15px;   /* Mobile base - left padding */
    padding-right: 15px;  /* Mobile base - right padding */
    margin-left: 0;       /* No left margin */
    margin-right: 0;      /* No right margin */
    width: 100%;          /* Full viewport width */
    max-width: none !important; /* CRITICAL: Override base.css max-width: 1200px */
    box-sizing: border-box; /* CRITICAL: padding included in width calculation */
}

/* Responsive padding - scales with viewport size */
@media (min-width: 480px) {
    .container {
        padding-left: 20px;   /* Tablet */
        padding-right: 20px;
    }
}

@media (min-width: 768px) {
    .container {
        padding-left: 30px;   /* Desktop */
        padding-right: 30px;
    }
}

@media (min-width: 1600px) {
    .container {
        padding-left: 40px;   /* Large monitors - maximum data visibility */
        padding-right: 40px;
    }
}

/* Section - Standard content section style (used across all pages) */
.section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    margin-bottom: 2rem;
}

.section h2 {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    color: #1f2937;
}

.departments-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: 30px;  /* Space from header */
}

.departments-card h2 {
    color: var(--primary-purple);
    margin-bottom: 20px;
    font-size: 24px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

/* Apply gradient to entire header row for continuous flow */
thead {
    background: linear-gradient(to bottom right, #B89FD9 0%, #490E6F 100%);
}

th {
    background: transparent;  /* Let thead gradient show through */
    color: white;
    font-weight: 600;
}

tbody tr:hover {
    background: #f5f5f5;
}

/* Login Page Styles */
.login-container {
    background: white;
    border-radius: 12px;
    padding: 40px;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
}

/* Heading styles (.logo, h1, .subtitle, .divider) are in base.css */

.security-notice {
    background: var(--bg-light);
    border-left: 4px solid var(--primary-purple);
    padding: 15px;
    margin-bottom: 30px;
    text-align: left;
    border-radius: var(--radius-sm);
}

.security-notice h3 {
    color: var(--primary-purple);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
}

.security-notice p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.btn-microsoft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom right, var(--gradient-start) 0%, var(--gradient-end) 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
    width: 100%;
}

.btn-microsoft:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-microsoft svg {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

.back-link {
    margin-top: 30px;
    display: inline-block;
    color: var(--primary-purple);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

.info-notice {
    background: var(--info-bg);
    border-left: 4px solid var(--primary-purple);
    padding: 15px;
    border-radius: var(--radius-sm);
    text-align: left;
    margin-top: 15px;
}

.info-notice-title {
    color: var(--primary-purple);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-notice-content {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
}

@media (max-width: 768px) {
    /* Issue reported: Nov 9, 2024 - affected admin pages on mobile */

    .header {
        padding: 20px;
    }

    .welcome-card {
        padding: 30px 20px;
    }

    .welcome-card h2 {
        font-size: 26px;
    }

    .login-container {
        padding: 30px 20px;
    }

    h1 {
        font-size: 24px;
    }

    table {
        font-size: 14px;
    }

    th, td {
        padding: 8px 6px;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 30px 20px;
    }

    h1 {
        font-size: 24px;
    }
}

/* ========================================
   PAGE UPDATE NOTIFICATION BANNER
   ======================================== */

/* Page update notification - appears at top when updates available */
.page-update-notification {
    position: fixed;
    top: -100px;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom right, #B89FD9 0%, #490E6F 100%);
    color: white;
    padding: 12px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transition: top 0.3s ease-out;
    display: flex;
    justify-content: center;
    align-items: center;
}

.page-update-notification.show {
    top: 0;
}

.update-content {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 1200px;
    width: 100%;
}

.update-icon {
    font-size: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.update-message {
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}

.refresh-btn {
    background: white;
    color: var(--primary-purple);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.refresh-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.dismiss-btn {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.dismiss-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .page-update-notification {
        padding: 10px 15px;
    }

    .update-content {
        flex-wrap: wrap;
        gap: 8px;
    }

    .update-message {
        width: 100%;
        font-size: 13px;
    }

    .refresh-btn {
        font-size: 12px;
        padding: 6px 12px;
    }

    .dismiss-btn {
        font-size: 14px;
        padding: 5px 8px;
    }
}

/* ========================================
   REFRESH ALL BUTTON (CONDITIONAL VISIBILITY)
   ======================================== */

/* Refresh All buttons - hidden by default, shown when updates detected */
#header-refresh-all-btn,
#sidebar-refresh-all-btn {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease-out;
    pointer-events: none;
}

/* Show buttons when updates available */
#header-refresh-all-btn.show,
#sidebar-refresh-all-btn.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ========================================
   DASHBOARD UPDATE NOTIFICATION CENTER
   ======================================== */

/* Dashboard update panel - fixed right side */
.dashboard-update-panel {
    position: fixed;
    right: -350px;
    top: 100px;
    width: 320px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 10px 0 0 10px;
    box-shadow: -2px 2px 12px rgba(0, 0, 0, 0.15);
    z-index: 9998;
    transition: right 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

.dashboard-update-panel.show {
    right: 0;
}

.update-panel-header {
    background: linear-gradient(to bottom right, #B89FD9 0%, #490E6F 100%);
    color: white;
    padding: 15px;
    border-radius: 10px 0 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.update-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.update-icon {
    font-size: 18px;
}

.update-title-text {
    font-size: 16px;
    font-weight: 600;
}

.update-count-badge {
    background: white;
    color: var(--primary-purple);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.close-panel-btn {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.close-panel-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.update-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.no-updates-message {
    text-align: center;
    color: #999;
    font-size: 14px;
    padding: 20px;
}

.updates-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.update-list-item {
    margin-bottom: 10px;
}

.update-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg-light);
    border-radius: 8px;
    border-left: 4px solid var(--primary-purple);
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
}

.update-link:hover {
    background: #e8e4f3;
    transform: translateX(-3px);
}

.update-link-icon {
    font-size: 16px;
}

.update-link-text {
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}

.update-panel-footer {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
}

.refresh-all-btn {
    width: 100%;
    background: linear-gradient(to bottom right, #B89FD9 0%, #490E6F 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.refresh-all-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.refresh-all-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .dashboard-update-panel {
        right: -100%;
        width: 100%;
        max-width: 100%;
        top: 0;
        max-height: 100vh;
        border-radius: 0;
    }

    .dashboard-update-panel.show {
        right: 0;
    }

    .update-panel-header {
        border-radius: 0;
    }
}

/* ========================================
   APP UPDATE BANNER (v78)
   ======================================== */

/**
 * Orange notification banner - slides from top of screen when service worker detects updates.
 * Clean, professional design with user control - no countdown timers, no auto-refresh.
 *
 * DESIGN:
 * - Orange background (#FF8C42) - complements purple Staff Portal gradient
 * - Fixed positioning (top: 0) - stays visible above header while scrolling
 * - White buttons - high contrast, clear actions
 * - Slide-down animation - smooth 300ms transform
 *
 * RESPONSIVE:
 * - Desktop (>768px): Horizontal layout with buttons inline
 * - Tablet (480-768px): Horizontal with smaller buttons
 * - Mobile (<480px): Stacked layout with buttons below message
 */

/* ARCHIVED 2025-10-20: app-update-banner CSS removed - buggy system archived */
