/**
 * Featured Listing Frontend CSS
 * 
 * Styles for the auto-generated featured listing pages.
 * Designed to work within Divi and standard WordPress themes.
 * 
 * @package SCP_Listings
 * @since 1.1.0
 */

/* ─── Container ─── */
.scp-featured-listing {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #333;
    line-height: 1.6;
}

/* ─── Gallery (4×2 grid) ─── */
.scp-featured-gallery {
    margin-bottom: 30px;
}

.scp-featured-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 6px;
    border-radius: 10px;
    overflow: hidden;
}

.scp-featured-thumb {
    overflow: hidden;
    position: relative;
    aspect-ratio: 4 / 3;
}

.scp-featured-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.scp-featured-thumb:hover img {
    transform: scale(1.05);
}

.scp-featured-more-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    pointer-events: none;
}

.scp-featured-thumb-tour {
    background: #1a1a2e;
}

.scp-featured-tour-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #fff;
    gap: 6px;
    padding: 10px;
    text-align: center;
}

.scp-featured-tour-placeholder .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
}

/* ─── Layout (Content + Sidebar) ─── */
.scp-featured-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 40px;
    align-items: start;
}

/* ─── Address Header ─── */
.scp-featured-address {
    margin-bottom: 20px;
}

.scp-featured-address h2 {
    font-size: 2em;
    font-weight: 700;
    margin: 0 0 4px;
    line-height: 1.2;
    color: #1a1a2e;
}

/* ─── Stats Bar ─── */
.scp-featured-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 24px;
    border: 1px solid #e9ecef;
}

.scp-featured-stat {
    display: flex;
    flex-direction: column;
    min-width: 80px;
}

.scp-featured-stat .stat-value {
    font-size: 1.2em;
    font-weight: 700;
    color: #1a1a2e;
}

.scp-featured-stat .stat-label {
    font-size: 0.8em;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scp-featured-stat-price .stat-value {
    font-size: 1.5em;
    color: #2271b1;
}

.scp-status-active {
    color: #28a745 !important;
}

.scp-status-pending,
.scp-status-pending-with-showings {
    color: #ffc107 !important;
}

.scp-status-closed {
    color: #dc3545 !important;
}

/* ─── Sections ─── */
.scp-featured-section {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e9ecef;
}

.scp-featured-section:last-child {
    border-bottom: none;
}

.scp-featured-section h3 {
    font-size: 1.2em;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.scp-featured-description p {
    font-size: 1em;
    line-height: 1.7;
    color: #444;
}

/* ─── Details Grid ─── */
.scp-featured-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

.scp-featured-detail-row {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.scp-featured-detail-row:nth-child(odd) {
    background: #fafafa;
}

.scp-featured-detail-label {
    font-weight: 600;
    color: #555;
    min-width: 140px;
    flex-shrink: 0;
}

.scp-featured-detail-value {
    color: #333;
}

/* ─── Tag Lists (features, appliances, etc) ─── */
.scp-featured-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.scp-featured-tag {
    background: #e8f4fd;
    color: #1a5276;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.9em;
    white-space: nowrap;
}

.scp-featured-tag-group {
    margin-bottom: 12px;
}

.scp-featured-tag-group:last-child {
    margin-bottom: 0;
}

.scp-tag-group-label {
    display: block;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin-bottom: 6px;
}

/* ─── Brochure Link ─── */
.scp-featured-brochure {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 16px;
}

.scp-brochure-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #2271b1;
    color: #fff !important;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none !important;
    font-weight: 600;
    transition: background 0.2s ease;
}

.scp-brochure-link:hover {
    background: #135e96;
    color: #fff !important;
}

.scp-brochure-link .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* ─── Virtual Tour ─── */
.scp-featured-virtual-tour {
    margin-top: 10px;
}

.scp-virtual-tour-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #2271b1;
    color: #fff !important;
    text-decoration: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.scp-virtual-tour-link:hover {
    background: #135e96;
    color: #fff !important;
}

.scp-virtual-tour-link .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* ─── Video Section ─── */
.scp-featured-video {
    margin-top: 10px;
}

.scp-featured-video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
}

.scp-featured-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.scp-featured-video-player {
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
    display: block;
}

/* ─── Sidebar ─── */
.scp-featured-sidebar {
    position: sticky;
    top: 80px;
}

.scp-featured-contact-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-top: 20px;
}

.scp-featured-contact-card h3 {
    margin: 0 0 4px;
    font-size: 1.2em;
    color: #1a1a2e;
}

.scp-featured-contact-subtitle {
    color: #888;
    font-size: 0.9em;
    margin: 0 0 16px;
}

/* ─── Form ─── */
.scp-featured-form .scp-form-row {
    margin-bottom: 12px;
}

.scp-featured-form .scp-form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.scp-featured-form label {
    display: block;
    font-weight: 500;
    font-size: 0.85em;
    margin-bottom: 4px;
    color: #555;
}

.scp-featured-form input[type="text"],
.scp-featured-form input[type="email"],
.scp-featured-form input[type="tel"],
.scp-featured-form input[type="url"],
.scp-featured-form select,
.scp-featured-form textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.scp-featured-form input:focus,
.scp-featured-form select:focus,
.scp-featured-form textarea:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 2px rgba(34,113,177,0.15);
}

.scp-featured-submit-btn {
    width: 100%;
    padding: 12px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.scp-featured-submit-btn:hover {
    background: #135e96;
}

.scp-form-success {
    background: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 6px;
    margin-top: 12px;
}

.scp-form-error {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 6px;
    margin-top: 12px;
}

/* ─── Map ─── */
.scp-featured-map-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.scp-featured-map-card h3 {
    margin: 0 0 10px;
    font-size: 1em;
}

.scp-featured-map-container {
    border-radius: 8px;
    overflow: hidden;
}

/* ─── Quick Facts ─── */
.scp-featured-quick-facts {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 16px 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.scp-featured-quick-facts h3 {
    margin: 0 0 10px;
    font-size: 1em;
    color: #1a1a2e;
}

.scp-featured-quick-facts ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.scp-featured-quick-facts li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9em;
}

.scp-featured-quick-facts li:last-child {
    border-bottom: none;
}

/* ─── Attribution ─── */
.scp-featured-attribution {
    margin-top: 30px;
    padding: 16px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.scp-featured-attribution p {
    font-size: 11px;
    color: #888;
    line-height: 1.5;
    margin: 0;
}

/* ─── Error ─── */
.scp-featured-error {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
    .scp-featured-layout {
        grid-template-columns: 1fr;
    }
    
    .scp-featured-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .scp-featured-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .scp-featured-stats {
        gap: 10px;
    }
    
    .scp-featured-stat .stat-value {
        font-size: 1em;
    }
    
    .scp-featured-address h2 {
        font-size: 1.5em;
    }
    
    .scp-featured-details-grid {
        grid-template-columns: 1fr;
    }
    
    .scp-featured-form .scp-form-row-2col {
        grid-template-columns: 1fr;
    }
    
    .scp-featured-tour-embed iframe {
        height: 300px !important;
    }
}

@media (max-width: 480px) {
    .scp-featured-listing {
        padding: 0 12px;
    }
    
    .scp-featured-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .scp-featured-stat-price .stat-value {
        font-size: 1.2em;
    }
}
