/* Plot Manager Pro - Frontend Styles */

.pmp-frontend-table-wrap {
    margin: 30px 0;
    overflow-x: auto;
}

.pmp-frontend-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #dee2e6;
}

.pmp-frontend-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.pmp-frontend-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    user-select: none;
}

.pmp-frontend-table th:hover {
    background: #e9ecef;
}

.pmp-frontend-table th.pmp-no-sort {
    cursor: default;
}

.pmp-frontend-table th.pmp-no-sort:hover {
    background: #f8f9fa;
}

.pmp-frontend-table tbody tr {
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.2s;
}

.pmp-frontend-table tbody tr:hover {
    background: #f8f9fa;
}

.pmp-frontend-table td {
    padding: 12px 15px;
    font-size: 14px;
    color: #212529;
    border: 1px solid #dee2e6;
}

.pmp-frontend-table th {
    border: 1px solid #dee2e6;
}

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

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

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

.pmp-status-not-released {
    background: #e2e3e5;
    color: #383d41;
}

/* Expand/Collapse */
.pmp-toggle-expand {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #0073aa;
    transition: transform 0.3s;
}

.pmp-toggle-expand:hover {
    color: #005177;
}

.pmp-toggle-expand .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.pmp-toggle-expand.expanded {
    transform: rotate(180deg);
}

/* Expanded row */
.pmp-expanded-row {
    border-bottom: 2px solid #007cba !important;
}

.pmp-expanded-row td {
    padding: 20px !important;
    background: #f8f9fa;
}

.pmp-expanded-content {
    max-width: 1000px;
    margin: 0 auto;
}

.pmp-expanded-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #212529;
    font-size: 18px;
}

/* Edit form */
.pmp-edit-form {
    background: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pmp-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.pmp-form-field {
    display: flex;
    flex-direction: column;
}

.pmp-form-field label {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 13px;
    color: #495057;
}

.pmp-form-field input,
.pmp-form-field select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.pmp-form-field input:focus,
.pmp-form-field select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0,124,186,0.1);
}

.pmp-form-section {
    margin-bottom: 20px;
}

.pmp-form-section h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    color: #212529;
}

.pmp-incentives-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.pmp-incentives-grid label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.pmp-incentives-grid input[type="checkbox"] {
    margin-right: 8px;
}

/* Form actions */
.pmp-form-actions {
    display: flex;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.pmp-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.pmp-btn-primary {
    background: #007cba;
    color: #fff;
}

.pmp-btn-primary:hover {
    background: #005177;
}

.pmp-btn-secondary {
    background: #f1f1f1;
    color: #212529;
}

.pmp-btn-secondary:hover {
    background: #ddd;
}

/* No plots message */
.pmp-no-plots {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-size: 16px;
}

.pmp-error {
    color: #dc3545;
    padding: 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

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

.pmp-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: pmp-spin 1s linear infinite;
}

@keyframes pmp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media screen and (max-width: 768px) {
    .pmp-frontend-table-wrap {
        overflow-x: auto;
    }
    
    .pmp-frontend-table {
        font-size: 12px;
    }
    
    .pmp-frontend-table th,
    .pmp-frontend-table td {
        padding: 8px 10px;
    }
    
    .pmp-form-grid {
        grid-template-columns: 1fr;
    }
    
    .pmp-incentives-grid {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 600px) {
    /* Hide less important columns on mobile */
    .pmp-frontend-table th:nth-child(3),
    .pmp-frontend-table td:nth-child(3),
    .pmp-frontend-table th:nth-child(7),
    .pmp-frontend-table td:nth-child(7) {
        display: none;
    }
}

/* Inline editing styles */
.pmp-plot-row [contenteditable="true"] {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    padding: 0;
    margin: 0;
    transition: background-color 0.2s;
}

.pmp-plot-row [contenteditable="true"]:hover {
    background-color: rgba(255, 243, 205, 0.3);
}

.pmp-plot-row [contenteditable="true"]:focus {
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 0 2px rgba(0, 124, 186, 0.5);
}

.pmp-row-changed {
    background-color: #fff3cd;
}

.pmp-save-inline {
    background: #007cba;
    color: white;
    border: none;
    padding: 4px 6px;
    border-radius: 3px;
    cursor: pointer;
    margin-right: 5px;
    font-size: 12px;
}

.pmp-save-inline:hover {
    background: #005a87;
}

.pmp-status-select {
    width: 100%;
    padding: 2px 4px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
}

.pmp-status-select:focus {
    outline: none;
    border-color: #007cba;
}

/* Plot ID column - fit to title width */
.pmp-frontend-table th[data-sort="plot_id"],
.pmp-frontend-table td.pmp-plot-id {
    width: 80px;
    padding: 4px 8px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Plot Number column - fit to title width */
.pmp-frontend-table th[data-sort="plot_number"],
.pmp-frontend-table td.pmp-plot-number {
    width: 60px;
    padding: 4px 8px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Center numeric columns */
.pmp-frontend-table th[data-sort="beds"],
.pmp-frontend-table td.pmp-beds,
.pmp-frontend-table th[data-sort="sqft"],
.pmp-frontend-table td.pmp-sqft,
.pmp-frontend-table th[data-sort="latest_list_price"],
.pmp-frontend-table td.pmp-price,
.pmp-frontend-table th[data-sort="price_sqft"],
.pmp-frontend-table td.pmp-price-sqft {
    text-align: center;
}

/* Print styles */
@media print {
    .pmp-toggle-expand,
    .pmp-form-actions {
        display: none !important;
    }
    
    .pmp-expanded-row {
        display: none !important;
    }
}
