/**
 * Property Simple Plugin Styles
 * Matches the design from the provided images
 */

/* ===========================
   Property Listing Grid
   =========================== */

.psp-properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    padding: 20px 0;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .psp-properties-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Property Card */
.psp-property-card {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.psp-property-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Property Image */
.psp-property-image {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: #f0f0f0;
}

.psp-property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.psp-property-card:hover .psp-property-image img {
    transform: scale(1.05);
}

/* Property Tag */
.psp-property-tag {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    text-transform: capitalize;
    z-index: 2;
}

.psp-tag-residential {
    background: #1e3a8a;
}

.psp-tag-commercial {
    background: #1e3a8a;
}

/* Property Content */
.psp-property-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.psp-property-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 16px 0;
    line-height: 1.3;
}

.psp-property-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #666;
    font-size: 14px;
}

.psp-property-meta svg {
    flex-shrink: 0;
    color: #1e3a8a;
}

.psp-property-excerpt {
    color: #666;
    font-size: 15px;
    line-height: 1.6;
    margin: 16px 0;
    flex-grow: 1;
}

/* View Project Button */
.psp-view-project-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    background: #1e3a8a;
    color: #ffffff;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    margin-top: auto;
    border-radius: 6px;
    transition: all 0.3s ease;
    border: 2px solid #1e3a8a;
}

.psp-view-project-btn:hover {
    background: #1e40af;
    border-color: #1e40af;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.psp-view-project-btn svg {
    transition: transform 0.3s ease;
}

.psp-view-project-btn:hover svg {
    transform: translateX(4px);
}

/* ===========================
   Property Detail Page
   =========================== */

.psp-property-detail {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

/* Hero Image */
.psp-detail-hero {
    width: 100%;
    height: 500px;
    overflow: hidden;
    margin-bottom: 40px;
}

.psp-detail-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .psp-detail-hero {
        height: 300px;
    }
}

/* Detail Header */
.psp-detail-header {
    padding: 0 40px;
    margin-bottom: 50px;
}

.psp-detail-title-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.psp-detail-title-row h1 {
    font-size: 36px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

@media (max-width: 768px) {
    .psp-detail-header {
        padding: 0 20px;
    }
    
    .psp-detail-title-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .psp-detail-title-row h1 {
        font-size: 28px;
    }
}

/* Info Cards */
.psp-detail-info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.psp-info-card {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.psp-info-card svg {
    flex-shrink: 0;
    color: #1e3a8a;
    margin-top: 2px;
}

.psp-info-card .label {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 4px;
    font-weight: 500;
}

.psp-info-card .value {
    font-size: 16px;
    color: #1a1a1a;
    font-weight: 600;
}

@media (max-width: 768px) {
    .psp-detail-info-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Content Layout */
.psp-detail-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    padding: 0 40px;
    margin-bottom: 50px;
}

@media (max-width: 1024px) {
    .psp-detail-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .psp-detail-content {
        padding: 0 20px;
    }
}

/* Sections */
.psp-section {
    margin-bottom: 40px;
}

.psp-section h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 24px 0;
}

.psp-section p {
    font-size: 16px;
    line-height: 1.7;
    color: #4b5563;
}

/* Project Overview */
.psp-overview p {
    margin-bottom: 16px;
}

/* Scope of Work */
.psp-scope-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.psp-scope-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    font-size: 15px;
    color: #4b5563;
    line-height: 1.6;
}

.psp-scope-list li svg {
    flex-shrink: 0;
    color: #1e3a8a;
    margin-top: 2px;
}

/* Challenges & Solutions */
.psp-challenges-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.psp-challenge-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 24px;
    background: #f8fafc;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .psp-challenge-item {
        grid-template-columns: 1fr;
    }
}

.psp-challenge,
.psp-solution {
    display: flex;
    flex-direction: column;
}

.psp-challenge h4,
.psp-solution h4 {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px 0;
}

.psp-challenge p,
.psp-solution p {
    font-size: 15px;
    line-height: 1.6;
    color: #4b5563;
    margin: 0;
}

/* Project Gallery */
.psp-gallery {
    padding: 0 40px;
}

@media (max-width: 768px) {
    .psp-gallery {
        padding: 0 20px;
    }
}

.psp-gallery-slider {
    width: 100%;
}

/* Main Gallery */
.psp-gallery-main {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    background: #f0f0f0;
    margin-bottom: 16px;
}

.psp-gallery-track {
    display: flex;
    transition: transform 0.5s ease;
}

.psp-gallery-slide {
    min-width: 100%;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.psp-gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .psp-gallery-slide {
        height: 350px;
    }
}

/* Gallery Navigation Buttons */
.psp-gallery-prev,
.psp-gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.psp-gallery-prev:hover,
.psp-gallery-next:hover {
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.psp-gallery-prev {
    left: 16px;
}

.psp-gallery-next {
    right: 16px;
}

.psp-gallery-prev svg,
.psp-gallery-next svg {
    color: #1e3a8a;
}

/* Thumbnail Slider */
.psp-gallery-thumbnails {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px;
}

.psp-thumbnails-container {
    flex: 1;
    overflow: hidden;
    border-radius: 8px;
}

.psp-thumbnails-track {
    display: flex;
    gap: 12px;
    transition: transform 0.3s ease;
}

.psp-thumbnail-item {
    flex-shrink: 0;
    width: 120px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.psp-thumbnail-item:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

.psp-thumbnail-item.active {
    border-color: #1e3a8a;
    opacity: 1;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.3);
}

.psp-thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 768px) {
    .psp-thumbnail-item {
        width: 80px;
        height: 60px;
    }
}

/* Thumbnail Navigation */
.psp-thumb-prev,
.psp-thumb-next {
    flex-shrink: 0;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.psp-thumb-prev:hover,
.psp-thumb-next:hover {
    background: #ffffff;
    border-color: #1e3a8a;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.2);
}

.psp-thumb-prev:disabled,
.psp-thumb-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.psp-thumb-prev svg,
.psp-thumb-next svg {
    color: #1e3a8a;
}

/* Loading States */
.psp-loading {
    text-align: center;
    padding: 40px;
    color: #64748b;
}

.psp-loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
}

/* Utility Classes */
.psp-text-center {
    text-align: center;
}

.psp-mb-20 {
    margin-bottom: 20px;
}

.psp-mb-40 {
    margin-bottom: 40px;
}

/* Admin Styles */
.form-table .scope-item,
.form-table .challenge-item {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Overlay for Detail View */
.psp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: none;
    overflow-y: auto;
    padding: 20px;
}

.psp-modal-overlay.active {
    display: block;
}

.psp-modal-content {
    background: #ffffff;
    max-width: 1400px;
    margin: 0 auto;
    border-radius: 12px;
    position: relative;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.psp-modal-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #1a1a1a;
    z-index: 10000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, background 0.3s ease;
}

.psp-modal-close:hover {
    transform: scale(1.1);
    background: #f0f0f0;
}

/* Print Styles */
@media print {
    .psp-gallery-prev,
    .psp-gallery-next,
    .psp-gallery-dots,
    .psp-modal-close {
        display: none;
    }
}
