/**
 * Closet Home Page Styles
 * Template: 3D Closet Configurator
 */

/* Hide WordPress default page title and breadcrumbs - only on this page */
body:has(.closet-home-page) .wd-page-title.page-title,
body:has(.closet-home-page) .wd-page-title.page-title-default,
.wd-page-title.page-title-default {
    display: none !important;
}

/* Remove top padding from main content wrapper - only on this page */
body:has(.closet-home-page) .wd-content-layout.content-layout-wrapper.container,
body:has(.closet-home-page) .wd-content-layout.content-layout-wrapper,
body:has(.closet-home-page) .content-layout-wrapper.container {
    padding-top: 0 !important;
}

.closet-home-page {
    min-height: 100vh;
    background-color: #ffffff;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    padding-top: 0;
    margin-top: 0;
}

/* Ensure content doesn't conflict with theme header */
.wd-page-wrapper .closet-home-page {
    margin-top: 0;
}

/* Header Section */
.closet-home-header {
    position: relative;
    width: 100%;
}

.closet-home-banner {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 64px 50px 32px;
}

.banner-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.banner-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.64);
    z-index: 1;
}

.banner-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 40px;
    width: 100%;
    max-width: 1340px;
}

.banner-logo {
    flex-shrink: 0;
}

.banner-logo .logo-text {
    font-family: 'Roboto', sans-serif;
    font-size: 36px;
    font-weight: 400;
    line-height: 1.171875em;
    color: #FFFFFF;
    margin: 0;
}

.banner-logo .custom-logo,
.banner-logo .custom-logo img {
    max-width: 164px;
    height: auto;
    filter: brightness(0) invert(1);
    display: block;
}

.banner-logo a {
    display: inline-block;
}

.banner-title {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.banner-title h1 {
    font-family: 'Roboto', sans-serif;
    font-size: 36px;
    font-weight: 400;
    line-height: 1.171875em;
    color: #FFFFFF;
    margin: 0;
}

/* When user is authorized, change title color */
.banner-title.user-authorized h1 {
    color: #DACBB5;
    font-size: 18px;
}

.banner-welcome {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.welcome-text {
    font-family: 'Roboto', sans-serif;
    font-size: 36px;
    font-weight: 400;
    line-height: 1.171875em;
    color: #FFFFFF;
}

.user-name {
    font-family: 'Roboto', sans-serif;
    font-size: 36px;
    font-weight: 400;
    line-height: 1.171875em;
    color: #DACBB5;
}

/* Main Content */
.closet-home-content {
    max-width: 1340px;
    margin: 0 auto;
    padding: 54px 0px 80px;
    display: flex;
    flex-direction: column;
    gap: 54px;
}

/* Section Headers */
.section-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.section-header h3 {
    font-family: 'Roboto', sans-serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.171875em;
    color: #1A1A1A;
    margin: 0;
}

.section-description {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.171875em;
    color: #1A1A1A;
    margin: 0;
}

/* Start New Project Section */
.start-new-project {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.preset-options {
    display: flex;
    flex-direction: row;
    gap: 16px;
    flex-wrap: wrap;
}

.preset-card {
    background: #ffffff;
    border: 1px solid #D7D7D7;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    overflow: hidden;
    width: 252px;
    align-items: flex-end;
    box-sizing: border-box;
}

.preset-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(167, 123, 81, 0.02) 0%, rgba(167, 123, 81, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.preset-card:hover {
    border-color: #DACBB5;
    box-shadow: 0 8px 24px rgba(167, 123, 81, 0.2);
    transform: translateY(-4px);
}

.preset-card:hover::before {
    opacity: 1;
}

.preset-card:active {
    transform: translateY(-1px);
}

.card-top-section {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 42px;
    width: 100%;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #DACBB5;
    transition: all 0.3s ease;
}

.preset-card:hover .card-icon {
    transform: scale(1.05);
}

.card-icon .plus-icon {
    width: 33.5px;
    height: 33.5px;
    display: block;
    object-fit: contain;
}

.card-icon img.plus-icon {
    width: 100%;
    height: 100%;
}

.card-dimensions-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
}

.dimension-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
}

.dimension-icon-wrapper {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dimension-icon {
    width: 20px;
    height: 20px;
    display: block;
}

.dimension-values {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 3px;
}

.dimension-number {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.171875em;
    text-transform: uppercase;
    color: #1A1A1A;
}

.preset-card[data-type="reach-in"] .dimension-number:first-child {
    color: #000000;
}

.dimension-unit {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.171875em;
    color: #999999;
}

.dimension-separator {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.171875em;
    text-align: center;
    color: #1A1A1A;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.card-title {
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.171875em;
    color: #1A1A1A;
    margin: 0;
}

.card-description {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.1428571428571428em;
    color: #5F5F5F;
    margin: 0;
}

/* Saved Projects Section */
.saved-projects {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* Saved Projects Loading State */
.saved-projects-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
    width: 100%;
    min-height: 200px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #F0EEEB;
    border-top-color: #DACBB5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Saved Projects Container */
.saved-projects-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    width: 100%;
}

/* Project Card */
.project-card {
    display: flex;
    flex-direction: column;
    width: 210px;
    background: #ffffff;
    border: 1px solid #D7D7D7;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.project-card:hover {
    border-color: #DACBB5;
    box-shadow: 0 8px 24px rgba(167, 123, 81, 0.2);
    transform: translateY(-4px);
}

.project-card:active {
    transform: translateY(-1px);
}

/* Project Card Image Section */
.project-card-image {
    width: 100%;
    height: 140px;
    background: #F0EEEB;
    border-radius: 12px 12px 0px 0px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
    position: relative;
}

.project-card-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Delete Button */
.project-card-delete-button {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
    padding: 8px 12px;
    background: #FFFFFF;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    z-index: 10;
}

.project-card-delete-button:hover {
    box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.2) inset;
    background: #DEDEDE;
}

.project-card-delete-button:active {
    transform: scale(0.95);
}

.project-card-delete-button .delete-icon {
    width: 22px;
    height: 22px;
    display: block;
    object-fit: contain;
}

/* Show delete button on hover (desktop) */
@media (min-width: 769px) {
    .project-card:hover .project-card-delete-button {
        opacity: 1;
    }
}

/* Always show delete button on mobile/tablet */
@media (max-width: 768px) {
    .project-card-delete-button {
        opacity: 1;
    }
}

/* Project Card Info Section */
.project-card-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 24px;
    padding: 16px;
    background: #FFFFFF;
    border-radius: 0px 0px 12px 12px;
    box-sizing: border-box;
}

.project-card-title-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 14px;
}

.project-card-title {
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.171875em;
    color: #1A1A1A;
    margin: 0;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* Saved Projects Empty State (Authorized User) */
.saved-projects-empty {
    background: #ffffff;
    padding: 32px 42px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.empty-state-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
}

.empty-state-icon {
    flex-shrink: 0;
    width: 100px;
    height: 67px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.box-icon {
    width: 100px;
    height: 67px;
    display: block;
    object-fit: contain;
}

.empty-state-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.empty-state-title {
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.171875em;
    color: #5F5F5F;
    margin: 0;
}

.empty-state-description {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.1428571428571428em;
    color: #5F5F5F;
    margin: 0;
}

.login-box {
    background: #ffffff;
    border: 1px solid #D7D7D7;
    border-radius: 8px;
    padding: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: fit-content;
    margin: 0 auto;
}

.login-box-content {
    width: 488px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 24px;
}

.login-box-title {
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.171875em;
    color: #1A1A1A;
    margin: 0;
    text-align: center;
}

.login-box-description {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.1428571428571428em;
    color: #1A1A1A;
    margin: 0;
    text-align: center;
    width: 440px;
}

.login-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background-color: #A77B51;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 7px;
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.171875em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 42px;
    min-width: auto;
    border: none;
    box-shadow: none;
}

.login-button:hover {
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(167, 123, 81, 0.35);
}

.login-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(167, 123, 81, 0.2);
}

/* Ensure proper spacing from theme elements */
.wd-content-area .closet-home-page {
    padding: 0;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .banner-content {
        flex-direction: row;
        justify-content: space-between;
        gap: 30px;
    }

    .banner-logo .logo-text {
        font-size: 28px;
    }

    .banner-title h1 {
        font-size: 28px;
    }

    .preset-options {
        gap: 16px;
    }

    .preset-card {
        width: calc(33.333% - 11px);
        min-width: 240px;
    }
}

@media (max-width: 768px) {
    .closet-home-banner {
        padding: 40px 20px 20px;
    }

    .banner-content {
        padding: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .banner-logo .logo-text {
        font-size: 24px;
    }

    .banner-title h1 {
        font-size: 24px;
    }

    .closet-home-content {
        padding: 40px 20px 60px;
        gap: 40px;
    }

    .section-header h3 {
        font-size: 20px;
    }

    .section-description {
        font-size: 14px;
    }

    .preset-options {
        flex-direction: column;
        gap: 16px;
    }

    .preset-card {
        width: 100%;
        max-width: 100%;
    }

    .login-box {
        padding: 20px;
        width: 100%;
    }

    .login-box-content {
        width: 100%;
        max-width: 488px;
    }

    .login-box-description {
        width: 100%;
        max-width: 440px;
    }

    .login-box-title {
        font-size: 16px;
    }

    .banner-welcome {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }

    .welcome-text,
    .user-name {
        font-size: 24px;
    }

    .saved-projects-empty {
        padding: 24px 20px;
    }

    .empty-state-content {
        flex-direction: column;
        gap: 16px;
    }

    .empty-state-icon {
        width: 80px;
        height: 54px;
    }

    .box-icon {
        width: 80px;
        height: 54px;
    }

    .empty-state-title {
        font-size: 16px;
        text-align: center;
    }

    .empty-state-description {
        text-align: center;
    }

    .saved-projects-container {
        gap: 12px;
    }

    .project-card {
        width: calc(50% - 6px);
        min-width: 180px;
    }
}

@media (max-width: 480px) {
    .closet-home-banner {
        padding: 30px 15px 15px;
    }

    .banner-content {
        padding: 0;
    }

    .banner-logo .logo-text {
        font-size: 20px;
    }

    .banner-title h1 {
        font-size: 20px;
    }

    .welcome-text,
    .user-name {
        font-size: 20px;
    }

    .saved-projects-empty {
        padding: 20px 16px;
    }

    .empty-state-content {
        gap: 12px;
    }

    .empty-state-icon {
        width: 60px;
        height: 40px;
    }

    .box-icon {
        width: 60px;
        height: 40px;
    }

    .closet-home-content {
        padding: 30px 15px 40px;
        gap: 30px;
    }

    .preset-card {
        padding: 12px;
    }

    .card-top-section {
        gap: 20px;
    }

    .card-icon {
        width: 48px;
        height: 48px;
    }

    .card-icon .plus-icon {
        width: 36px;
        height: 36px;
    }

    .login-box {
        padding: 16px;
    }

    .login-button {
        width: 100%;
        padding: 8px 12px;
    }

    .saved-projects-container {
        gap: 12px;
    }

    .project-card {
        width: 100%;
        max-width: 100%;
    }
}

/* Delete Project Modal */
.delete-project-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.48);
    z-index: 9998;
    display: none;
}

.delete-project-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 340px;
    background: #FFFFFF;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    display: none;
    box-sizing: border-box;
}

.delete-project-modal-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 24px;
    width: 100%;
}

.delete-project-modal-header {
    display: flex;
    flex-direction: column;
    align-self: stretch;
    gap: 16px;
    width: 100%;
}

.delete-project-modal-title-wrapper {
    display: flex;
    flex-direction: row;
    justify-content: stretch;
    align-items: stretch;
    align-self: stretch;
    gap: 85px;
    padding: 12px 0px 0px;
    width: 100%;
}

.delete-project-modal-title {
    font-family: 'Roboto', sans-serif;
    font-size: 21px;
    font-weight: 600;
    line-height: 1.171875em;
    color: #1A1A1A;
    margin: 0;
    text-align: center;
    width: 100%;
}

.delete-project-modal-description-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    align-self: stretch;
    gap: 16px;
    width: 100%;
}

.delete-project-modal-description {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.2857142857142858em;
    color: #5F5F5F;
    margin: 0;
    text-align: center;
    width: 100%;
}

.delete-project-modal-description strong {
    font-weight: 700;
    color: #1A1A1A;
}

.delete-project-modal-description strong.delete-warning {
    font-weight: 700;
    color: #E40000;
}

.delete-project-modal-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    align-self: stretch;
    gap: 6px;
    width: 100%;
}

.delete-project-button-cancel {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 120px;
    height: 42px;
    padding: 8px 12px;
    background: #FFFFFF;
    border: 1px solid #D7D7D7;
    border-radius: 7px;
    color: #1A1A1A;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.171875em;
    text-transform: none;
    cursor: pointer;
    box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    box-sizing: border-box;
}

.delete-project-button-cancel:hover {
    transform: translateY(-2px);
    box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.2);
}

.delete-project-button-cancel:active {
    transform: translateY(0);
    box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.15);
}

.delete-project-button-confirm {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    height: 42px;
    padding: 8px 12px;
    background: #E40000;
    border: none;
    border-radius: 7px;
    color: #FFFFFF;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.171875em;
    text-transform: none;
    cursor: pointer;
    box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.delete-project-button-confirm:hover {
    background: #CC0000;
    transform: translateY(-2px);
    box-shadow: 0px 4px 8px 0px rgba(228, 0, 0, 0.3);
}

.delete-project-button-confirm:active {
    transform: translateY(0);
    box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.15);
}

.delete-project-button-confirm:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Responsive Modal */
@media (max-width: 480px) {
    .delete-project-modal {
        width: calc(100% - 32px);
        max-width: 340px;
        padding: 16px;
    }

    .delete-project-button-cancel {
        width: auto;
        flex: 1;
    }
}
