/* Hirly/styling/pages/page-job-dashboard.css */
/* Redesigned Freelancer Dashboard Styles */

/* Pulse animation for highlighting elements */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(var(--primary-rgb), 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0);
    }
}

.pulse-animation {
    animation: pulse 1.5s infinite;
}

/* --- GENERAL DASHBOARD STYLES --- */
.dashboard-wrapper {
    display: flex;
    min-height: calc(100vh - var(--header-height)); /* Account for header height */
    background-color: var(--background-light); /* Light background for main content area */
}

/* --- SIDEBAR STYLES --- */
.dashboard-sidebar {
    width: 250px; /* Slightly narrower sidebar for more content space */
    background-color: var(--text-dark); /* Dark background for sidebar */
    color: var(--white);
    padding: var(--spacing-lg) var(--spacing-md); /* Adjusted padding */
    box-shadow: var(--shadow-sm); /* Subtle shadow */
    flex-shrink: 0;
    position: sticky; /* Make sidebar sticky */
    top: 0; /* Stick to the top */
    /* *** IMPORTANT FIX: Adjust height to account for header *** */
    height: calc(100vh - var(--header-height, 90px)); /* Full viewport height minus header height */
    overflow-y: auto; /* Enable scrolling for long content */
    z-index: 1000; /* Ensure it's above other content */
    transition: transform 0.3s ease-in-out;
}

.sidebar-header {
    text-align: center;
    padding-bottom: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Subtle separator */
}

/* NEW: Avatar wrapper to position the badge correctly */
.user-avatar-wrapper {
    position: relative;
    display: inline-block; /* Allows badge to be positioned relative to it */
}

.user-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--primary); /* Fallback background */
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: var(--font-size-xxl);
    font-weight: bold;
    margin: 0 auto; /* Center the avatar */
    object-fit: cover;
    border: 2px solid var(--primary-light);
    box-shadow: var(--shadow-xs);
}

/* NEW: Premium Avatar Style - Subtle Border */
.user-avatar-large.premium-border {
    /* Subtle border instead of flashy animation */
    border: 2px solid #DAA520; /* Goldenrod color for a touch of class */
    box-shadow: 0 0 8px rgba(218, 165, 32, 0.5); /* Subtle glow without flashing */
}

.user-name-sidebar {
    display: block;
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--white);
    margin-bottom: var(--spacing-xs);
    margin-top: var(--spacing-sm); /* Adjusted spacing below avatar */
}

.user-type-sidebar {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--text-light);
}

/* NEW: Premium Tier Badge - Cleaner look */
.user-tier-badge {
    display: inline-block;
    padding: 2px 8px; /* Smaller padding */
    border-radius: 12px; /* Less rounded corners */
    font-size: var(--font-size-xs);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px; /* Smaller gap */
    white-space: nowrap;
    box-shadow: var(--shadow-xxs);
    margin-top: 5px; /* Separate from user name for cleaner look */
    background-color: #DAA520; /* Goldenrod */
    color: white;
}

.user-tier-badge i {
    font-size: var(--font-size-sm);
}

.user-tier-badge.tier-premium {
    background-color: #DAA520;
}

.user-tier-badge.tier-pro {
    background-color: #A9A9A9; /* DarkGray */
    color: white;
}

.user-tier-badge.tier-unlimited {
    background-color: #4CAF50; /* A green color for a fresh look */
    color: white;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: var(--spacing-sm);
}

.sidebar-nav a, .sidebar-nav button {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--white);
    text-decoration: none;
    font-size: var(--font-size-base);
    border-radius: var(--border-radius-sm);
    transition: background-color 0.2s ease, color 0.2s ease;
    width: 100%; /* Ensure buttons/links take full width */
    text-align: left; /* Align text to left for buttons */
    background: none; /* Remove default button background */
    border: none; /* Remove default button border */
    cursor: pointer;
}

.sidebar-nav a i, .sidebar-nav button i {
    font-size: var(--font-size-lg);
    width: 20px; /* Fixed width for icons */
    text-align: center;
}

.sidebar-nav a:hover, .sidebar-nav button:hover {
    background-color: var(--primary-dark); /* Darker shade for hover */
    color: var(--white);
}

.sidebar-nav a.active, .sidebar-nav button.active {
    background-color: var(--primary); /* Active link background */
    color: var(--white);
    font-weight: 600;
}

/* Language Switcher in Sidebar */
.sidebar-lang-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-sm);
    color: var(--white);
    cursor: pointer;
    font-size: var(--font-size-sm);
    width: calc(100% - 32px); /* Account for padding */
    margin: var(--spacing-md) auto;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.sidebar-lang-switcher:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.sidebar-lang-switcher .lang-flag {
    width: 24px;
    height: 16px;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* --- MAIN CONTENT STYLES --- */
.dashboard-content {
    flex-grow: 1;
    padding: var(--spacing-xl);
    background-color: var(--background-light);
    overflow-y: auto; /* Enable scrolling for main content */
}

/* REMOVED: .mobile-menu-toggle */
/* REMOVED: .mobile-menu-close */

.main-dashboard-title {
    font-size: var(--font-size-xxl);
    color: var(--text-dark);
    margin-bottom: var(--spacing-xl);
    font-weight: 700;
}

.dashboard-section {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.dashboard-section h2 {
    font-size: var(--font-size-xl);
    color: var(--primary-dark);
    margin-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--spacing-sm);
}

/* Dashboard Stats Grid */
.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
}

.stat-card {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    text-align: center;
    box-shadow: var(--shadow-xs);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* NEW: Active/Clickable Stat Card for Profile Views */
#profileViewsCard {
    cursor: pointer;
    transition: all 0.2s ease;
}
#profileViewsCard:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.stat-card .icon {
    font-size: var(--font-size-xxl);
    color: var(--primary);
    margin-bottom: var(--spacing-sm);
}

.stat-card .number {
    font-size: var(--font-size-xxl);
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: var(--spacing-xs);
}

.stat-card .label {
    font-size: var(--font-size-base);
    color: var(--text-body);
    font-weight: 500;
}

/* NEW: Cleaner "See Who Viewed" button styling */
.btn-clean {
    background: none;
    border: 1px solid var(--primary-light);
    color: var(--primary);
    font-size: var(--font-size-sm);
    padding: 6px 12px;
    border-radius: var(--border-radius-lg);
    transition: all 0.2s ease;
}

.btn-clean:hover {
    background-color: var(--primary-lighter);
    color: var(--primary-dark);
    border-color: var(--primary-lighter);
}

.btn-clean.premium-feature-btn {
    border-color: var(--warning);
    color: var(--warning);
}

.btn-clean.premium-feature-btn:hover {
    background-color: var(--warning-light);
    color: var(--warning-dark);
    border-color: var(--warning-light);
}

/* Profile Form */
.profile-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}

.profile-form .form-group {
    display: flex;
    flex-direction: column;
}

.profile-form .form-group.full-width {
    grid-column: 1 / -1; /* Spans full width */
}

.profile-form label {
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text-dark);
    font-size: var(--font-size-sm);
}

.profile-form .form-control {
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-base);
    color: var(--text-body);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: var(--input-bg);
}

.profile-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
    outline: none;
}

.profile-form .form-control[readonly] {
    background-color: var(--background-light);
    cursor: default;
    border-color: var(--border-color-light);
}

.profile-form .form-control[disabled] {
    background-color: var(--background-light);
    cursor: not-allowed;
    opacity: 0.7;
}

.select-wrapper {
    position: relative;
}

/* FIX: Remove the double arrow by removing the pseudo element from the select wrapper */
.select-wrapper::after {
    display: none;
}

.profile-form textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    justify-content: flex-end;
}

/* File Upload Styles */
.file-upload-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.file-input {
    display: none; /* Hide default file input */
}

.file-upload-label {
    background-color: var(--primary);
    color: white;
    padding: 8px 15px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-base);
    transition: background-color 0.2s ease;
}

.file-upload-label:hover {
    background-color: var(--primary-dark);
}

.file-upload-label.disabled {
    background-color: var(--btn-disabled-bg);
    cursor: not-allowed;
    opacity: 0.7;
}


.file-name-display {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 8px 0;
    color: var(--text-body);
    font-size: var(--font-size-sm);
}

.file-upload-container .btn {
    padding: 8px 15px;
    font-size: var(--font-size-sm);
    white-space: nowrap;
}

.form-message {
    font-size: var(--font-size-sm);
    margin-top: var(--spacing-xs);
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Enhanced Success Message for CV Uploaded */
.form-message.success {
    background: linear-gradient(90deg, var(--success-light), var(--success-light-alt));
    color: var(--success);
    border: 1px solid var(--success);
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(var(--success-rgb), 0.2);
    animation: fadeInScale 0.3s ease-out;
}
.form-message.success i {
    color: var(--success-dark);
}

/* Keyframe for subtle entrance animation */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}


.form-message.error {
    background-color: var(--danger-light);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.form-message.warning {
    background-color: var(--warning-light);
    color: var(--warning);
    border: 1px solid var(--warning);
}

.form-message.info-message { /* Renamed from .info for clarity */
    background-color: var(--info-light);
    color: var(--info);
    border: 1px solid var(--info);
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: var(--font-size-xs);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.status-not-submitted {
    background-color: var(--gray-light);
    color: var(--text-body);
}

.badge.status-pending-verification {
    background-color: var(--warning-light);
    color: var(--warning);
}

/* Enhanced Verified Badge for ID */
.badge.status-verified {
    background: linear-gradient(45deg, #28a745, #218838); /* Green gradient */
    color: white;
    border: 1px solid #28a745;
    font-weight: 700;
    box-shadow: 0 2px 5px rgba(40, 167, 69, 0.3); /* Green shadow */
    position: relative;
    padding-left: 25px; /* Space for icon */
    animation: popIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* Bouncy animation */
}

/* Icon for Verified Badge */
.badge.status-verified::before {
    content: '\f00c'; /* Font Awesome checkmark icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.8);
}

/* Keyframe for bouncy entrance animation */
@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    70% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}


.badge.status-rejected {
    background-color: var(--danger-light);
    color: var(--danger);
}

/* --- Applications Section --- */
.application-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.application-filters .filter-btn {
    padding: 8px 15px;
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-sm);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.application-filters .filter-btn.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.applications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.application-card {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xs);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
}

.application-card .card-header-info {
    margin-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color-light);
    padding-bottom: var(--spacing-sm);
}

.application-card .job-title-link {
    font-size: var(--font-size-lg);
    color: var(--primary-dark);
    font-weight: 600;
    margin: 0;
}

.application-card .card-body-info p {
    margin-bottom: var(--spacing-xs);
    font-size: var(--font-size-sm);
    color: var(--text-body);
}

.application-card .card-body-info p strong {
    color: var(--text-dark);
}

.application-card .card-actions-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto; /* Pushes to the bottom */
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color-light);
}

.application-card .application-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: var(--font-size-xs);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Specific status colors for applications */
.application-status.status-pending,
.application-status.status-applied,
.application-status.status-shortlisted,
.application-status.status-interviewing {
    background-color: var(--warning-light);
    color: var(--warning);
}

.application-status.status-accepted {
    background-color: var(--success-light);
    color: var(--success);
}

.application-status.status-rejected {
    background-color: var(--danger-light);
    color: var(--danger);
}

.application-card .action-buttons-group {
    display: flex;
    gap: var(--spacing-xs);
}

.application-card .action-buttons-group .btn {
    font-size: var(--font-size-xs);
    padding: 6px 12px;
}

.empty-state {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-light);
}

.empty-state i {
    font-size: var(--font-size-xxl);
    margin-bottom: var(--spacing-md);
    color: var(--border-color);
}

.empty-state h3 {
    font-size: var(--font-size-lg);
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
}

.empty-state p {
    font-size: var(--font-size-base);
    margin-bottom: var(--spacing-md);
}

.empty-state .btn {
    font-size: var(--font-size-base);
    padding: 10px 20px;
}

.small-empty-state {
    padding: var(--spacing-lg);
}

.small-empty-state i {
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-sm);
}

/* --- Modals (General) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Slightly lighter overlay, less distracting */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    /* REVISED: Smoother, more subtle fade-in transition */
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--white);
    padding: var(--spacing-xl);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); /* Softer, less aggressive shadow */
    max-width: 650px;
    width: 90%;
    position: relative;
    transform: scale(0.95); /* Start slightly smaller */
    /* REVISED: Smoother, subtle scale-in animation */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease-in-out; /* Standard material design curve */
    opacity: 0;
}

.modal-overlay.show .modal-content {
    transform: scale(1); /* Scale to full size */
    opacity: 1;
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: var(--font-size-xxl);
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}

.modal-close-btn:hover {
    color: var(--danger);
    transform: rotate(90deg);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.modal-actions .btn {
    padding: 10px 20px;
    font-size: var(--font-size-base);
}

/* Fix for Logout Confirmation Button Hover */
.modal-actions .btn-danger-confirm {
    background-color: var(--danger);
    color: white;
    border: 1px solid var(--danger);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 2px 4px rgba(var(--danger-rgb), 0.2);
}
/* FIX: Specific hover style to prevent disappearing */
.modal-actions .btn-danger-confirm:hover, .modal-actions .btn-danger-confirm:focus {
    background-color: var(--danger-dark);
    border-color: var(--danger-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(var(--danger-rgb), 0.3);
    opacity: 1 !important; /* Ensure visibility */
    visibility: visible !important; /* Ensure visibility */
}

.modal-actions .btn-danger-confirm:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(var(--danger-rgb), 0.2);
}


/* Small modal for confirmations */
.modal-content.small-modal {
    max-width: 450px;
    padding: var(--spacing-lg);
    text-align: center;
}

.modal-content.small-modal h2 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-sm);
    border-bottom: none;
    padding-bottom: 0;
}

.modal-content.small-modal p {
    font-size: var(--font-size-base);
    color: var(--text-body);
    margin-bottom: var(--spacing-lg);
}

.modal-content.small-modal .modal-actions {
    justify-content: center;
    margin-top: var(--spacing-lg);
}

/* NEW: Uplifting button style */
.btn-uplifting {
    background-color: #28A745; /* A fresh, appealing green */
    color: white;
    border: 1px solid #28A745;
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.3);
    transition: all 0.2s ease-in-out;
    opacity: 1; /* Explicitly set opacity to prevent disappearing */
    visibility: visible;
}
/* FIX: Specific hover style to prevent disappearing */
.btn-uplifting:hover, .btn-uplifting:focus {
    background-color: #218838; /* Darker shade on hover */
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(40, 167, 69, 0.4);
    opacity: 1;
    visibility: visible;
}
.btn-uplifting:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(40, 167, 69, 0.2);
}

/* FIX: Edit Profile button color and hover state */
.btn-edit-profile {
    background-color: transparent;
    color: var(--text-dark); /* Changed to text-dark for consistency */
    border: 1px solid var(--border-color); /* Use a subtle border */
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--border-radius-lg);
    font-size: var(--font-size-base);
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); /* Softer shadow */
    transition: all 0.2s ease-in-out;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.btn-edit-profile:hover {
    background-color: var(--background-light); /* Lighter background on hover */
    border-color: var(--primary); /* Highlight with primary color on hover */
    color: var(--primary); /* Change text color to primary on hover */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(var(--primary-rgb), 0.1);
}

.btn-edit-profile:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(var(--primary-rgb), 0.2);
}


/* FIX: Ensure button visibility on hover for all buttons in modal actions */
.modal-actions .btn:hover,
.modal-actions .btn:focus {
    opacity: 1 !important;
    visibility: visible !important;
}
/* FIX: Change default secondary button hover to be less jarring */
.modal-actions .btn-secondary:hover {
    background-color: var(--gray-medium);
    color: var(--text-dark);
    border-color: var(--gray-medium);
}


/* FIX: Refined styling for the primary button on hover and active to be less bright */
.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}
.btn-primary:active {
    background-color: var(--primary-darker);
    border-color: var(--primary-darker);
}

/* FIX: Refined styling for the secondary button to be more aesthetically pleasing */
.btn-secondary {
    background-color: var(--gray-light);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.btn-secondary:hover {
    background-color: var(--gray-medium);
    color: var(--text-dark);
    border-color: var(--gray-medium);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:active {
    background-color: var(--gray-dark);
    transform: translateY(0);
    box-shadow: none;
}

/* NEW: Modernized Application Details Modal UI */
.modal-body-proposal {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    max-height: 70vh; /* FIX: Restrict height to enable scrolling */
    overflow-y: auto; /* FIX: Enable vertical scrolling */
}

.modal-header-proposal {
    text-align: center;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    position: relative;
}

.modal-header-proposal h2 {
    font-size: var(--font-size-xl);
    color: var(--primary-dark);
    margin: 0;
    padding-right: 20px; /* Space for the close button */
}

.proposal-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.proposal-details-grid .detail-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background-color: var(--background-light);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-sm);
}
.proposal-details-grid .detail-item .detail-icon {
    font-size: var(--font-size-lg);
    color: var(--primary);
    width: 24px;
    text-align: center;
}
.proposal-details-grid .detail-item .detail-content {
    display: flex;
    flex-direction: column;
}
.proposal-details-grid .detail-item .detail-content strong {
    font-size: var(--font-size-sm);
    color: var(--text-dark);
}
.proposal-details-grid .detail-item .detail-content span, .proposal-details-grid .detail-item .detail-content p {
    font-size: var(--font-size-base);
    color: var(--text-body);
    margin: 0;
}

.proposal-message h3 {
    font-size: var(--font-size-lg);
    color: var(--primary-dark);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

/* --- REVISED: Profile Viewers Modal Specifics --- */
#profileViewersModal .modal-content {
    max-width: 700px;
    padding: var(--spacing-xl);
}

#profileViewersModal h2 {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    font-size: var(--font-size-xxl);
    color: var(--primary-dark);
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: var(--spacing-md);
    position: relative;
    display: flex; /* Use flexbox to align icon and text */
    align-items: center;
    justify-content: center;
    gap: 10px; /* Space between icon and text */
}

/* Icon for modal title */
#profileViewersModal h2::before {
    content: '\f06e'; /* Eye icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--primary);
    font-size: var(--font-size-xl);
    /* No margin-right needed with gap */
}


.profile-viewers-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    max-height: 450px;
    overflow-y: auto;
    padding-right: 15px;
    padding-bottom: 10px;
}

.viewer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: var(--background-light);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.viewer-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.viewer-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-grow: 1;
}

.viewer-avatar-wrapper {
    flex-shrink: 0;
    position: relative;
}

.viewer-logo {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius-sm);
    object-fit: contain;
    background-color: white;
    border: 1px solid var(--border-color-light);
    padding: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.viewer-logo-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary-light), var(--primary-lighter));
    color: var(--primary-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: var(--font-size-lg);
    border: 2px solid var(--primary-light);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.viewer-details {
    flex-grow: 1;
}

.viewer-details h4 {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-dark);
}

.viewer-details p.viewer-company-name {
    margin: 2px 0;
    font-size: var(--font-size-base);
    color: var(--text-body);
}

.viewer-details small {
    color: var(--text-light);
    font-size: var(--font-size-sm);
}

.viewer-item .btn-sm {
    flex-shrink: 0;
    padding: 8px 15px;
    font-size: var(--font-size-sm);
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.no-viewers {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-light);
    background-color: var(--background-light);
    border-radius: var(--border-radius);
    margin-top: var(--spacing-md);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
}

.no-viewers i {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    color: var(--primary-light);
}

.no-viewers p {
    font-size: var(--font-size-lg);
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
}

.no-viewers small {
    display: block;
    font-size: var(--font-size-base);
    color: var(--text-body);
}


/* --- Introduction Modal Specifics --- */
.intro-modal {
    max-width: 700px;
    padding: var(--spacing-xl) var(--spacing-xxl);
}

.intro-welcome {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.intro-welcome h2 {
    font-size: var(--font-size-xxl);
    color: var(--primary-dark);
    margin-bottom: var(--spacing-sm);
    border-bottom: none;
    padding-bottom: 0;
}

.intro-welcome p {
    font-size: var(--font-size-lg);
    color: var(--text-body);
}

.intro-steps-indicator {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.step-indicator {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--gray-light);
    color: var(--text-light);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: var(--font-size-sm);
    border: 2px solid var(--gray);
    transition: all 0.3s ease;
}

.step-indicator.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.1);
}

.step-indicator.completed {
    background-color: var(--success);
    color: white;
    border-color: var(--success);
}

.intro-steps-content {
    position: relative;
    min-height: 250px;
    margin-bottom: var(--spacing-xl);
}

.intro-step {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s ease;
    text-align: center;
}

.intro-step.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.intro-step-icon {
    font-size: 5rem;
    color: var(--primary);
    margin-bottom: var(--spacing-lg);
}

.intro-step-icon.premium-icon {
    color: #FFD700;
}

/* REMOVED: .intro-step-icon.referral-icon */

.intro-step h3 {
    font-size: var(--font-size-xl);
    color: var(--primary-dark);
    margin-bottom: var(--spacing-md);
}

.intro-step p {
    font-size: var(--font-size-base);
    color: var(--text-body);
    margin-bottom: var(--spacing-md);
}

.intro-checklist {
    list-style: none;
    padding: 0;
    margin: var(--spacing-lg) auto;
    max-width: 300px;
    text-align: left;
}

.intro-checklist li {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-base);
    color: var(--text-dark);
}

.intro-checklist li i {
    color: var(--success);
    font-size: var(--font-size-lg);
    flex-shrink: 0;
}

.intro-tip {
    background-color: var(--info-light);
    color: var(--info);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-sm);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-md);
}

.intro-tip i {
    font-size: var(--font-size-base);
}

.intro-action {
    margin-top: var(--spacing-xl);
}

.intro-action .btn {
    padding: 12px 25px;
    font-size: var(--font-size-base);
    font-weight: 600;
}

.intro-action .btn-premium {
    background-color: #FFD700;
    color: #333;
    border-color: #FFD700;
}

.intro-action .btn-premium:hover {
    background-color: #E6C200;
    border-color: #E6C200;
}

.intro-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color-light);
}

.intro-navigation .btn {
    padding: 10px 20px;
    font-size: var(--font-size-base);
}

/* Toast Container */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: var(--white);
    color: var(--text-dark);
    padding: 12px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    min-width: 250px;
    max-width: 350px;
    border: 1px solid var(--border-color);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.toast-info {
    border-left: 5px solid var(--info);
}

.toast.toast-success {
    border-left: 5px solid var(--success);
}

.toast.toast-error {
    border-left: 5px solid var(--danger);
}

.toast.toast-warning {
    border-left: 5px solid var(--warning);
}

/* --- NEW: Unified Dropdown Styles --- */

.custom-dropdown {
    position: relative;
    width: 100%;
    text-align: left;
    user-select: none;
}

.custom-dropdown .dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: var(--spacing-sm);
    font-size: var(--font-size-base);
    color: var(--text-body);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-height: 42px; /* Ensure consistent height with other inputs */
}

.custom-dropdown .dropdown-toggle:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
    outline: none;
}

/* Apply disabled styles when the button has the disabled attribute */
.custom-dropdown .dropdown-toggle[disabled] {
    background-color: var(--background-light);
    cursor: not-allowed;
    opacity: 0.7;
}


.custom-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 10;
    max-height: 250px; /* Make the menu itself scrollable */
    overflow-y: auto; /* Enable scrolling for the entire menu */
    display: none; /* Hidden by default */
    transform: translateY(10px); /* Start slightly below for animation */
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.custom-dropdown.active .dropdown-menu {
    display: block; /* Show when active */
    transform: translateY(0);
    opacity: 1;
}

.dropdown-arrow {
    transition: transform 0.2s;
}

.custom-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* Search Input */
.dropdown-menu-search {
    padding: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0; /* Stick to the top of the scrollable dropdown-menu */
    background: var(--white);
    z-index: 2; /* Higher z-index than category-heading and checkboxes */
}

.profession-search-input {
    width: 100%;
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--border-color-light);
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-sm);
    box-sizing: border-box; /* Include padding in width */
}

.profession-search-input:focus {
    border-color: var(--primary);
    outline: none;
}

/* Apply disabled styles to search input when it has the disabled attribute */
.profession-search-input[disabled] {
    background-color: var(--background-light);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Checkbox List - now just a container for categories and items */
.dropdown-menu-checkboxes {
    /* No max-height or overflow here, as the parent .dropdown-menu handles scrolling */
    padding: var(--spacing-sm); /* Keep padding for content */
}

/* NEW: Category Heading in Dropdown */
.dropdown-menu-checkboxes .category-heading {
    font-size: var(--font-size-sm); /* Slightly smaller than base text */
    font-weight: bold;
    color: var(--primary-dark);
    padding: 8px 10px 4px; /* Top, horizontal, bottom padding */
    margin-top: 10px; /* Space above category */
    border-bottom: 1px solid var(--border-color-light);
    margin-bottom: 5px;
    background-color: var(--background-light); /* Ensure background covers content below */
    position: sticky; /* Make category headings sticky */
    /* Calculate top based on the height of .dropdown-menu-search */
    /* Assuming .dropdown-menu-search height is roughly 42px (input height) + 8px*2 (padding) = 58px */
    top: 58px; /* Stick below the search input. Adjust if actual search input height varies. */
    z-index: 1; /* Lower than search, higher than checkboxes */
}

/* Adjust margin for the first category heading */
.dropdown-menu-checkboxes .category-heading:first-of-type {
    margin-top: 0;
}


.checkbox-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: var(--font-size-base);
    color: var(--text-body);
}

.checkbox-item:hover {
    background-color: var(--background-light);
}

.checkbox-item input[type="checkbox"] {
    margin-right: 10px;
    min-width: 16px; /* Ensure checkbox is visible */
    min-height: 16px;
}

/* Apply disabled styles to checkboxes when they have the disabled attribute */
.dropdown-menu-checkboxes input[type="checkbox"][disabled] {
    cursor: not-allowed;
    opacity: 0.7;
}

.checkbox-item span {
    flex-grow: 1;
}

.no-results-message {
    padding: var(--spacing-md);
    text-align: center;
    color: var(--text-light);
    font-size: var(--font-size-sm);
}

.loading-spinner-small {
    padding: var(--spacing-md);
    text-align: center;
    color: var(--text-light);
    font-size: var(--font-size-sm);
}

/* Selected Tags Display */
.selected-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    min-height: 20px; /* Ensure space even if empty */
}

.selected-tag {
    background: var(--primary-light);
    color: var(--primary);
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    white-space: nowrap; /* Prevent tag text from wrapping */
}

.remove-tag-icon { /* Changed from .remove-tag for clarity */
    cursor: pointer;
    color: var(--primary);
    display: flex;
    align-items: center;
    font-size: 12px; /* Smaller icon */
}

.remove-tag-icon:hover {
    opacity: 0.8;
}

.tag-placeholder {
    color: var(--text-light);
    font-style: italic;
    font-size: var(--font-size-sm);
    padding: 4px 0;
}


/* --- NEW: Unified Referral Section Styles --- */
.referral-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.referral-info-card {
    background-color: var(--primary-extra-light);
    border: 1px solid var(--primary-light);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
}

.referral-info-card h3 {
    color: var(--primary-dark);
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-md);
}

.referral-bonus-details p {
    font-size: var(--font-size-base);
    color: var(--text-body);
}

.referral-bonus-details p strong {
    color: var(--primary-dark);
}

.referral-code-area {
    margin-top: var(--spacing-lg);
}

.referral-code-area h3 {
    font-size: var(--font-size-lg);
    color: var(--primary-dark);
    margin-bottom: var(--spacing-md);
}

.referral-code-box {
    display: flex;
    align-items: center;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: var(--spacing-xs);
    font-family: 'Roboto Mono', monospace;
    font-size: var(--font-size-base);
    font-weight: bold;
    color: var(--text-dark);
    justify-content: space-between;
    gap: var(--spacing-xs);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03);
}

.referral-code {
    flex-grow: 1;
    text-align: center;
    user-select: all;
    overflow-wrap: break-word;
    word-break: break-all;
    min-width: 0;
    padding: 0 5px;
}

.referral-code-box .btn-icon-only {
    background-color: var(--primary);
    color: white;
    border-radius: var(--radius-sm);
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: var(--shadow-xxs);
    flex-shrink: 0;
}

.referral-code-box .btn-icon-only:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.referral-code-box .btn-icon-only:active {
    transform: translateY(0);
    box-shadow: none;
}

.referral-share-actions {
    width: 100%;
}

.redeem-code-area {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-lg);
    background-color: var(--background-white);
    border: 1px solid var(--border-color-light);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xs);
}

.redeem-code-area h3 {
    font-size: var(--font-size-lg);
    color: var(--primary-dark);
    margin-bottom: var(--spacing-md);
}

.redeem-code-area .input-group {
    display: flex;
    gap: var(--spacing-sm);
}

.redeem-code-area .form-control {
    flex-grow: 1;
}

.redeem-code-area .btn {
    flex-shrink: 0;
}

.redeem-code-area .btn-secondary {
    background: linear-gradient(45deg, var(--secondary), var(--secondary-dark));
    color: white;
    border: none;
    box-shadow: 0 4px 10px rgba(var(--secondary-rgb), 0.3);
    transition: all 0.2s ease-in-out;
}

.redeem-code-area .btn-secondary:hover {
    background: linear-gradient(45deg, var(--secondary-dark), var(--secondary));
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(var(--secondary-rgb), 0.4);
}

.redeem-code-area .btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(var(--secondary-rgb), 0.2);
}

.referral-bonus-details .bonus-status {
    margin-top: var(--spacing-sm);
    font-size: var(--font-size-sm);
    font-style: italic;
    font-weight: 500;
}

/* --- Responsive Styles --- */
@media (max-width: 992px) {
    /* On mobile, completely hide the sidebar */
    .dashboard-sidebar {
        display: none;
    }
    
    .dashboard-content {
        padding-top: var(--spacing-lg); /* Add some space for the top header */
    }

    /* Keep wrapper as column so main content takes full width */
    .dashboard-wrapper {
        flex-direction: column;
    }

    .main-dashboard-title {
        text-align: center;
    }
}
