/* Fusion Authorizer Portal - Custom Styles */
/* Color Scheme: Dark Blue (#1a365d, #2c5282) with Green accents (#38a169) */

:root {
    --portal-primary: #1a365d;
    --portal-primary-light: #2c5282;
    --portal-accent: #38a169;
    --portal-accent-light: #48bb78;
    --portal-dark: #1a202c;
    --portal-gray: #718096;
    --portal-light: #f7fafc;
}

/* Portal Header Styling - Only for Fusion Portal pages */
/* Removed global navbar styling to prevent affecting other portal pages */

/* Card Headers with Portal Theme */
.card-header.bg-dark {
    background: linear-gradient(135deg, var(--portal-primary) 0%, var(--portal-primary-light) 100%) !important;
}

.card-header.bg-primary {
    background: var(--portal-primary-light) !important;
}

.card-header.bg-success {
    background: var(--portal-accent) !important;
}

/* Stat Cards */
.card.bg-primary {
    background: linear-gradient(135deg, var(--portal-primary) 0%, var(--portal-primary-light) 100%) !important;
}

.card.bg-success {
    background: linear-gradient(135deg, var(--portal-accent) 0%, var(--portal-accent-light) 100%) !important;
}

/* Table Styling */
.table-dark th {
    background: var(--portal-primary) !important;
}

.table-success th {
    background: var(--portal-accent) !important;
    color: white !important;
}

.table-info th {
    background: var(--portal-primary-light) !important;
    color: white !important;
}

/* Badges */
.badge.bg-primary {
    background: var(--portal-primary-light) !important;
}

.badge.bg-success {
    background: var(--portal-accent) !important;
}

/* Buttons */
.btn-primary {
    background: var(--portal-primary-light) !important;
    border-color: var(--portal-primary-light) !important;
}

.btn-primary:hover {
    background: var(--portal-primary) !important;
    border-color: var(--portal-primary) !important;
}

.btn-success {
    background: var(--portal-accent) !important;
    border-color: var(--portal-accent) !important;
}

.btn-success:hover {
    background: var(--portal-accent-light) !important;
    border-color: var(--portal-accent-light) !important;
}

.btn-outline-primary {
    color: var(--portal-primary-light) !important;
    border-color: var(--portal-primary-light) !important;
}

.btn-outline-primary:hover {
    background: var(--portal-primary-light) !important;
    color: white !important;
}

/* Search Box Styling */
#portal-search-input {
    border-radius: 25px 0 0 25px;
    padding-left: 20px;
}

#portal-search-input:focus {
    border-color: var(--portal-primary-light);
    box-shadow: 0 0 0 0.2rem rgba(44, 82, 130, 0.25);
}

/* Case List Row Hover */
.table-hover tbody tr:hover {
    background-color: rgba(44, 82, 130, 0.1);
}

/* Document Upload Area */
.document-upload-area {
    border: 2px dashed var(--portal-gray);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    background: var(--portal-light);
    transition: all 0.3s ease;
}

.document-upload-area:hover {
    border-color: var(--portal-primary-light);
    background: rgba(44, 82, 130, 0.05);
}

/* Comment Section */
.comment-item {
    border-left: 4px solid var(--portal-primary-light);
    padding-left: 15px;
    margin-bottom: 15px;
}

.comment-item .comment-author {
    font-weight: 600;
    color: var(--portal-primary);
}

.comment-item .comment-date {
    font-size: 0.85em;
    color: var(--portal-gray);
}

/* Signature Pad */
.signature-pad-container {
    border: 2px solid var(--portal-gray);
    border-radius: 8px;
    padding: 10px;
    background: white;
    touch-action: none;
}

.signature-pad-container canvas {
    cursor: crosshair;
    width: 100%;
    height: 200px;
}

/* Progress Bar */
.progress {
    border-radius: 15px;
    overflow: hidden;
}

.progress-bar {
    font-size: 0.75rem;
    font-weight: 600;
}

/* Assessment Form Cards */
.assessment-section-card {
    transition: all 0.3s ease;
}

.assessment-section-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Status Badges */
.status-badge {
    padding: 0.5em 1em;
    border-radius: 20px;
    font-weight: 500;
}

.status-draft {
    background: #e2e8f0;
    color: #4a5568;
}

.status-pending {
    background: #faf089;
    color: #744210;
}

.status-completed {
    background: #c6f6d5;
    color: #276749;
}

.status-cancelled {
    background: #fed7d7;
    color: #9b2c2c;
}

/* Quick Action Buttons */
.quick-action-btn {
    min-width: 150px;
    margin-bottom: 10px;
}

/* Loading Spinner */
.search-loading {
    display: none;
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
}

.search-loading.active {
    display: block;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .card-header {
        font-size: 0.9rem;
    }
    
    .btn-lg {
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }
    
    .table-responsive {
        font-size: 0.85rem;
    }
    
    .signature-pad-container canvas {
        height: 150px;
    }
}

/* Animation for Search Results */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-result-row {
    animation: fadeIn 0.3s ease;
}

/* Highlight matching text */
.search-highlight {
    background-color: #faf089;
    padding: 0 2px;
    border-radius: 2px;
}

/* ========================================
   EXPRESS ASSESSMENT FORM STYLES
   ======================================== */

.assessment-express-form .form-label {
    color: #333;
    font-size: 0.95rem;
}

.assessment-express-form .form-label.fw-bold {
    font-weight: 600 !important;
}

.assessment-express-form .form-control,
.assessment-express-form .form-select {
    border-radius: 6px;
    border-color: #dee2e6;
    padding: 0.625rem 0.875rem;
}

.assessment-express-form .form-control:focus,
.assessment-express-form .form-select:focus {
    border-color: #2e7aad;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.assessment-express-form .form-select-lg {
    padding: 0.75rem 1rem;
    font-size: 1.1rem;
}

/* Input Group with Inch suffix */
.assessment-express-form .input-group-text {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
    font-weight: 500;
}

/* Checkbox and Radio Styling */
.assessment-express-form .form-check {
    padding-left: 1.75rem;
    margin-bottom: 0.5rem;
}

.assessment-express-form .form-check-input {
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 0.15rem;
    margin-left: -1.75rem;
}

.assessment-express-form .form-check-input:checked {
    background-color: #2e7aad;
    border-color: #2e7aad;
}

.assessment-express-form .form-check-label {
    color: #333;
    cursor: pointer;
}

/* Equipment Form Sections */
.assessment-express-form .equipment-form h2 {
    color: #1a1a1a;
    font-size: 1.5rem;
    letter-spacing: 1px;
}

/* Card Styling */
.assessment-express-form .card {
    border: none;
    border-radius: 12px;
}

.assessment-express-form .card-header.bg-primary {
    background: var(--fc-portal-gradient, linear-gradient(135deg, #5ba848 0%, #3a8fb7 60%, #2e7aad 100%)) !important;
    border-radius: 12px 12px 0 0;
}

.assessment-express-form .card-body {
    padding: 2rem;
}

.assessment-express-form .card-footer {
    border-top: 1px solid #e9ecef;
    padding: 1.25rem 2rem;
}

/* Button Styling */
.assessment-express-form .btn-primary {
    background: #2e7aad !important;
    border-color: #4361ee !important;
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 6px;
}

.assessment-express-form .btn-primary:hover {
    background: #3451d1 !important;
    border-color: #3451d1 !important;
}

.assessment-express-form .btn-success {
    background: #10b981 !important;
    border-color: #10b981 !important;
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 6px;
}

.assessment-express-form .btn-success:hover {
    background: #059669 !important;
    border-color: #059669 !important;
}

.assessment-express-form .btn-outline-secondary {
    border-width: 2px;
    font-weight: 500;
}

/* Progress Bar */
.assessment-express-form .progress {
    height: 8px;
    background-color: #e9ecef;
}

.assessment-express-form .progress-bar {
    background: var(--fc-portal-gradient, linear-gradient(90deg, #5ba848 0%, #3a8fb7 60%, #2e7aad 100%));
}

/* Section Separators */
.assessment-express-form hr {
    border-color: #e9ecef;
    opacity: 1;
}

/* Required Field Indicator */
.assessment-express-form .text-danger {
    color: #dc3545 !important;
}

/* Section Headers within form */
.assessment-express-form h5.fw-bold {
    color: #374151;
    border-bottom: 2px solid #2e7aad;
    padding-bottom: 0.5rem;
    display: inline-block;
}

/* New Assessment Card on Portal Home */
.portal-new-assessment-card {
    background: var(--fc-portal-gradient, linear-gradient(135deg, #5ba848 0%, #3a8fb7 60%, #2e7aad 100%)) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.portal-new-assessment-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3) !important;
}

.portal-new-assessment-card .card-body {
    background: transparent !important;
}

.portal-new-assessment-card h5,
.portal-new-assessment-card small {
    color: #fff !important;
}

.portal-new-assessment-card .icon-circle {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.25) !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portal-new-assessment-card .icon-circle i {
    color: #fff !important;
    font-size: 1.25rem;
}

/* Authorizer Portal Card on Portal Home */
.portal-authorizer-card {
    background: var(--fc-portal-gradient, linear-gradient(135deg, #5ba848 0%, #3a8fb7 60%, #2e7aad 100%)) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.portal-authorizer-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(46, 122, 173, 0.3) !important;
}

.portal-authorizer-card .card-body {
    background: transparent !important;
}

.portal-authorizer-card h5,
.portal-authorizer-card small {
    color: #fff !important;
}

.portal-authorizer-card .icon-circle {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.25) !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portal-authorizer-card .icon-circle i {
    color: #fff !important;
    font-size: 1.25rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .assessment-express-form .card-body {
        padding: 1.25rem;
    }
    
    .assessment-express-form .d-flex.flex-wrap.gap-4 {
        gap: 0.5rem !important;
    }
    
    .assessment-express-form .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    
    .assessment-express-form .col-md-4,
    .assessment-express-form .col-md-6 {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* ================================================================== */
/* AUTHORIZER DASHBOARD - MOBILE-FIRST REDESIGN                       */
/* ================================================================== */

.auth-dash {
    background: #f8f9fb;
    min-height: 80vh;
}

/* Content Area */
.auth-dash-content {
    padding-top: 24px;
    padding-bottom: 40px;
}

/* Welcome Header */
.auth-dash-header {
    background: var(--fc-portal-gradient, linear-gradient(135deg, #5ba848 0%, #3a8fb7 60%, #2e7aad 100%));
    border-radius: 16px;
    margin-bottom: 24px;
    overflow: hidden;
}

.auth-dash-header-inner {
    padding: 28px 30px 24px;
}

.auth-dash-greeting {
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 4px 0;
    letter-spacing: -0.3px;
}

.auth-dash-subtitle {
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    margin: 0;
    font-weight: 400;
}

/* ---- Action Tiles ---- */
.auth-dash-tiles {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}

.auth-tile {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 14px;
    padding: 18px 20px;
    text-decoration: none !important;
    color: #333 !important;
    border: 1px solid #e8ecf1;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    min-height: 72px;
}

.auth-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    border-color: #d0d5dd;
}

.auth-tile:active {
    transform: scale(0.98);
}

.auth-tile-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
    color: #fff;
    margin-right: 16px;
}

.auth-tile-cases .auth-tile-icon {
    background: linear-gradient(135deg, #2e7aad, #1a6b9a);
}

.auth-tile-assessments .auth-tile-icon {
    background: linear-gradient(135deg, #5ba848, #4a9e3f);
}

.auth-tile-new .auth-tile-icon {
    background: linear-gradient(135deg, #3a8fb7, #2e7aad);
}

.auth-tile-info {
    flex: 1;
    min-width: 0;
}

.auth-tile-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.3;
}

.auth-tile-desc {
    font-size: 13px;
    color: #8b95a5;
    line-height: 1.3;
    margin-top: 3px;
}

.auth-tile-badge .badge {
    background: #eef1f7;
    color: #3949ab;
    font-size: 15px;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 20px;
    margin-right: 10px;
}

.auth-tile-arrow {
    color: #c5ccd6;
    font-size: 14px;
    flex-shrink: 0;
}

/* ---- Sections ---- */
.auth-dash-section {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid #e8ecf1;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.auth-section-header {
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #444;
    border-bottom: 1px solid #f0f2f5;
    display: flex;
    align-items: center;
}

.auth-section-attention {
    color: #c0392b;
    background: #fef5f5;
    border-bottom-color: #fce4e4;
}

.auth-section-pending {
    color: #d97706;
    background: #fef9f0;
    border-bottom-color: #fdecd0;
}

/* ---- Case List Items ---- */
.auth-case-list {
    padding: 0;
}

.auth-case-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    text-decoration: none !important;
    color: inherit !important;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.1s ease;
    cursor: pointer;
}

.auth-case-item:last-child {
    border-bottom: none;
}

.auth-case-item:hover {
    background: #f9fafb;
}

.auth-case-item:active {
    background: #f0f2f5;
}

.auth-case-attention {
    border-left: 3px solid #e74c3c;
}

.auth-case-main {
    flex: 1;
    min-width: 0;
}

.auth-case-client {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.auth-case-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
    align-items: center;
}

.auth-case-ref {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
}

.auth-case-type {
    font-size: 11px;
    background: #e3f2fd;
    color: #1565c0;
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: 500;
    text-transform: uppercase;
}

.auth-case-status {
    font-size: 11px;
    background: #f3e5f5;
    color: #7b1fa2;
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: 500;
}

.badge-attention {
    font-size: 11px;
    background: #fce4ec;
    color: #c62828;
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: 600;
}

.auth-case-date {
    font-size: 12px;
    color: #9ca3af;
}

.auth-case-arrow {
    color: #c5ccd6;
    font-size: 14px;
    flex-shrink: 0;
    margin-left: 12px;
}

/* ---- Empty State ---- */
.auth-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #aaa;
}

.auth-empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.auth-empty-state h5 {
    color: #666;
    margin-bottom: 8px;
}

/* ---- Desktop Enhancements ---- */
@media (min-width: 768px) {
    .auth-dash-header-inner {
        padding: 32px 36px 28px;
    }
    
    .auth-dash-greeting {
        font-size: 28px;
    }
    
    .auth-dash-tiles {
        flex-direction: row;
        gap: 16px;
    }
    
    .auth-tile {
        flex: 1;
        padding: 20px 22px;
    }
    
    .auth-dash-content {
        padding-top: 28px;
    }
}

/* ---- Mobile Optimizations ---- */
@media (max-width: 767px) {
    .auth-dash-content {
        padding-left: 12px;
        padding-right: 12px;
        padding-top: 16px;
    }
    
    .auth-dash-header {
        border-radius: 0;
        margin-left: -12px;
        margin-right: -12px;
        margin-top: -24px;
        margin-bottom: 20px;
    }
    
    .auth-dash-header-inner {
        padding: 22px 20px 20px;
    }
    
    .auth-dash-greeting {
        font-size: 20px;
    }
    
    .auth-dash-subtitle {
        font-size: 13px;
    }
    
    .auth-tile {
        padding: 16px 18px;
        min-height: 66px;
    }
    
    .auth-tile-icon {
        width: 44px;
        height: 44px;
        font-size: 18px;
        margin-right: 14px;
    }
    
    .auth-case-item {
        padding: 14px 18px;
    }
    
    .auth-section-header {
        padding: 14px 18px;
    }
}
