/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    min-height: 100vh;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    margin-bottom: 30px;
}

header h1 {
    color: #2c5aa0;
    font-size: 2rem;
}

header p {
    color: #666;
    margin-top: 5px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Buttons */
.primary-button {
    background-color: #2c5aa0;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.primary-button:hover {
    background-color: #1e3d6f;
}

.secondary-button {
    background-color: #6c757d;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.secondary-button:hover {
    background-color: #545b62;
}

/* Auth Section */
.auth-section {
    text-align: center;
    padding: 40px;
    background-color: #f8f9fa;
    border-radius: 10px;
    margin: 20px 0;
}

.auth-section h2 {
    color: #2c5aa0;
    margin-bottom: 15px;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 5px;
    margin: 15px 0;
    border: 1px solid #f5c6cb;
}

/* Features */
.features {
    margin-top: 30px;
}

.features h3 {
    color: #2c5aa0;
    margin-bottom: 15px;
}

.features ul {
    list-style-type: none;
    padding-left: 0;
}

.features li {
    padding: 10px 0;
    padding-left: 25px;
    position: relative;
}

.features li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 30px;
}

.tab-button {
    background: none;
    border: none;
    padding: 15px 25px;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-button:hover {
    color: #2c5aa0;
}

.tab-button.active {
    color: #2c5aa0;
    border-bottom-color: #2c5aa0;
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Search */
.search-section {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.search-select-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-results {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
}

.search-result-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

.search-result-item.selected {
    background-color: #e3f2fd;
}

/* Claims List */
.claims-list {
    background: white;
    border-radius: 8px;
    padding: 20px;
}

.claim-item {
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 5px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.claim-item:hover {
    border-color: #2c5aa0;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(44, 90, 160, 0.2);
    background: #f8f9fa;
}

.claim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.claim-number {
    font-weight: bold;
    color: #2c5aa0;
    font-size: 1.1em;
}

.claim-stage {
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
}

.claim-details {
    margin-top: 5px;
}

.claim-dates {
    color: #666;
    font-size: 0.85em;
    margin-bottom: 4px;
}

.claim-distributor {
    color: #495057;
    font-size: 0.9em;
    font-weight: 500;
}

.claim-item::after {
    content: "📋 Click to view in HubSpot";
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    opacity: 0;
    transition: opacity 0.2s;
}

.claim-item:hover::after {
    opacity: 1;
}

/* Form Styles */
.claim-form {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h3 {
    color: #2c5aa0;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 0 2px rgba(44, 90, 160, 0.1);
}

.form-group input[required] + label:after,
label[for*="required"]:after {
    content: " *";
    color: #dc3545;
}

/* Small Tabs */
.tabs-small {
    display: flex;
    margin-bottom: 20px;
    background: #f8f9fa;
    border-radius: 5px;
    padding: 5px;
}

.tab-small {
    flex: 1;
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s;
}

.tab-small.active {
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    color: #2c5aa0;
}

.tab-small-content {
    display: none;
}

.tab-small-content.active {
    display: block;
}

/* Focus and validation styles */
.focused {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.field-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
}

.duplicate {
    border-color: #ffc107 !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
}

.duplicate-warning {
    color: #856404;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 12px;
    margin-top: 4px;
    font-size: 12px;
}

.duplicate-header {
    font-weight: 600;
    margin-bottom: 4px;
}

.duplicate-details {
    font-size: 11px;
    color: #6c5500;
    margin-bottom: 8px;
}

.duplicate-actions {
    display: flex;
    gap: 8px;
}

.override-duplicate, .view-duplicate {
    background: #856404;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.override-duplicate:hover, .view-duplicate:hover {
    background: #6c5500;
}

.view-duplicate {
    background: #6c757d;
}

.view-duplicate:hover {
    background: #5a6268;
}

/* ICD-10 and HCPCS Codes Styling */
.selected-codes {
    margin-top: 8px;
    min-height: 30px;
}

.no-codes-selected {
    color: #999;
    font-style: italic;
    font-size: 0.9em;
}

.code-tag {
    display: inline-flex;
    align-items: center;
    background: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 16px;
    padding: 4px 8px;
    margin: 2px 4px 2px 0;
    font-size: 0.85em;
}

.code-info {
    margin-right: 6px;
}

.remove-code {
    background: transparent;
    border: none;
    color: #dc3545;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.remove-code:hover {
    background: #dc3545;
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Codes Table Styling */
.codes-results {
    max-height: 400px;
    overflow-y: auto;
    margin: 16px 0;
}

.codes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.codes-table th,
.codes-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    vertical-align: top;
}

.codes-table th {
    background: #f8f9fa;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.codes-table tr:hover {
    background: #f8f9fa;
}

.code-cell {
    font-family: monospace;
    font-weight: bold;
    min-width: 80px;
}

.description-cell {
    max-width: 200px;
}

.long-description-cell {
    max-width: 300px;
    word-wrap: break-word;
}

.code-checkbox {
    transform: scale(1.2);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 20px;
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
    flex-shrink: 0;
}

.modal-search {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.modal-search .search-input {
    flex: 1;
}

.search-note {
    margin: 12px 0 16px 0;
    padding: 0;
    font-size: 12px;
    color: #666;
    font-style: italic;
    text-align: center;
}

.loading, .no-results, .error {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

.error {
    color: #dc3545;
}

/* Autocomplete Styling */
.autocomplete-container {
    position: relative;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

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

.suggestion-item:hover,
.suggestion-item.highlighted {
    background-color: #f8f9fa;
}

.suggestion-item.selected {
    background-color: #e3f2fd;
    color: #2c5aa0;
}

.suggestion-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.suggestion-details {
    font-size: 12px;
    color: #666;
}

.no-suggestions {
    padding: 12px 15px;
    color: #666;
    font-style: italic;
    text-align: center;
}

/* Address Section */
.address-section {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 5px;
}

.address-section h4 {
    color: #2c5aa0;
    margin-bottom: 15px;
}

/* Modal Styling */
.modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.modal-header h3 {
    margin: 0;
    color: #2c5aa0;
}

.close-modal {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.modal-search {
    margin-bottom: 15px;
}

.distributors-list {
    max-height: 400px;
    overflow-y: auto;
}

.distributor-item {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.distributor-item:hover {
    background: #f8f9fa;
    border-color: #2c5aa0;
}

.distributor-item.selected {
    background: #e3f2fd;
    border-color: #2c5aa0;
    color: #2c5aa0;
}

.distributor-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.distributor-npi {
    font-size: 14px;
    color: #666;
    margin-bottom: 2px;
}

.distributor-location {
    font-size: 12px;
    color: #888;
}

/* Provider, Insurer, and Adjuster lists */
.providers-list,
.insurers-list,
.adjusters-list {
    max-height: 400px;
    overflow-y: auto;
}

.list-item {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.list-item:hover {
    background: #f8f9fa;
    border-color: #2c5aa0;
}

.item-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.item-detail {
    font-size: 14px;
    color: #666;
    margin-bottom: 2px;
}

.modal-note {
    padding: 12px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 5px;
    margin-bottom: 15px;
    color: #856404;
}

.loading {
    text-align: center;
    color: #666;
    padding: 20px;
    font-style: italic;
}

.no-distributors,
.no-results {
    text-align: center;
    color: #666;
    padding: 20px;
    font-style: italic;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    padding-top: 20px;
    margin-top: 30px;
    border-top: 1px solid #eee;
}

/* Custom Notification */
.custom-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 20px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
}

.custom-notification.success {
    border-left: 4px solid #28a745;
}

.custom-notification.error {
    border-left: 4px solid #dc3545;
}

.custom-notification.warning {
    border-left: 4px solid #ffc107;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-icon {
    font-size: 24px;
}

.notification-icon.success {
    color: #28a745;
}

.notification-icon.error {
    color: #dc3545;
}

.notification-icon.warning {
    color: #ffc107;
}

.notification-message {
    flex: 1;
    font-size: 16px;
    color: #333;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.custom-notification.slide-out {
    animation: slideOut 0.3s ease-in forwards;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .search-section,
    .search-select-group {
        flex-direction: column;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .nav-tabs {
        flex-wrap: wrap;
    }
    
    .custom-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}

/* File Upload Styles */
.file-upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    background-color: #fafafa;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: #2c5aa0;
    background-color: #f0f4f8;
}

.file-upload-area.drag-over {
    border-color: #2c5aa0;
    background-color: #e3f2fd;
}

.upload-prompt svg {
    color: #2c5aa0;
    margin-bottom: 15px;
}

.upload-prompt p {
    margin: 8px 0;
    color: #666;
}

.upload-link {
    color: #2c5aa0;
    text-decoration: underline;
    cursor: pointer;
}

.upload-link:hover {
    color: #1e3d6f;
}

.upload-hint {
    font-size: 14px;
    color: #999;
}

.file-list {
    margin-top: 20px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    margin-bottom: 8px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.file-icon {
    color: #2c5aa0;
    font-size: 20px;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
}

.file-size {
    font-size: 12px;
    color: #666;
}

.file-remove {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s;
}

.file-remove:hover {
    background-color: #c82333;
}

.file-uploading {
    opacity: 0.6;
}

.file-upload-progress {
    width: 100%;
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.file-upload-progress-bar {
    height: 100%;
    background-color: #2c5aa0;
    transition: width 0.3s ease;
}