/* =====================================================
   HOMEOWNER/RENTER MODULE STYLING
   ===================================================== */

/* Homeowner signin and verification */
.homeowner-signin,
.verification-section {
    max-width: 500px;
    margin: 0 auto;
    padding: var(--space-lg);
}

.signin-card,
.verification-card {
    background: white;
    border-radius: 12px;
    padding: var(--space-xl);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.signin-card h3,
.verification-card h3 {
    color: var(--primary-color);
    margin-bottom: var(--space-md);
    font-size: 1.5rem;
}

.signin-card p,
.verification-card p {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

/* Homeowner portal */
.homeowner-portal {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-lg);
}

.portal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: var(--space-lg);
    border-radius: 12px;
    margin-bottom: var(--space-xl);
}

.portal-title h3 {
    margin: 0;
    font-size: 1.5rem;
}

/* [Windsurf AI Update] Fixed logout button visibility with proper styling */
.logout-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

.logout-btn:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.logout-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

/* Portal sections */
.portal-section {
    background: white;
    border-radius: 12px;
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.portal-section h4 {
    color: var(--primary-color);
    margin-bottom: var(--space-lg);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Service request card */
.service-request-card,
.profile-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: var(--space-lg);
    border: 1px solid #e9ecef;
}

/* Photo upload areas */
.photo-upload-area {
    border: 2px dashed #ced4da;
    border-radius: 8px;
    padding: var(--space-xl);
    text-align: center;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: var(--space-md);
}

.photo-upload-area:hover {
    border-color: var(--primary-color);
    background: #f0f4ff;
}

.photo-upload-area.drag-over {
    border-color: var(--primary-color);
    background: #e3f2fd;
    transform: scale(1.02);
}

.upload-placeholder {
    color: var(--text-secondary);
    font-size: 1rem;
}

.upload-placeholder span {
    display: block;
    margin-bottom: var(--space-sm);
}

/* Photo preview */
.photo-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-md);
}

.photo-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.remove-photo {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.remove-photo:hover {
    background: rgba(255, 0, 0, 1);
}

/* Category dropdown */
.category-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.category-option {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f4;
    transition: background 0.2s ease;
}

.category-option:hover,
.category-option.selected {
    background: #f0f4ff;
    color: var(--primary-color);
}

.category-option:last-child {
    border-bottom: none;
}

/* Button configuration */
.button-config-section {
    margin-bottom: var(--space-lg);
}

.existing-buttons {
    margin-bottom: var(--space-lg);
}

.service-button-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    transition: all 0.2s ease;
}

.service-button-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.button-info h6 {
    margin: 0 0 4px 0;
    color: var(--primary-color);
    font-size: 1rem;
}

.button-info p {
    margin: 0 0 4px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.button-info small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.button-actions {
    display: flex;
    gap: var(--space-sm);
}

.no-buttons {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: var(--space-lg);
}

.button-config-form {
    background: #f8f9fa;
    border-radius: 8px;
    padding: var(--space-lg);
    margin-top: var(--space-lg);
    border: 1px solid #e9ecef;
}

.button-config-form h5 {
    color: var(--primary-color);
    margin-bottom: var(--space-lg);
    font-size: 1.1rem;
}

/* Service requests table */
.requests-table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.requests-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.requests-table th,
.requests-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.requests-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.requests-table tr:last-child td {
    border-bottom: none;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-disabled {
    background: #f8d7da;
    color: #721c24;
}

.status-completed {
    background: #d1ecf1;
    color: #0c5460;
}

.status-cancelled {
    background: #f5c6cb;
    color: #721c24;
}

/* Small buttons */
.btn-small {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 4px;
    border: 1px solid #ced4da;
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 4px;
}

.btn-small:hover {
    background: #f8f9fa;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Professional disable button - match export/refresh style */
.btn-small.btn-danger,
.btn-disable {
    padding: 8px 14px;
    font-size: 0.85rem;
    border-radius: 8px;
    border: 2px solid #e1e5e9;
    background: white;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.btn-small.btn-danger:hover,
.btn-disable:hover {
    border-color: #6c757d;
    background: #6c757d;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.2);
}

.no-data-message {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-secondary);
    font-style: italic;
}

/* Form styling specific to homeowner module */
.homeowner-portal .form-group {
    position: relative;
    margin-bottom: var(--space-lg);
}

.homeowner-portal .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.homeowner-portal .form-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
    margin-top: var(--space-lg);
}

/* Status messages for homeowner module */
.homeowner-portal .status-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-top: var(--space-md);
    font-weight: 500;
}

.homeowner-portal .status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.homeowner-portal .status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* =====================================================
   HOMEOWNER MODULE RESPONSIVE DESIGN
   ===================================================== */

@media (max-width: 768px) {
    .homeowner-portal {
        padding: var(--space-md);
    }
    
    .portal-header {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
    
    .portal-section {
        padding: var(--space-lg);
        margin-bottom: var(--space-lg);
    }
    
    .service-button-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }
    
    .button-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .photo-preview {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .photo-item img {
        height: 100px;
    }
    
    .requests-table-container {
        font-size: 0.9rem;
    }
    
    .requests-table th,
    .requests-table td {
        padding: 8px 12px;
    }
    
    .homeowner-portal .form-row {
        grid-template-columns: 1fr;
    }
    
    .homeowner-portal .form-actions {
        flex-direction: column;
    }
    
    .btn-small {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
}

@media (max-width: 480px) {
    .signin-card,
    .verification-card {
        padding: var(--space-lg);
    }
    
    .portal-section {
        padding: var(--space-md);
    }
    
    .photo-upload-area {
        padding: var(--space-lg);
    }
    
    .photo-preview {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: var(--space-sm);
    }
    
    .photo-item img {
        height: 80px;
    }
    
    .service-button-item {
        padding: var(--space-sm);
    }
    
    .button-actions {
        flex-wrap: wrap;
        gap: var(--space-xs);
    }
    
    .btn-small {
        flex: 1;
        min-width: 60px;
    }
}

/* =====================================================
   JOB MANAGEMENT ENHANCEMENTS
   ===================================================== */

/* Enhanced service requests table */
.requests-table tr.disabled-row {
    opacity: 0.6;
    background: #f8f9fa;
}

.requests-table tr.disabled-row:hover {
    background: #e9ecef;
}

.request-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.request-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

.date-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.date-info small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.action-buttons {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* Modern professional action buttons - match export/refresh style */
.btn-view {
    padding: 8px 14px;
    font-size: 0.85rem;
    border-radius: 8px;
    border: 2px solid #e1e5e9;
    background: white;
    color: #4A90E2;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.btn-view:hover {
    border-color: #4A90E2;
    background: #4A90E2;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.2);
}

.btn-edit {
    background: #ffc107;
    color: #212529;
    border-color: #ffc107;
}

.btn-edit:hover {
    background: #e0a800;
    border-color: #d39e00;
    color: #212529;
}

.btn-success {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.btn-success:hover {
    background: #218838;
    border-color: #1e7e34;
    color: white;
}

/* Additional status badges */
.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-in-progress {
    background: #cce5ff;
    color: #004085;
}

/* Modal styling */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(3px);
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.modal-header {
    padding: var(--space-lg);
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.close-modal {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.modal-body {
    padding: var(--space-lg);
}

.modal-footer {
    padding: var(--space-lg);
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

/* Request details modal */
.request-details-grid {
    display: grid;
    gap: var(--space-xl);
}

.detail-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: var(--space-lg);
    border: 1px solid #e9ecef;
}

.detail-section h4 {
    color: var(--primary-color);
    margin-bottom: var(--space-md);
    font-size: 1.1rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
}

.detail-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    align-items: start;
}

.detail-item:last-child {
    margin-bottom: 0;
}

.detail-item label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.detail-item span {
    color: var(--text-secondary);
}

.description-text {
    background: white;
    padding: var(--space-md);
    border-radius: 6px;
    border: 1px solid #dee2e6;
    line-height: 1.5;
    white-space: pre-wrap;
}

.no-photos {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: var(--space-lg);
}

/* Modal photo grid */
.modal-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--space-md);
}

.modal-photo-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.modal-photo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal-photo-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.modal-photo-item img:hover {
    opacity: 0.9;
}

.photo-info {
    padding: 8px;
    text-align: center;
}

.photo-info small {
    color: var(--text-muted);
    font-size: 0.75rem;
    word-break: break-word;
}

/* Full photo modal */
.photo-modal {
    background: rgba(0, 0, 0, 0.9);
}

.photo-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.full-photo {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.photo-modal .close-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    z-index: 10001;
}

/* Existing photo styling */
.existing-photo {
    position: relative;
}

.existing-photo .photo-label {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(0, 123, 255, 0.9);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
}

/* =====================================================
   JOB MANAGEMENT RESPONSIVE DESIGN
   ===================================================== */

@media (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
        gap: 4px;
    }
    
    .btn-small {
        width: 100%;
        text-align: center;
    }
    
    .detail-item {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .detail-item label {
        font-weight: 700;
        color: var(--primary-color);
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .modal-photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: var(--space-sm);
    }
    
    .modal-photo-item img {
        height: 100px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .requests-table {
        font-size: 0.85rem;
    }
    
    .request-title {
        font-size: 0.9rem;
    }
    
    .request-description {
        font-size: 0.8rem;
    }
    
    .modal-header {
        padding: var(--space-md);
    }
    
    .modal-header h3 {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: var(--space-md);
    }
    
    .detail-section {
        padding: var(--space-md);
    }
    
    .modal-photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .modal-photo-item img {
        height: 80px;
    }
}
