/**
 * Real Estate WooCommerce System — Customer Frontend Styles
 */

/* ────────────────────────────────────────────
   Wrapper
   ──────────────────────────────────────────── */
.rews-property-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #333;
}

.rews-property-form-wrapper h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #1a1a2e;
}

.rews-form-subtitle {
    color: #666;
    margin-bottom: 24px;
    font-size: 14px;
}

/* ────────────────────────────────────────────
   Alerts
   ──────────────────────────────────────────── */
.rews-alert {
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.rews-alert--success {
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    color: #065f46;
}

.rews-alert--error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.rews-alert--info {
    background: #eff6ff;
    border: 1px solid #93c5fd;
    color: #1e40af;
}

/* ────────────────────────────────────────────
   Fieldsets & Legends
   ──────────────────────────────────────────── */
.rews-fieldset {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    background: #fff;
}

.rews-legend {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    padding: 0 8px;
}

/* ────────────────────────────────────────────
   Form Grid
   ──────────────────────────────────────────── */
.rews-form-row {
    margin-bottom: 16px;
}

.rews-form-row--full {
    grid-column: 1 / -1;
}

.rews-fieldset {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
}

.rews-form-row--half {
    grid-column: span 1;
}

.rews-form-row--third {
    grid-column: span 1;
}

@media (min-width: 600px) {
    .rews-fieldset {
        grid-template-columns: 1fr 1fr 1fr;
    }
    .rews-form-row--third {
        grid-column: span 1;
    }
    .rews-form-row--half {
        grid-column: span 1;
    }
}

/* ────────────────────────────────────────────
   Labels
   ──────────────────────────────────────────── */
.rews-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
}

.rews-required {
    color: #ef4444;
    margin-left: 2px;
}

/* ────────────────────────────────────────────
   Inputs
   ──────────────────────────────────────────── */
.rews-input,
.rews-select,
.rews-textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #1f2937;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

.rews-input:focus,
.rews-select:focus,
.rews-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.rews-input::placeholder,
.rews-textarea::placeholder {
    color: #9ca3af;
}

.rews-textarea {
    resize: vertical;
    min-height: 80px;
}

.rews-textarea--small {
    min-height: 60px;
}

/* ────────────────────────────────────────────
   File Upload
   ──────────────────────────────────────────── */
.rews-file-input {
    display: block;
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border: 2px dashed #d1d5db;
    border-radius: 6px;
    background: #f9fafb;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    box-sizing: border-box;
}

.rews-file-input:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.rews-help-text {
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
}

/* ────────────────────────────────────────────
   Image Previews
   ──────────────────────────────────────────── */
.rews-cover-preview {
    margin-top: 12px;
}

.rews-preview-img {
    max-width: 300px;
    max-height: 200px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    object-fit: cover;
}

.rews-gallery-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.rews-gallery-preview .rews-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.rews-gallery-preview .rews-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rews-gallery-preview .rews-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ────────────────────────────────────────────
   Actions
   ──────────────────────────────────────────── */
.rews-form-actions {
    text-align: center;
    margin-top: 8px;
}

.rews-btn {
    display: inline-block;
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    text-align: center;
}

.rews-btn:active {
    transform: scale(0.98);
}

.rews-btn--primary {
    background: #2563eb;
    color: #fff;
}

.rews-btn--primary:hover {
    background: #1d4ed8;
}

.rews-submit-note {
    font-size: 12px;
    color: #6b7280;
    margin-top: 10px;
}

/* ────────────────────────────────────────────
   Responsive
   ──────────────────────────────────────────── */
@media (max-width: 480px) {
    .rews-property-form-wrapper {
        padding: 12px;
    }

    .rews-fieldset {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .rews-form-row--half,
    .rews-form-row--third {
        grid-column: 1 / -1;
    }

    .rews-btn {
        width: 100%;
    }
}

/* ════════════════════════════════════════════
   PHASE 2 — Dashboard
   ════════════════════════════════════════════ */

.rews-dashboard {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #333;
}

.rews-dashboard-header {
    margin-bottom: 28px;
}

.rews-dashboard-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 6px;
}

.rews-dashboard-subtitle {
    color: #666;
    font-size: 14px;
}

.rews-dashboard-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-size: 15px;
}

/* ── Stats Grid ─────────────────────────── */

.rews-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

@media (min-width: 600px) {
    .rews-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .rews-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.rews-stat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px 16px;
    text-align: center;
    transition: box-shadow 0.15s ease;
}

.rews-stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.rews-stat-number {
    display: block;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 6px;
}

.rews-stat-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Stat accent colors */
.rews-stat-card--total .rews-stat-number { color: #1e293b; }
.rews-stat-card--published .rews-stat-number { color: #059669; }
.rews-stat-card--pending .rews-stat-number { color: #d97706; }
.rews-stat-card--draft .rews-stat-number { color: #6366f1; }
.rews-stat-card--trashed .rews-stat-number { color: #ef4444; }
.rews-stat-card--featured .rews-stat-number { color: #ec4899; }

/* ════════════════════════════════════════════
   PHASE 2 — Property List Table
   ════════════════════════════════════════════ */

.rews-property-list-wrapper {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #333;
}

.rews-list-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 20px;
}

/* ── Table ───────────────────────────────── */

.rews-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.rews-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    font-size: 14px;
}

.rews-table thead {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.rews-table th {
    padding: 12px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.rews-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: #334155;
}

.rews-table tbody tr:hover {
    background: #f8fafc;
}

.rews-table tbody tr:last-child td {
    border-bottom: none;
}

/* Column widths */
.rews-col-image { width: 70px; }
.rews-col-title { }
.rews-col-type { width: 110px; }
.rews-col-listing { width: 110px; }
.rews-col-status { width: 120px; }
.rews-col-date { width: 110px; }
.rews-col-actions { width: 140px; }

/* ── Thumbnail ───────────────────────────── */

.rews-table-thumb {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    object-fit: cover;
    display: block;
    border: 1px solid #e2e8f0;
}

.rews-table-thumb--placeholder {
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #94a3b8;
}

/* ── Badges ──────────────────────────────── */

.rews-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.rews-badge--published {
    background: #ecfdf5;
    color: #065f46;
}

.rews-badge--pending {
    background: #fffbeb;
    color: #92400e;
}

.rews-badge--draft {
    background: #eef2ff;
    color: #4338ca;
}

.rews-badge--trashed {
    background: #fef2f2;
    color: #991b1b;
}

/* ── Action Links ────────────────────────── */

.rews-actions-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.rews-action-link {
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 5px;
    transition: background 0.12s ease;
    cursor: pointer;
}

.rews-action-link--view {
    color: #2563eb;
    background: #eff6ff;
}

.rews-action-link--view:hover {
    background: #dbeafe;
}

.rews-action-link--edit {
    color: #059669;
    background: #ecfdf5;
}

.rews-action-link--edit:hover {
    background: #d1fae5;
}

.rews-action-link--delete {
    color: #dc2626;
    background: #fef2f2;
}

.rews-action-link--delete:hover {
    background: #fee2e2;
}

.rews-action-link--disabled {
    opacity: 0.45;
    text-decoration: line-through;
    cursor: not-allowed;
}

/* ── Responsive Table ────────────────────── */

@media (max-width: 768px) {
    .rews-table thead {
        display: none;
    }

    .rews-table,
    .rews-table tbody,
    .rews-table tr,
    .rews-table td {
        display: block;
    }

    .rews-table tr {
        margin-bottom: 16px;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 8px;
        background: #fff;
    }

    .rews-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 10px;
        border-bottom: 1px solid #f1f5f9;
        text-align: right;
    }

    .rews-table td:last-child {
        border-bottom: none;
    }

    .rews-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 11px;
        color: #64748b;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        text-align: left;
        flex-shrink: 0;
        margin-right: 12px;
    }

    .rews-col-image { width: auto; }
    .rews-col-title { width: auto; }
    .rews-col-type { width: auto; }
    .rews-col-listing { width: auto; }
    .rews-col-status { width: auto; }
    .rews-col-date { width: auto; }
    .rews-col-actions { width: auto; }
}

/* ── Dashboard Quick Actions ─────────────── */

.rews-dashboard-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.rews-btn--outline {
    background: #fff;
    color: #2563eb;
    border: 1px solid #2563eb;
}

.rews-btn--outline:hover {
    background: #eff6ff;
}

.rews-btn--small {
    padding: 8px 18px;
    font-size: 13px;
}
