/* Interactive Styles for Door Cards and Floating Elements */

/* Grid Spacing Fix for Door Labels */
.services-grid {
    row-gap: 80px !important;
    /* Increased gap to prevent labels from overlapping the row below */
}

/* Door-Style Service Cards */
.door-card {
    position: relative;
    height: 460px;
    perspective: 1500px;
    /* Increased perspective for better 3D realism */
    transform-style: preserve-3d;
    /* Ensure 3D space is preserved */
    cursor: pointer;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.door-front {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: left center;
    /* Realistic shadow that changes when door opens */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    z-index: 2;
}

.door-card.door-open .door-front {
    transform: rotateY(-115deg);
    box-shadow: -10px 10px 30px rgba(0, 0, 0, 0.1);
}

/* Realistic Frame with Molding Effect */
.door-frame {
    width: 100%;
    height: 100%;
    /* Rich cream/wood gradient */
    background: linear-gradient(to right, #e6dace, #f0e6dc 15%, #e6dace 25%, #f0e6dc 50%, #e6dace 75%, #f0e6dc 90%, #e6dace);
    border: 1px solid #d4c4a8;
    border-radius: 8px;
    /* Complex shadow for molding depth */
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.6),
        inset 0 0 15px rgba(90, 74, 58, 0.1),
        inset 4px 0 6px rgba(0, 0, 0, 0.05),
        inset -4px 0 6px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    padding: 12px;
    /* Frame thickness */
}

/* Recessed Panel */
.door-panel {
    width: 100%;
    height: 100%;
    background-color: #f7f1eb;
    /* Inner shadow to create recessed look */
    box-shadow:
        inset 3px 3px 8px rgba(0, 0, 0, 0.12),
        inset -2px -2px 5px rgba(255, 255, 255, 0.9),
        0 0 0 1px #dccbb5;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 3rem;
    border: 1px solid #eaddcf;
}

/* Decorative inner line on panel */
.door-panel::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 1px solid rgba(201, 160, 99, 0.2);
    pointer-events: none;
}

/* Frosted Glass Window */
.door-window {
    width: 120px;
    height: 120px;
    /* Removed backdrop-filter to fix text blur issue */
    background: linear-gradient(135deg, rgba(225, 235, 245, 0.95), rgba(255, 255, 255, 0.85));
    border: 4px solid #fff;
    box-shadow:
        inset 0 0 15px rgba(0, 0, 0, 0.08),
        0 4px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 3rem;
    position: relative;
    border-radius: 2px;
}

/* Window Reflection/Sheen */
.door-window::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, transparent 45%, transparent 55%, rgba(255, 255, 255, 0.5) 100%);
    opacity: 0.7;
    z-index: 2;
}

/* Window Crossbars (Muntins) */
.door-window::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    background: #f0e6dc;
    transform: translateY(-50%);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

/* Metallic Handle */
.door-handle {
    width: 50px;
    height: 10px;
    /* Brushed Gold Gradient */
    background: linear-gradient(to bottom, #e6c88a, #c9a063 40%, #8b7355 100%);
    border-radius: 2px;
    position: absolute;
    right: 20px;
    top: 55%;
    transform: translateY(-50%);
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
    z-index: 5;
}

/* Handle Base Plate */
.door-handle::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 28px;
    background: linear-gradient(to right, #e6c88a, #c9a063);
    border-radius: 2px;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.door-number {
    position: absolute;
    bottom: 3rem;
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: rgba(90, 74, 58, 0.15);
    /* Subtle watermark style */
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5);
}

/* Premium Doorbell Button */
.doorbell {
    position: absolute;
    top: 55%;
    right: 18px;
    /* Positioned near handle */
    width: 32px;
    height: 54px;
    background: linear-gradient(135deg, #f5f5f5, #dcdcdc);
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.doorbell:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(201, 160, 99, 0.4);
    border-color: var(--color-primary);
}

.doorbell-button {
    width: 16px;
    height: 16px;
    background: radial-gradient(circle at 30% 30%, #fff, #e0e0e0);
    border: 1px solid #bbb;
    border-radius: 50%;
    display: block;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* Glowing ring effect on hover */
.doorbell:hover .doorbell-button {
    background: radial-gradient(circle at 30% 30%, #fff, #f0e6dc);
    box-shadow: 0 0 6px rgba(201, 160, 99, 0.8);
    border-color: var(--color-primary);
}

.doorbell.ringing .doorbell-button {
    background: #c9a063;
    box-shadow: 0 0 10px #c9a063;
}

.doorbell.ringing {
    animation: ring 0.6s ease;
}

@keyframes ring {

    0%,
    100% {
        transform: rotate(0deg);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: rotate(-5deg);
    }

    20%,
    40%,
    60%,
    80% {
        transform: rotate(5deg);
    }
}

.door-label {
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    text-align: center;
    font-family: var(--font-heading);
    font-size: 1.35rem;
    color: var(--color-secondary);
    font-weight: 600;
    letter-spacing: 0.5px;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.door-card:hover .door-label {
    opacity: 1;
    color: var(--color-primary-dark);
}

/* Interior Content */
.door-content {
    position: absolute;
    width: 100%;
    height: 100%;
    /* Subtle interior wallpaper pattern */
    background-color: #fff;
    background-image: radial-gradient(#e5d4b8 1px, transparent 1px);
    background-size: 20px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease 0.4s;
    pointer-events: none;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5ddd5;
}

.door-card.door-open .door-content {
    opacity: 1;
    pointer-events: all;
}

.door-content-inner {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.95);
    margin: 1.5rem;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.door-content .service-title {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--color-secondary);
}

.door-content .service-description {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: var(--color-text-secondary);
}

.close-door {
    background: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    padding: 0.5rem 1.5rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.close-door:hover {
    background: var(--color-primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(201, 160, 99, 0.3);
}

/* Floating Design Elements */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.floating-item {
    position: absolute;
    font-size: 3rem;
    opacity: 0.08;
    /* More subtle */
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
    filter: grayscale(20%) sepia(10%);
    /* Blends better with cream theme */
}

.float-chair {
    animation-delay: 0s;
    animation-duration: 25s;
}

.float-lamp {
    animation-delay: 5s;
    animation-duration: 30s;
}

.float-plant {
    animation-delay: 10s;
    animation-duration: 28s;
}

.float-palette {
    animation-delay: 15s;
    animation-duration: 22s;
}

.float-sofa {
    animation-delay: 20s;
    animation-duration: 26s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-30px) rotate(5deg);
    }

    50% {
        transform: translateY(-60px) rotate(-5deg);
    }

    75% {
        transform: translateY(-30px) rotate(3deg);
    }
}

/* Enhanced Portfolio Hover Effects */
.portfolio-item {
    transform-style: preserve-3d;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

/* Responsive Adjustments */
@media (max-width: 968px) {
    .door-card {
        height: 420px;
    }

    .door-number {
        font-size: 2rem;
    }

    .door-window {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 768px) {
    .door-card {
        height: 380px;
    }

    .door-content .service-title {
        font-size: 1.5rem;
    }

    .door-content .service-description {
        font-size: 0.95rem;
    }

    .floating-item {
        font-size: 2rem;
        opacity: 0.05;
    }
}

@media (max-width: 480px) {
    .door-card {
        height: 340px;
    }

    .door-window {
        width: 80px;
        height: 80px;
    }

    .door-number {
        font-size: 1.75rem;
    }

    .doorbell {
        width: 28px;
        height: 48px;
    }

    .doorbell-button {
        width: 14px;
        height: 14px;
    }
}