/* ========================================
   Custom Application Styles
   Consolidated from inline styles across the application
   ======================================== */

/* ========================================
   Admin Portal Styles (admin.php)
   ======================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: none;
    max-width: 500px;
    margin: 3rem auto;
}

.login-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 2rem;
}

.login-body {
    padding: 2rem;
}

.password-toggle {
    cursor: pointer;
}

/* ========================================
   Index/Landing Page Styles (index.php)
   ======================================== */
.landing-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    transition: all 0.3s ease;
    height: 100%;
}

.landing-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.access-icon {
    font-size: 4rem;
    color: #ffffff;
    margin-bottom: 1rem;
}

.access-button {
    background: rgba(13, 110, 253, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #ffffff;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.access-button:hover {
    background: rgba(13, 110, 253, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.4);
}

.access-button i {
    line-height: 1;
}

.hero-section {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    padding-top: 0;
}

.company-title {
    font-size: 2.5rem;
    font-weight: 400;
    color: #ffffff;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.company-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
}

.access-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* ========================================
   Client Form Styles (client-form.php)
   ======================================== */
.access-code-input {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    letter-spacing: 0.2rem;
    text-align: center;
    text-transform: uppercase;
}

.service-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0.25rem;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
}

.service-tag:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.service-tag.active {
    background: rgba(40, 167, 69, 0.2);
    border-color: #28a745;
    color: #ffffff;
}

.service-tag.completed {
    background: rgba(40, 167, 69, 0.15);
    border-color: #28a745;
}

.service-tag .completion-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #fff;
    color: #28a745;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.form-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.questionnaire-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 0;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.questionnaire-section.active {
    border-color: #28a745;
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
}

.questionnaire-header {
    background: rgba(255, 255, 255, 0.08);
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.questionnaire-header:hover {
    background: rgba(255, 255, 255, 0.12);
}

.questionnaire-header.active {
    background: rgba(40, 167, 69, 0.15);
}

.questionnaire-body {
    padding: 1.5rem;
    display: none;
}

.questionnaire-body.show {
    display: block;
    animation: slideDown 0.3s ease;
}

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

.progress-indicator {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-indicator.completed {
    color: #28a745;
}

.chevron-icon {
    transition: transform 0.3s ease;
    font-size: 1.25rem;
}

.chevron-icon.rotated {
    transform: rotate(180deg);
}

.overall-progress {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.progress-bar-container {
    flex-grow: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin: 0 1rem;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
    transition: width 0.5s ease;
    border-radius: 10px;
}

.required-field::after {
    content: ' *';
    color: #dc3545;
}

/* Form styling to match index page */
.form-control, .form-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

.form-control:focus, .form-select:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #007bff;
    color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.form-check-label {
    color: rgba(255, 255, 255, 0.8);
}

.form-check-input:checked {
    background-color: #007bff;
    border-color: #007bff;
}

/* Checkbox styling improvements */
.form-check {
    margin-bottom: 0.5rem;
    white-space: nowrap;
    width: 100%;
}

.form-check-label {
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.8);
}

h6 {
    color: #fff;
}

.text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Button styling to match index page */
.btn {
    display: inline-block;
    font-weight: 400;
    line-height: 1.2;
    color: #FFFFFF;
    text-align: center;
    letter-spacing: .5px;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: .375rem .75rem;
    font-size: 0.9rem;
    border-radius: .25rem;
    transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
    height: 38px;
    white-space: nowrap;
    box-sizing: border-box;
}

.btn-primary {
    background-color: #007bff !important;
    border-color: #007bff !important;
    color: white !important;
}

.btn-primary:hover {
    background-color: #0056b3 !important;
    border-color: #0056b3 !important;
    color: white !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3) !important;
}

.btn-primary:focus {
    background-color: #0056b3 !important;
    border-color: #0056b3 !important;
    color: white !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
}

.btn-primary:active {
    background-color: #004085 !important;
    border-color: #004085 !important;
    transform: translateY(0) !important;
}

/* Add/Remove service buttons */
.add-service, .remove-service {
    width: 32px !important;
    height: 32px !important;
    border-color: #5f6368 !important;
    color: #5f6368 !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    font-weight: bold !important;
    min-width: 32px !important;
    max-width: 32px !important;
}

.add-service:hover, .remove-service:hover {
    background-color: #5f6368 !important;
    border-color: #5f6368 !important;
    color: white !important;
}

.add-service:focus, .remove-service:focus {
    box-shadow: none !important;
}

/* ========================================
   Staff Portal Styles (staff-portal.php)
   ======================================== */
.service-item {
    background: #f1f3f4;
    border: 1px solid #dadce0;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    cursor: move;
    transition: all 0.3s ease;
    color: #5f6368;
}

.service-item strong {
    color: #3c4043;
}

.service-item:hover {
    background: #e8eaed;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.service-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.service-list {
    min-height: 200px;
    padding: 0.5rem;
}

.service-list.drag-over {
    background: #e8f5e8;
    border: 2px dashed #28a745;
    border-radius: 0.375rem;
}

.selected-service-item {
    background: #1e7e34;
    border: 1px solid #155724;
    color: #ffffff;
}

.selected-service-item strong {
    color: #ffffff;
}

.selected-service-item .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

.selected-service-item:hover {
    background: #155724;
    box-shadow: 0 4px 12px rgba(30, 126, 52, 0.3);
}

.empty-state {
    pointer-events: none;
    color: rgba(255, 255, 255, 0.9) !important;
}

.empty-state i {
    color: rgba(255, 255, 255, 0.7) !important;
}

.selected-service-item .remove-service {
    border-color: rgba(255, 255, 255, 0.8) !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.selected-service-item .remove-service:hover {
    background-color: rgba(255, 255, 255, 0.2) !important;
    border-color: white !important;
    color: white !important;
}

/* Override Smart Wizard active step styling */
#smartwizard .nav .nav-link.active,
#smartwizard .nav .nav-link.active:hover,
#smartwizard .nav .nav-link.active:focus {
    color: white !important;
}

#smartwizard .nav .nav-link.active strong {
    color: white !important;
}

/* Ensure non-active steps maintain their original styling */
#smartwizard .nav .nav-link:not(.active) {
    background-color: transparent !important;
}

/* Scope Type Selection Boxes */
.scope-option {
    border: 2px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
    text-align: center;
    margin-bottom: 1rem;
    position: relative;
}

.scope-option:hover {
    border-color: #007bff;
    background: #e3f2fd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.15);
}

.scope-option.selected {
    border-color: #28a745;
    background: #d4edda;
    box-shadow: 0 4px 16px rgba(40,167,69,0.25);
}

.scope-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.scope-option h6 {
    color: #495057;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.scope-option.selected h6 {
    color: #155724;
}

.scope-option p {
    color: #6c757d;
    margin-bottom: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.scope-option.selected p {
    color: #155724;
}

.scope-option::before {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    border: 2px solid #dee2e6;
    border-radius: 50%;
    background: white;
    transition: all 0.3s ease;
}

.scope-option.selected::before {
    border-color: #28a745;
    background: #28a745;
}

.scope-option.selected::after {
    content: '';
    position: absolute;
    top: 14px;
    right: 16px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* reCAPTCHA Styles */
.recaptcha-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.g-recaptcha {
    transform: scale(0.9);
    transform-origin: 0 0;
}

@media (max-width: 768px) {
    .g-recaptcha {
        transform: scale(0.8);
    }
}

.btn.submitting {
    pointer-events: none;
    opacity: 0.7;
}

/* Disabled button styling for successful submission */
.btn.disabled, .btn:disabled {
    pointer-events: none;
    opacity: 0.5;
    cursor: not-allowed;
}

.security-badge {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    display: inline-block;
    margin-bottom: 0.5rem;
}

/* Input validation styles */
.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Success state for valid inputs */
.form-control.is-valid {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Step validation status indicators */
.step-status-indicator {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    animation: fadeIn 0.3s ease-in;
}

.step-validation-alert {
    animation: slideDown 0.3s ease-out;
}

/* Top Toolbar Styles */
.top-toolbar {
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.top-toolbar .btn {
    margin-left: 0.5rem;
    min-width: 100px;
}

/* ========================================
   Unauthorized/Error Page Styles (unauthorized.php)
   ======================================== */
.error-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    transition: all 0.3s ease;
}

.error-icon {
    font-size: 8rem;
    color: #ff6b6b;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.error-code {
    font-size: 4rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.error-title {
    font-size: 2rem;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 1rem;
}

.error-description {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.back-button {
    background: rgba(13, 110, 253, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #ffffff;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.back-button:hover {
    background: rgba(13, 110, 253, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.4);
}

.back-button i {
    line-height: 1;
}

.error-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 2rem 0;
}

.info-box {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.info-box h5 {
    color: #ff6b6b;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.info-box ul {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0;
}

.info-box ul li {
    margin-bottom: 0.5rem;
}

/* ========================================
   Questionnaire Preview Styles (questionnaire-preview.php)
   ======================================== */
.service-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.scope-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.25rem;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid #007bff;
}

.question-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 0.25rem;
    border-left: 2px solid #28a745;
}

.field-details {
    margin-top: 0.5rem;
    padding-left: 1rem;
}

h1, h2, h3 {
    color: #fff;
}

.text-danger {
    color: #dc3545 !important;
}

.nav-tabs .nav-link {
    color: rgba(255, 255, 255, 0.8);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-tabs .nav-link.active {
    color: #fff;
    background: rgba(0, 123, 255, 0.2);
    border-color: #007bff;
}

.tab-content {
    padding-top: 1rem;
}

/* ========================================
   Header Component Dropdown Styles (header-component.php)
   ======================================== */
.dropdown-menu {
    background: rgba(40, 44, 52, 0.95) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    width: 350px;
    min-width: 350px;
}

/* Alternative dropdown styles (for client-form/staff-portal) */
.dropdown-menu.alt-style {
    max-height: 500px;
    border: 1px solid #5a5a5a;
    background-color: #404040;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

/* Hide scrollbars */
.dropdown-menu::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

.dropdown-menu::-webkit-scrollbar-thumb {
    background: transparent;
}

.dropdown-menu .dropdown-header {
    color: #ffffff !important;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.5rem 1rem 0.25rem 1rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    margin: 0.25rem;
}

.dropdown-menu.alt-style .dropdown-header {
    background-color: #505050;
    padding: 8px 16px;
    margin: 0;
    border-bottom: 1px solid #606060;
    border-radius: 0;
}

.dropdown-menu .dropdown-item {
    color: #ffffff !important;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    border-radius: 4px;
    margin: 0 0.25rem;
    font-size: 0.85rem;
}

.dropdown-menu.alt-style .dropdown-item {
    padding: 8px 16px;
    margin: 0;
    border-radius: 0;
}

.dropdown-menu .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    transform: translateX(3px);
}

.dropdown-menu.alt-style .dropdown-item:hover {
    background-color: #5a5a5a;
    transform: none;
}

.dropdown-menu .dropdown-item i {
    opacity: 0.8;
    color: #ffffff !important;
}

.dropdown-menu .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.3) !important;
    margin: 0.25rem 0.5rem;
}

.dropdown-menu.alt-style .dropdown-divider {
    border-color: #606060;
    margin: 0;
}

#downloadDropdown {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: #ffffff !important;
    transition: all 0.3s ease;
}

#downloadDropdown:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}

#downloadDropdown.alt-style {
    border-color: #20c997;
    color: #20c997;
}

#downloadDropdown.alt-style:hover {
    background-color: #20c997;
    border-color: #20c997;
    color: white;
}

/* Header button styling */
.header-btn {
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.7) !important;
    color: #ffffff !important;
}

/* ========================================
   Responsive Media Queries
   ======================================== */
@media (max-width: 768px) {
    .card-title {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }
    
    .dropdown {
        align-self: flex-end;
    }
    
    .dropdown-menu {
        max-height: 400px;
    }
}
