/**
 * Kit Home Floor Plans - Frontend Styles
 * Modern, responsive styling similar to Imagine Kit Homes
 */

/* ==========================================================================
   Container & Layout
   ========================================================================== */

.khfp-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   Categories Grid
   ========================================================================== */

.khfp-categories-grid {
    display: grid;
    gap: 30px;
    margin: 40px 0;
}

.khfp-categories-grid.khfp-columns-2 {
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
}

.khfp-categories-grid.khfp-columns-3 {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.khfp-categories-grid.khfp-columns-4 {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.khfp-category-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.khfp-category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.khfp-category-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.khfp-category-image {
    position: relative;
    padding-top: 66.67%; /* 3:2 aspect ratio */
    overflow: hidden;
}

.khfp-category-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.khfp-category-card:hover .khfp-category-image img {
    transform: scale(1.1);
}

.khfp-category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.7) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.khfp-category-card:hover .khfp-category-overlay {
    opacity: 1;
}

.khfp-view-plans {
    color: #ffffff;
    font-weight: 600;
    padding: 12px 24px;
    background-color: #27ae60;
    border-radius: 50px;
    margin-bottom: 20px;
    display: inline-block;
}

.khfp-category-content {
    padding: 24px;
}

.khfp-category-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #2c3e50;
}

.khfp-category-count {
    color: #3498db;
    font-weight: 600;
    margin: 0 0 12px 0;
    font-size: 0.95rem;
}

.khfp-category-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* ==========================================================================
   Featured/Most Popular Section
   ========================================================================== */

.khfp-featured-section {
    margin-bottom: 60px;
}

.khfp-section-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 30px 0;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

.khfp-section-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #27ae60);
    border-radius: 2px;
}

.khfp-featured-grid {
    margin-top: 30px;
}

.khfp-featured-card {
    border: 3px solid #3498db;
    box-shadow: 0 6px 25px rgba(52, 152, 219, 0.15);
}

.khfp-featured-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 40px rgba(52, 152, 219, 0.25);
}

.khfp-featured-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: linear-gradient(135deg, #f39c12 0%, #e74c3c 100%);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    z-index: 2;
}

/* ==========================================================================
   Floor Plans Grid
   ========================================================================== */

.khfp-floor-plans-grid {
    display: grid;
    gap: 30px;
    margin: 40px 0;
}

.khfp-floor-plans-grid.khfp-columns-2 {
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
}

.khfp-floor-plans-grid.khfp-columns-3 {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.khfp-floor-plans-grid.khfp-columns-4 {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.khfp-plan-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.khfp-plan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.khfp-plan-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.khfp-plan-image {
    position: relative;
    padding-top: 75%; /* 4:3 aspect ratio */
    overflow: hidden;
}

.khfp-plan-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.khfp-plan-card:hover .khfp-plan-image img {
    transform: scale(1.08);
}

.khfp-storey-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(44, 62, 80, 0.9);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.khfp-gallery-preview {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    z-index: 2;
}

.khfp-preview-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    background: #ffffff;
}

.khfp-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: static;
    transform: none !important;
}

.khfp-preview-more {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: rgba(44, 62, 80, 0.9);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.khfp-plan-content {
    padding: 20px;
}

.khfp-plan-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: #2c3e50;
}

.khfp-plan-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.khfp-spec {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666;
    font-size: 0.95rem;
    font-weight: 500;
}

.khfp-spec svg {
    color: #3498db;
}

.khfp-spec-area {
    color: #27ae60;
    font-weight: 600;
}

.khfp-plan-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.khfp-category-tag {
    background: #ecf0f1;
    color: #2c3e50;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.khfp-view-details {
    display: inline-block;
    color: #3498db;
    font-weight: 600;
    font-size: 0.95rem;
}

.khfp-plan-card:hover .khfp-view-details {
    text-decoration: underline;
}

/* ==========================================================================
   Single Floor Plan
   ========================================================================== */

.khfp-single-floor-plan {
    background: #f8f9fa;
    padding-bottom: 60px;
}

/* Hero Section */
.khfp-hero {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #ffffff;
    padding: 40px 0 60px;
    margin-bottom: 40px;
}

.khfp-breadcrumbs {
    font-size: 0.9rem;
    margin-bottom: 20px;
    opacity: 0.9;
}

.khfp-breadcrumbs a {
    color: #ffffff;
    text-decoration: none;
}

.khfp-breadcrumbs a:hover {
    text-decoration: underline;
}

.khfp-page-title {
    color: #ffffff;
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0 0 30px 0;
    letter-spacing: -0.5px;
}

.khfp-quick-specs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    max-width: 800px;
}

.khfp-quick-spec {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.1);
    padding: 16px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.khfp-spec-icon svg {
    color: #3498db;
}

.khfp-spec-text {
    display: flex;
    flex-direction: column;
}

.khfp-spec-text strong {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.khfp-spec-text span {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Content Layout */
.khfp-content-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 40px;
    align-items: start;
}

.khfp-main-column,
.khfp-sidebar-column {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

/* Gallery */
.khfp-gallery {
    margin-bottom: 40px;
}

.khfp-main-image {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.khfp-main-image img {
    width: 100%;
    height: auto;
    display: block;
}

.khfp-thumbnails {
    flex-wrap: wrap;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.khfp-thumbnail {
    border: 3px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    background: none;
}

.khfp-thumbnail.active {
    border-color: #3498db;
}

.khfp-thumbnail:hover {
    border-color: #3498db;
    opacity: 0.8;
}

.khfp-thumbnail img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}

/* Description & Features */
.khfp-description,
.khfp-features-list {
    margin-bottom: 40px;
}

.khfp-description h2,
.khfp-features-list h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: #2c3e50;
}

.khfp-description p {
    line-height: 1.8;
    color: #4a5568;
    margin-bottom: 16px;
}

.khfp-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.khfp-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #4a5568;
    font-weight: 500;
}

.khfp-features svg {
    color: #27ae60;

}

/* Sidebar */
.khfp-sidebar-column {
    position: sticky;
    top: 100px;
}

.khfp-cta-box {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: #ffffff;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    text-align: center;
}

.khfp-cta-box h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.khfp-cta-box p {
    margin: 0 0 20px 0;
    opacity: 0.95;
}

.khfp-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #ffffff;
    color: #27ae60;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    margin-bottom: 12px;
    width: 100%;
    transition: all 0.3s ease;
}

.khfp-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.khfp-cta-button-secondary {
    display: inline-block;
    color: #ffffff;
    padding: 12px 24px;
    border: 2px solid #ffffff;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    width: 100%;
    text-align: center;
    transition: all 0.3s ease;
}

.khfp-cta-button-secondary:hover {
    background: #ffffff;
    color: #27ae60;
}

/* Specifications */
.khfp-specifications {
    margin-bottom: 24px;
}

.khfp-specifications h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: #2c3e50;
}

.khfp-spec-group {
    margin-bottom: 24px;
}

.khfp-spec-group h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #3498db;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
}

.khfp-spec-table {
    width: 100%;
    border-collapse: collapse;
}

.khfp-spec-table tr {
    border-bottom: 1px solid #ecf0f1;
}

.khfp-spec-table tr:last-child {
    border-bottom: none;
}

.khfp-spec-table td {
    padding: 10px 0;
    color: #4a5568;
}

.khfp-spec-table td:first-child {
    color: #666;
    font-size: 0.95rem;
}

.khfp-spec-table td:last-child {
    text-align: right;
}

.khfp-spec-table strong {
    color: #2c3e50;
    font-weight: 600;
}

/* Share */
.khfp-share h4 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #2c3e50;
}

.khfp-share-buttons {
    display: flex;
    gap: 8px;
}

.khfp-share-button {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ecf0f1;
    border-radius: 50%;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.khfp-share-button:hover {
    background: #3498db;
    color: #ffffff;
    transform: translateY(-2px);
}

/* Related Plans */
.khfp-related-plans {
    margin-top: 60px;
}

.khfp-related-plans h2 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 30px 0;
    color: #2c3e50;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media screen and (max-width: 1200px) {
    .khfp-content-layout {
        grid-template-columns: 1fr 340px;
    }
}

@media screen and (max-width: 992px) {
    .khfp-content-layout {
        grid-template-columns: 1fr;
    }
    
    .khfp-sidebar-column {
        position: static;
    }
    
    .khfp-categories-grid.khfp-columns-3,
    .khfp-categories-grid.khfp-columns-4,
    .khfp-floor-plans-grid.khfp-columns-3,
    .khfp-floor-plans-grid.khfp-columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .khfp-page-title {
    color: #ffffff;
        font-size: 2rem;
    }
    
    .khfp-quick-specs {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .khfp-main-column,
    .khfp-sidebar-column {
        padding: 24px;
    }
    
    .khfp-features {
        grid-template-columns: 1fr;
    }
    
    .khfp-categories-grid.khfp-columns-2,
    .khfp-categories-grid.khfp-columns-3,
    .khfp-categories-grid.khfp-columns-4,
    .khfp-floor-plans-grid.khfp-columns-2,
    .khfp-floor-plans-grid.khfp-columns-3,
    .khfp-floor-plans-grid.khfp-columns-4 {
        grid-template-columns: 1fr;
    }
    
    .khfp-plan-specs {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media screen and (max-width: 480px) {
    .khfp-quick-specs {
        grid-template-columns: 1fr;
    }
    
    .khfp-page-title {
    color: #ffffff;
        font-size: 1.6rem;
    }
}

/* =================================================================
   Gallery Styles
   ================================================================= */

.khfp-gallery {
    margin-bottom: 40px;
}

.khfp-main-image {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.khfp-main-image:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.khfp-main-image img {
    width: 100%;
    height: auto;
    display: block;
}

.khfp-thumbnails {
    flex-wrap: wrap;
    display: flex;
    gap: 12px;
    margin-top: 16px;
    overflow-x: hidden;
    padding: 4px;
}

.khfp-thumbnail {

    width: 100px;
    height: 100px;
    border: 3px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
    padding: 0;
}

.khfp-thumbnail:hover {
    border-color: #3498db;
    transform: translateY(-2px);
}

.khfp-thumbnail.active {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.khfp-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Lightbox */
.khfp-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.khfp-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
}

.khfp-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    z-index: 10001;
}

.khfp-lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    border-radius: 8px;
}

.khfp-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    transition: transform 0.2s ease;
}

.khfp-lightbox-close:hover {
    transform: scale(1.2);
}

body.khfp-lightbox-open {
    overflow: hidden;
}

/* =================================================================
   Videos Section
   ================================================================= */

.khfp-videos-section {
    margin-top: 48px;
    padding: 40px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.khfp-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 32px 0;
    padding-bottom: 16px;
    border-bottom: 3px solid #3498db;
}

.khfp-section-title svg {

    color: #3498db;
}

.khfp-videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 32px;
}

.khfp-video-item {
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fa;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.khfp-video-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.khfp-video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

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

/* Responsive Gallery & Videos */
@media screen and (max-width: 1200px) {
    .khfp-videos-grid {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 768px) {
    .khfp-thumbnails {
    flex-wrap: wrap;
        gap: 8px;
    }
    
    .khfp-thumbnail {
        width: 80px;
        height: 80px;
    }
    
    .khfp-videos-section {
        padding: 24px;
    }
    
    .khfp-section-title {
        font-size: 20px;
        margin-bottom: 24px;
    }
    
    .khfp-videos-grid {
        gap: 20px;
    }
}

@media screen and (max-width: 480px) {
    .khfp-thumbnail {
        width: 60px;
        height: 60px;
    }
    
    .khfp-videos-section {
        padding: 20px;
        margin-top: 32px;
    }
    
    .khfp-section-title {
        font-size: 18px;
    }
}

/* Watermark overlay for gallery images */
.khfp-main-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='150'%3E%3Ctext x='50%25' y='50%25' font-family='Arial, sans-serif' font-size='24' font-weight='bold' fill='rgba(255,255,255,0.15)' text-anchor='middle' dominant-baseline='middle' transform='rotate(-30, 150, 75)'%3Ebribuild.com.au%3C/text%3E%3C/svg%3E");
    background-repeat: repeat;
    z-index: 10;
}

.khfp-thumbnail {
    position: relative;
}

.khfp-thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='75'%3E%3Ctext x='50%25' y='50%25' font-family='Arial, sans-serif' font-size='12' font-weight='bold' fill='rgba(255,255,255,0.15)' text-anchor='middle' dominant-baseline='middle' transform='rotate(-30, 75, 37)'%3Ebribuild.com.au%3C/text%3E%3C/svg%3E");
    background-repeat: repeat;
    z-index: 10;
}

/* Disable image selection and dragging */
.khfp-main-image img,
.khfp-thumbnail img,
.khfp-gallery img {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    pointer-events: none;
}
