/**
 * Maintenance Request Management - Stylesheet
 */

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

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --urgent-color: #dc2626;
    --background: #f8fafc;
    --card-background: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Prevent text size adjustment on iOS */
body {
    -webkit-text-size-adjust: 100%;
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 32px;
    width: 100%;
    max-width: 480px;
    border: 1px solid var(--border-color);
}

.auth-card h1 {
    color: var(--primary-color);
    margin-bottom: 8px;
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.auth-card h2 {
    color: var(--text-primary);
    margin-bottom: 24px;
    text-align: center;
    font-weight: 500;
    font-size: 16px;
    color: var(--text-secondary);
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.01em;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background-color: #ffffff;
    color: var(--text-primary);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #94a3b8;
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
    background-color: #ffffff;
}

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

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    letter-spacing: 0.01em;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #475569;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 13px;
}

.auth-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.auth-link a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.error-message {
    display: none;
    color: var(--error-color);
    background-color: #fef2f2;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid #fecaca;
    font-size: 13px;
    line-height: 1.4;
}

.error-message.show {
    display: block;
}

.success-message {
    color: var(--success-color);
    background-color: #f0fdf4;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid #bbf7d0;
    font-size: 13px;
    line-height: 1.4;
}

/* Dashboard */
.dashboard-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.dashboard-header {
    background: var(--card-background);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-header h1 {
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-actions span {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
}

.dashboard-main {
    flex: 1;
    padding: 24px 32px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.property-info {
    background: var(--card-background);
    padding: 20px 24px;
    border-radius: 10px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.property-info h2 {
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.property-info p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.requests-section h2 {
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.loading {
    text-align: center;
    padding: 32px;
    color: var(--text-secondary);
    font-size: 13px;
}

.no-requests {
    text-align: center;
    padding: 32px;
    color: var(--text-secondary);
    background: var(--card-background);
    border-radius: 10px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color);
    font-size: 13px;
}

/* Requests Table */
.requests-table {
    width: 100%;
    background: var(--card-background);
    border-radius: 10px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    overflow: hidden;
    border-collapse: collapse;
    border: 1px solid var(--border-color);
}

.requests-table thead {
    background-color: var(--card-background);
}

.requests-table th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.requests-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.requests-table tbody tr:hover {
    background-color: var(--background);
}

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

.priority-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
    letter-spacing: 0.02em;
}

.priority-low {
    background-color: #dbeafe;
    color: #1e40af;
}

.priority-medium {
    background-color: #fef3c7;
    color: #92400e;
}

.priority-high {
    background-color: #fed7aa;
    color: #9a3412;
}

.priority-urgent {
    background-color: #fee2e2;
    color: #991b1b;
}

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

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    color: var(--text-secondary);
}

.btn-icon:hover {
    background-color: var(--background);
}

.btn-icon:active {
    background-color: var(--border-color);
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1000;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    font-weight: 300;
}

.fab:hover {
    background-color: var(--primary-hover);
    transform: scale(1.1);
}

.fab:active {
    transform: scale(0.95);
}

.fab span {
    line-height: 1;
}

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

.modal-content {
    background: var(--card-background);
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
}

.modal-content h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.modal-content p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-buttons .btn {
    width: auto;
    flex: 1;
}

/* Mobile Card View for Requests */
.requests-cards {
    display: none;
}

.request-card {
    background: var(--card-background);
    border-radius: 10px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    padding: 16px;
    margin-bottom: 12px;
    border-left: 3px solid var(--border-color);
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
}

.request-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.request-card.priority-low {
    border-left-color: #3b82f6;
}

.request-card.priority-medium {
    border-left-color: #f59e0b;
}

.request-card.priority-high {
    border-left-color: #f97316;
}

.request-card.priority-urgent {
    border-left-color: #dc2626;
}

.request-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.request-card-number {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.request-card-date {
    font-size: 11px;
    color: var(--text-secondary);
}

.request-card-body {
    margin-bottom: 12px;
}

.request-card-field {
    margin-bottom: 10px;
    font-size: 13px;
    line-height: 1.5;
}

.request-card-field-label {
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.request-card-field-value {
    color: var(--text-secondary);
    display: block;
    word-wrap: break-word;
    font-size: 13px;
}

.request-card-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.request-card-actions .btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 13px;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 12px 16px;
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .dashboard-header h1 {
        font-size: 16px;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .header-actions .btn {
        width: auto;
        min-width: 80px;
        padding: 10px 16px;
        font-size: 14px;
    }

    .dashboard-main {
        padding: 16px;
    }

    .property-info {
        padding: 16px;
        margin-bottom: 16px;
    }

    .property-info h2 {
        font-size: 15px;
        word-break: break-word;
    }

    .property-info p {
        font-size: 12px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    /* Hide table on mobile, show cards */
    .device-mobile .requests-table {
        display: none !important;
    }

    .device-mobile .requests-cards {
        display: block !important;
    }

    /* Desktop table adjustments for tablets */
    .requests-table {
        font-size: 12px;
    }

    .requests-table th,
    .requests-table td {
        padding: 8px 10px;
    }

    .requests-table th:nth-child(3),
    .requests-table td:nth-child(3),
    .requests-table th:nth-child(6),
    .requests-table td:nth-child(6),
    .requests-table th:nth-child(7),
    .requests-table td:nth-child(7) {
        display: none;
    }

    .fab {
        bottom: 20px;
        right: 20px;
        width: 52px;
        height: 52px;
        font-size: 26px;
    }

    .modal {
        padding: 10px;
        align-items: flex-end;
    }

    .modal-content {
        max-height: 95vh;
        padding: 20px;
        border-radius: 16px 16px 0 0;
        width: 100%;
        max-width: 100%;
    }

    .modal-content h2 {
        font-size: 16px;
        margin-bottom: 16px;
    }

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

    .form-group label {
        font-size: 12px;
        margin-bottom: 5px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 14px;
        padding: 10px 12px;
    }

    .modal-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .modal-buttons .btn {
        width: 100%;
    }

    .auth-card {
        padding: 24px 20px;
        margin: 10px;
    }

    .auth-card h1 {
        font-size: 20px;
    }

    .auth-card h2 {
        font-size: 15px;
        margin-bottom: 20px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .btn-icon,
    .fab {
        min-height: 44px;
        min-width: 44px;
    }

    .btn-icon {
        padding: 8px 12px;
    }

    .request-card {
        padding: 20px;
    }

    .request-card-actions .btn {
        min-height: 44px;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .dashboard-main {
        padding: 12px;
    }

    .property-info {
        padding: 16px;
    }

    .request-card {
        padding: 16px;
    }

    .request-card-field-label {
        font-size: 11px;
    }

    .request-card-field-value {
        font-size: 12px;
    }
}

