/* ==========================================================================
   ClaimAssist Pro - Main Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Global Resets & Font Definitions
   -------------------------------------------------------------------------- */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f9;
    color: #333;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   2. Main Layout & Container
   -------------------------------------------------------------------------- */

.container {
    max-width: 800px;
    margin: 30px auto;
    padding: 20px;
}

/* --------------------------------------------------------------------------
   3. Header & Disclaimer
   -------------------------------------------------------------------------- */

header {
    background-color: #ffffff;
    padding: 25px 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.07);
    margin-bottom: 40px;
    border: 1px solid #e9ecef;
    text-align: center;
}

h1 {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
}

.disclaimer {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 15px;
    border-radius: 8px;
    font-size: 14px;
    text-align: left;
}

/* --------------------------------------------------------------------------
   4. Step Indicator
   -------------------------------------------------------------------------- */

.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.step {
    padding: 10px 15px;
    background-color: #e9ecef;
    color: #6c757d;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease-in-out;
    flex: 1;
    text-align: center;
    margin: 0 5px;
    border: 1px solid transparent;
}

.step.active {
    background-color: #3498db;
    color: white;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.step.completed {
    background-color: #27ae60;
    color: white;
    border-color: #2ecc71;
}

/* --------------------------------------------------------------------------
   5. Form Sections & General Content
   -------------------------------------------------------------------------- */

.form-section {
    background-color: #ffffff;
    padding: 30px 35px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.form-section h2 {
    color: #2c3e50;
    font-size: 22px;
    margin-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 10px;
}

.form-section p {
    margin-bottom: 25px;
    color: #6c757d;
    font-size: 15px;
}

/* --------------------------------------------------------------------------
   6. Interactive Elements: Inputs, Buttons, Selects
   -------------------------------------------------------------------------- */

input[type="text"],
input[type="file"],
select {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 10px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #f8f9fa;
}

input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.25);
    background-color: #ffffff;
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    display: block;
    width: 100%;
    margin-top: 15px;
}

button:hover {
    background-color: #2980b9;
}

button:active {
    transform: translateY(1px);
}

button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    box-shadow: none;
}

/* --------------------------------------------------------------------------
   7. Image Upload & Preview
   -------------------------------------------------------------------------- */

.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    background-color: #f8f9fa;
    position: relative;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #3498db;
    background-color: #e9f5ff;
}

.upload-area input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.image-preview {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.image-preview img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.upload-area-helper-text {
    font-size: 14px;
    color: #6c757d;
    margin-top: 10px;
}

/* --------------------------------------------------------------------------
   8. Dynamic Content: Loading, Errors, Editable Grid, Documents
   -------------------------------------------------------------------------- */

.loading,
.error {
    text-align: center;
    padding: 50px 20px;
    font-size: 18px;
    color: #7f8c8d;
}

.error {
    color: #e74c3c;
    font-weight: 500;
}

.damage-summary,
.document-item {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px solid #e9ecef;
}

.damage-item-editable {
    border-bottom: 1px solid #e9ecef;
    padding: 20px 0;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 15px;
    align-items: flex-end;
}
.damage-item-editable:last-child {
    border-bottom: none;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 5px;
    font-weight: 500;
}

.delete-item-btn {
    background-color: #e74c3c;
    width: auto;
    padding: 10px 15px;
    margin: 0;
    margin-bottom: 10px; /* Aligns with input fields */
}

.delete-item-btn:hover {
    background-color: #c0392b;
}

.document-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.document-item h4 {
    margin: 0;
    color: #2c3e50;
}

.download-btn {
    width: auto;
    margin: 0;
}

/* --------------------------------------------------------------------------
   9. Debug and Status Indicators
   -------------------------------------------------------------------------- */

.connection-status {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-success {
    background-color: #28a745;
}

.status-error {
    background-color: #dc3545;
}

.status-pending {
    background-color: #ffc107;
    animation: pulse 1.5s infinite;
}

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

.debug-info {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    font-family: monospace;
    font-size: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.debug-info h4 {
    margin-bottom: 10px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#debugContent div {
    margin-bottom: 2px;
    padding: 2px 0;
    border-bottom: 1px solid #c3e6cb;
}

/* --------------------------------------------------------------------------
   10. Utility Classes
   -------------------------------------------------------------------------- */

.hidden {
    display: none !important;
}