/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Phosphor Icons - alignment utility */
i[class*="ph"] {
    vertical-align: middle;
    font-size: 1.1em;
    line-height: 1;
}

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

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 20px 120px 20px;
    background-color: white;
    min-height: 100vh;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* Header styles */

h1 {
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
}

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 12px;
    background-color: #e0e0e0;
    border-radius: 6px;
    margin-bottom: 8px;
    overflow: hidden;
    border: 1px solid #d0d0d0;
}

.progress-fill {
    height: 100%;
    background-color: #27ae60;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 5px;
}

.progress-text {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    margin-top: 8px;
    display: block;
}

/* Unit selector */
.unit-selector {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.unit-selector label {
    font-weight: bold;
}

.unit-selector select {
    flex: 1;
    min-width: 150px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.unit-selector button {
    padding: 8px 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

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

/* Special styling for load units button */
#loadUnits {
    background-color: #27ae60;
}

#loadUnits:hover {
    background-color: #219a52;
}

/* Section styles */
.section {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fafafa;
}

.section h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #bdc3c7;
}

/* Form groups */
.form-group {
    margin-bottom: 15px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Checklist styles */
.checklist {
    display: grid;
    gap: 15px;
}

.check-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.check-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.check-item label {
    display: flex;
    align-items: center;
    flex: 1;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
}

/* Custom checkbox */
.check-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkmark {
    width: 20px;
    height: 20px;
    background-color: #eee;
    border-radius: 3px;
    margin-right: 12px;
    position: relative;
    border: 2px solid #ddd;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.check-item input[type="checkbox"]:checked + .checkmark {
    background-color: #27ae60;
    border-color: #27ae60;
}

.check-item input[type="checkbox"]:checked + .checkmark:after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.issue-input {
    display: flex;
    gap: 10px;
    align-items: center;
}

.issue-input input,
.issue-input select {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
}

.issue-input input {
    min-height: 36px;
}

/* Conditional display based on unit type */
.bedroom-optional,
.bathroom-optional {
    display: block;
}

.studio .bedroom-optional,
.studio .bathroom-optional {
    display: none;
}

/* Unit type specific styling */
.unit-type-indicator {
    display: inline-block;
    padding: 4px 8px;
    background-color: #3498db;
    color: white;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 10px;
}

/* Actions */
.actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.actions button {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

#saveUnit {
    background-color: #27ae60;
    color: white;
}

#saveUnit:hover {
    background-color: #219a52;
}

#nextUnit {
    background-color: #3498db;
    color: white;
}

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

#exportCSV {
    background-color: #f39c12;
    color: white;
}

#exportCSV:hover {
    background-color: #e67e22;
}

#importCSV {
    background-color: #9b59b6;
    color: white;
}

#importCSV:hover {
    background-color: #8e44ad;
}

#clearData {
    background-color: #e74c3c;
    color: white;
}

#clearData:hover {
    background-color: #c0392b;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px 10px 120px 10px;
    }
    
    .unit-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .unit-selector select,
    .unit-selector button {
        width: 100%;
    }
    
    .check-item {
        padding: 12px;
    }
    
    .issue-input {
        flex-direction: column;
        align-items: stretch;
    }
    
    .actions {
        grid-template-columns: 1fr;
    }
    
    .section {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 5px 5px 120px 5px;
    }
    
    .section {
        padding: 10px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .section h2 {
        font-size: 18px;
    }
    
    .check-item {
        padding: 10px;
    }
}

/* Touch-friendly enhancements */
@media (hover: none) and (pointer: coarse) {
    .check-item {
        padding: 20px;
    }
    
    .checkmark {
        width: 24px;
        height: 24px;
        margin-right: 15px;
    }
    
    .check-item input[type="checkbox"]:checked + .checkmark:after {
        left: 7px;
        top: 3px;
        width: 7px;
        height: 12px;
    }
    
    .actions button {
        padding: 15px 20px;
        font-size: 18px;
    }
    
    .issue-input input,
    .issue-input select {
        padding: 12px;
        font-size: 16px;
        min-height: 44px;
    }
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Success/error states */
.success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Access denied message */
.access-denied-message {
    margin: 20px 0;
    animation: slideIn 0.3s ease-out;
}

.alert {
    padding: 15px 20px;
    border: 1px solid transparent;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.5;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
    border-left: 4px solid #ffc107;
}

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

/* Hidden sections styling */
.form-section.access-denied {
    display: none !important;
}

/* Property card styling */
.property-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.property-card:hover {
    background-color: #f8f9fa;
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.property-name {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.property-address {
    color: #666;
    margin-bottom: 10px;
    font-size: 14px;
}

.property-stats {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #007bff;
    font-weight: 500;
}

.property-stats span {
    background-color: #e3f2fd;
    padding: 4px 8px;
    border-radius: 4px;
}
