/**
 * Plot Manager Plugin Styles
 * RTL Support Included
 * Uses Theme CSS Variables for consistency
 */

:root {
    /* Fallback colors if theme variables not available */
    --plot-primary: var(--primary-color, #1a3a4a);
    --plot-primary-hover: var(--primary-color-hover, #2c5f6f);
    --plot-success: #2ecc71;
    --plot-danger: #e74c3c;
    --plot-whatsapp: #25D366;
}

/* ===================== */
/* Plot Card Styles */
/* ===================== */
.plot-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.plot-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.plot-card-image {
    height: 200px;
    overflow: hidden;
}

.plot-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.plot-card:hover .plot-card-image img {
    transform: scale(1.05);
}

.plot-no-image {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    color: #ccc;
    font-size: 3rem;
}

.plot-card-body {
    padding: 20px;
}

.plot-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #333;
}

.plot-card-location {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.plot-card-location i {
    color: #e74c3c;
    margin-left: 5px;
}

.plot-card-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.plot-card-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}

.plot-card-price {
    font-weight: 600;
    color: #2ecc71;
    margin-bottom: 15px;
}

.plot-card-btn {
    width: 100%;
}

/* ===================== */
/* Availability Badge */
/* ===================== */
.plot-availability-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 10;
}

.plot-availability-badge.open {
    background: rgba(46, 204, 113, 0.9);
    color: #fff;
}

.plot-availability-badge.closed {
    background: rgba(231, 76, 60, 0.9);
    color: #fff;
}

.plot-availability-badge.large {
    position: static;
    font-size: 1rem;
    padding: 8px 20px;
}

/* ===================== */
/* Plot Detail Page */
/* ===================== */
.plot-detail-page {
    background: #f8f9fa;
    min-height: 100vh;
}

.plot-detail-title {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
}

.plot-main-image-container {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.plot-main-image {
    width: 100%;
    height: auto;
    display: block;
}

.plot-no-image.large {
    padding: 100px 20px;
    text-align: center;
    background: #f5f5f5;
    border-radius: 12px;
}

.plot-no-image.large i {
    font-size: 5rem;
    color: #ddd;
}

.plot-details-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.plot-detail-item {
    margin-bottom: 15px;
    font-size: 1rem;
}

.plot-detail-item i {
    color: #e74c3c;
    margin-left: 8px;
}

.plot-description {
    margin-bottom: 20px;
}

.plot-description h4,
.plot-features h4,
.plot-price-range h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.features-list li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.features-list li:last-child {
    border-bottom: none;
}

.features-list li i {
    color: #2ecc71;
    margin-left: 8px;
}

/* Description Items List (with checkmarks) */
.description-items-list {
    list-style: none;
    padding: 0;
    margin: 15px 0 0 0;
}

.description-items-list li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
}

.description-items-list li:last-child {
    border-bottom: none;
}

.description-items-list li i {
    color: #2ecc71;
    margin-left: 10px;
    font-size: 1.2rem;
    font-weight: bold;
}

/* Stats Grid */
.plot-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.stat-box {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-box .stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

.stat-box .stat-text {
    font-size: 0.8rem;
    color: #666;
}

.stat-box.available {
    background: rgba(46, 204, 113, 0.1);
}

.stat-box.available .stat-number {
    color: #2ecc71;
}

.stat-box.sold {
    background: rgba(231, 76, 60, 0.1);
}

.stat-box.sold .stat-number {
    color: #e74c3c;
}

.price-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2ecc71;
}

/* Gallery */
.plot-gallery-section {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
}

.plot-gallery-item {
    display: block;
    border-radius: 8px;
    overflow: hidden;
}

.plot-gallery-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.plot-gallery-item:hover img {
    transform: scale(1.05);
}

/* ===================== */
/* Listing Page */
/* ===================== */
.plots-listing-page {
    background: #f8f9fa;
    min-height: 100vh;
}

.plots-page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
}

.plots-page-subtitle {
    font-size: 1.1rem;
}

/* ===================== */
/* Shortcode Widget */
/* ===================== */
.plot-shortcode-container {
    margin: 30px 0;
}

.plot-detail-widget {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: relative;
}

.plot-widget-image {
    width: 100%;
    border-radius: 8px;
}

.plot-widget-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.plot-widget-location {
    color: #666;
    margin-bottom: 15px;
}

.plot-widget-description {
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
}

.plot-widget-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
}

.plot-widget-stats .stat {
    text-align: center;
}

.plot-widget-stats .stat strong {
    display: block;
    font-size: 1.5rem;
    color: #333;
}

.plot-widget-stats .stat span {
    font-size: 0.9rem;
    color: #666;
}

/* ===================== */
/* Responsive */
/* ===================== */
@media (max-width: 768px) {
    .plot-detail-title {
        font-size: 1.5rem;
    }

    .plot-stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .stat-box .stat-number {
        font-size: 1.2rem;
    }

    .plots-page-title {
        font-size: 1.8rem;
    }
}

/* ===================== */
/* Hero Section */
/* ===================== */
.plot-hero-section {
    background: linear-gradient(135deg, var(--plot-primary) 0%, var(--plot-primary-hover) 100%);
    color: #fff;
    padding: 60px 0;
}

.plot-hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #fff;
}

.plot-hero-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 600px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .plot-hero-section {
        padding: 40px 0;
    }

    .plot-hero-title {
        font-size: 1.8rem;
    }

    .plot-hero-subtitle {
        font-size: 1rem;
    }
}

/* ===================== */
/* Contact Section */
/* ===================== */
.plot-contact-section {
    padding: 40px 0;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 40px 0;
}

.contact-card {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.contact-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #e8f4f8;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
    color: var(--plot-primary);
}

.contact-card.whatsapp .contact-icon {
    background: #e8f8e8;
    color: #25D366;
}

.contact-card.email .contact-icon {
    background: #f8e8e8;
    color: #e74c3c;
}

.contact-card h5 {
    font-size: 1rem;
    color: #666;
    margin-bottom: 10px;
}

.contact-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    display: block;
    word-break: break-all;
}

.contact-value:hover {
    color: var(--plot-primary);
}

@media (max-width: 768px) {
    .contact-card {
        padding: 20px;
    }

    .contact-icon {
        width: 50px;
        height: 50px;
        font-size: 22px;
    }
}

/* ===================== */
/* PDF Flipbook Styles */
/* ===================== */
.pdf-flipbook-container {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    position: relative;
    min-height: 400px;
}

.pdf-flipbook-container:not(.loaded) .flipbook-controls {
    display: none;
}

.flipbook-viewer {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 350px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border-radius: 8px;
    overflow: hidden;
}

.flipbook-spread {
    display: flex;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    overflow: hidden;
}

.flipbook-page {
    position: relative;
    background: #fff;
}

.flipbook-page.left-page {
    border-left: 1px solid #ccc;
    box-shadow: inset -10px 0 30px rgba(0, 0, 0, 0.1);
}

.flipbook-page.right-page {
    border-right: 1px solid #ccc;
    box-shadow: inset 10px 0 30px rgba(0, 0, 0, 0.1);
}

.flipbook-page canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.flipbook-page .page-number {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
}

.flipbook-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.flipbook-btn {
    background: var(--plot-primary);
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.flipbook-btn:hover:not(:disabled) {
    background: var(--plot-primary-hover);
    transform: translateY(-2px);
}

.flipbook-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.flipbook-page-info {
    color: #fff;
    font-size: 14px;
    min-width: 80px;
    text-align: center;
}

.flipbook-fullscreen {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.flipbook-fullscreen:hover {
    background: rgba(255, 255, 255, 0.1);
}

.flipbook-error {
    color: var(--plot-danger);
    text-align: center;
    padding: 40px;
    font-size: 18px;
}

.flipbook-loading {
    color: #fff;
    text-align: center;
    padding: 40px;
}

.flipbook-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 2px solid transparent;
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Fullscreen mode */
.pdf-flipbook-container:fullscreen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px;
}

.pdf-flipbook-container:fullscreen .flipbook-viewer {
    flex: 1;
}

.pdf-flipbook-container:fullscreen .flipbook-spread {
    max-height: 80vh;
}

.pdf-flipbook-container:fullscreen .flipbook-page canvas {
    max-height: 70vh;
    width: auto;
}

@media (max-width: 768px) {
    .flipbook-spread {
        flex-direction: column;
    }

    .flipbook-page.left-page,
    .flipbook-page.right-page {
        box-shadow: none;
        border: none;
    }

    .flipbook-controls {
        flex-wrap: wrap;
    }

    .flipbook-btn {
        padding: 10px 15px;
        font-size: 14px;
    }
}

/* ===================== */
/* Plots List Layout */
/* ===================== */
.plots-list-items {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.plot-list-item {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.plot-list-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.plot-list-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.plot-list-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

.plot-list-subtitle {
    font-size: 1rem;
    color: #666;
}

.plot-list-image {
    height: 280px;
    overflow: hidden;
}

.plot-list-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.plot-list-item:hover .plot-list-image img {
    transform: scale(1.03);
}

.plot-availability-badge.small {
    position: static;
    padding: 5px 12px;
    font-size: 0.8rem;
}

/* ===================== */
/* Latest Plot Shortcode */
/* ===================== */
.latest-plot-shortcode {
    margin: 40px 0;
}

.latest-plot-card {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.latest-plot-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.latest-plot-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--plot-primary);
}

.latest-plot-subtitle {
    font-size: 1.1rem;
}

.latest-plot-image {
    height: 400px;
    overflow: hidden;
}

.latest-plot-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 992px) {
    .plot-list-image {
        height: 220px;
    }

    .latest-plot-image {
        height: 300px;
    }

    .latest-plot-title {
        font-size: 1.6rem;
    }
}

@media (max-width: 768px) {
    .plot-list-item .row {
        flex-direction: column;
    }

    .plot-list-image {
        height: 200px;
    }

    .latest-plot-image {
        height: 250px;
    }
}