:root {
    --primary-purple: #664BC4; --secondary-teal: #54E0C4; --gradient-pink: #D75DBC;
    --light-gray: #f8f9fa; --medium-gray: #dee2e6; --dark-gray: #495057;
    --text-color: #212529; --white: #ffffff;
    --shadow: 0 15px 35px rgba(50, 50, 93, 0.1), 0 5px 15px rgba(0, 0, 0, 0.07);
}

#planwisewp-container { line-height: 1.7; color: var(--text-color); }
#planwisewp-container .main-container { max-width: 800px; margin: 2.5rem auto; padding: clamp(1.5rem, 5vw, 3rem); background-color: var(--light-gray); border-radius: 24px; box-shadow: var(--shadow); }
#planwisewp-container header h1 { color: var(--text-color); text-align: center; font-weight: 700; margin-bottom: 0.5rem; }
#planwisewp-container header p { text-align: center; color: var(--dark-gray); margin-bottom: 2.5rem; font-weight: 500; max-width: 650px; margin-left: auto; margin-right: auto;}
#planwisewp-container .question-group { margin-bottom: 2rem; padding: 1.5rem; border: 1px solid var(--medium-gray); background-color: var(--white); border-radius: 16px; }
#planwisewp-container .question { margin-bottom: 1.75rem; }
#planwisewp-container .hidden { display: none; }
#planwisewp-container label {
    font-weight: 600;
    display: block;
    margin-bottom: 0.75rem;
}
#planwisewp-container label.hidden-label { display: none; } 
#planwisewp-container input[type="text"], #planwisewp-container input[type="email"], #planwisewp-container input[type="date"], #planwisewp-container input[type="number"], #planwisewp-container select, #planwisewp-container textarea { width: 100%; padding: 14px; margin-top: 5px; box-sizing: border-box; border: 1px solid var(--medium-gray); border-radius: 8px; transition: all 0.3s ease; background-color: #fdfdff; }
#planwisewp-container input[type="text"]:focus, #planwisewp-container input[type="email"]:focus, #planwisewp-container input[type="date"]:focus, #planwisewp-container input[type="number"]:focus, #planwisewp-container select:focus {
    outline: revert;
}
#planwisewp-container .button-container { text-align: center; }
#planwisewp-container .nav-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 2rem; }
#planwisewp-container .planwisewp-login-button-spacing {
    margin-top: 1rem;
    text-decoration: none;
}
#planwisewp-container .results { padding: 2rem; border-radius: 16px; margin-top: 2rem; background-color: var(--white); border: 1px solid var(--medium-gray);}
#planwisewp-container .results h3 { margin-top: 0; color: var(--text-color); font-weight: 700; font-size: 1.5rem; text-align: center; }
#planwisewp-container .results p { text-align: center; }
#planwisewp-container .info {
    background-color: rgba(232, 241, 255, 0.5);
    border: 1px solid rgba(102, 75, 196, 0.2);
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 2rem;
    margin-bottom: 2rem;
    text-align: left;
}
#planwisewp-container .info h3,
#planwisewp-container .info h4 {
    margin-bottom: 1.5rem;
}
.tooltip-icon {
    display: inline-block;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    text-align: center;
    font-style: italic;
    cursor: pointer;
    position: relative;
}

.tooltip-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 10px 15px;
    border-radius: 6px;
    z-index: 9999;
    width: max-content;
    max-width: 600px;
    min-width: 150px;
    white-space: normal;
    text-align: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
}

.tooltip-icon:hover::after {
    visibility: visible;
    opacity: 1;
}
#planwisewp-container .main-container { max-width: 90%; }
h1, h2 { text-align: center; }
#controls {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 16px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}
.control-group {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    flex-basis: auto;
    padding: 10px;
    background-color: #fff;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    gap: 10px;
    flex-wrap: wrap;
}
#controls button {
    padding: 10px 20px;
    border: none;
    border-radius: 50px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
}
#controls button:hover {
    opacity: 0.85;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

#controls #addRoomBtn { background: var(--pw-btn-add_room); }
#controls #addRoomBtn:disabled {
    background: var(--medium-gray) !important; 
    opacity: 0.6 !important;                
    cursor: not-allowed !important;        
    box-shadow: none !important;            
    transform: none !important;  
}
#controls #addFillerBtn { background: var(--pw-btn-filler); }
#controls #addFillerBtn:disabled {
    background: var(--medium-gray) !important;
    opacity: 0.6 !important;              
    cursor: not-allowed !important;      
    box-shadow: none !important;             
    transform: none !important;             
}
#controls .zoom-btn { background: var(--pw-btn-zoom); }
#controls .marker1-btn { background: var(--pw-btn-marker_dot); }
#controls #addWindowBtn { background: var(--pw-btn-marker_window); }
#controls #addDoorBtn { background: var(--pw-btn-marker_door); }
#controls #addOpeningBtn { background: var(--pw-btn-marker_opening); }
#controls .export-btn { background: var(--pw-btn-export_csv); } 
#controls #exportTxtBtn { background: var(--pw-btn-export_txt); }
#controls .download-btn { background: var(--pw-btn-export_png); }
#controls .project-btn { background: var(--pw-btn-project_save); color: #212529; }
#controls #loadProjectBtn { background: var(--pw-btn-project_load); }

#edit-panel #rotateBtn { background: var(--pw-btn-edit_rotate) !important; }
#edit-panel #deleteBtn { background: var(--pw-btn-edit_delete) !important; }

#controls button.pro-feature-button:disabled {
    opacity: 0.6;
    background: var(--medium-gray) !important;
    cursor: not-allowed;
    position: relative;
    overflow: hidden;
}
#controls button.pro-feature-button:disabled:hover {
    transform: none;
    box-shadow: none;
}

#controls button.pro-feature-button:disabled {
    font-size: 11px !important; 
    flex-direction: column;
    padding: 4px;
    line-height: 1.2;
    width: 60px !important; 
}
#controls button.pro-feature-button:disabled i {
    font-size: 14px;
    margin-bottom: 2px;
}

#controls label { margin: 0; color: #495057; font-size: 14px; white-space: nowrap; }
#controls input[type="number"], #controls select { padding: 8px 12px; font-size: 15px; border-radius: 8px; border: 1px solid #ccc; flex-shrink: 0; width: auto; }
#controls input[type="number"] { width: 80px; }
#controls input:disabled { background-color: #e9ecef; cursor: not-allowed; }
#controls select { width: 150px; }
#floorPlanCanvas { border: 2px solid #333; background-color: #fff; cursor: default; display: block; max-width: 100%; height: auto; margin-left: auto; margin-right: auto; }
#ceilingHeightDisplay { text-align: center; margin: 20px 0 5px 0; font-size: 1.2em; font-weight: bold; }
#results-container { width: 100%; max-width: 1000px; margin: 20px auto 0 auto; box-sizing: border-box; }
.results-global, .room-results { background-color: #fff; border: 1px solid #dee2e6; border-radius: 12px; padding: 20px; margin-bottom: 15px; }
.room-results {
    border-left: 5px solid #ccc; 
}
.room-results h3 {
}
.tooltip-trigger-text {
    font-weight: 600;
    cursor: help;
    position: relative;
    border-bottom: 1px dotted currentColor; 
    background: none !important;
    border: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    text-decoration: none !important;
    box-shadow: none !important;
    display: inline !important;
    line-height: inherit !important;
    pointer-events: auto !important;
}

#custom-tooltip {
    background-color: #333;
    color: #fff;
    padding: 20px;
    padding-top: 40px;
    border-radius: 8px;
    z-index: 2000;
    white-space: normal;
    text-align: left;
    font-size: 14px;
    font-weight: normal;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
}
#custom-tooltip.is-visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

#custom-tooltip h1,
#custom-tooltip h2,
#custom-tooltip h3,
#custom-tooltip h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #ffc107;
    font-weight: 600;
}
#custom-tooltip p { margin-top: 0; margin-bottom: 0.8em; line-height: 1.5; }
#custom-tooltip p:last-child { margin-bottom: 0; }
#custom-tooltip ul { padding-left: 20px; margin-bottom: 0; }
#custom-tooltip li { margin-bottom: 10px; }

.tooltip-close-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
}
.tooltip-close-btn:hover {
    opacity: 1;
}
@media (max-width: 1024px) {
    #custom-tooltip {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.95);
        width: 90vw;
        max-height: 80vh;
        overflow-y: auto;
    }
    #custom-tooltip.is-visible {
        transform: translate(-50%, -50%) scale(1);
    }
}
@media (min-width: 1025px) {
    #custom-tooltip {
        position: fixed;
        width: 800px; 
        max-height: 70vh; 
        overflow-y: auto; 
        pointer-events: none;
        padding-right: 30px; 
    }
    #custom-tooltip.is-visible {
        transform: scale(1);
    }
    .tooltip-close-btn {
        display: none;
    }
}
.results-global ul,
.room-results ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}
.results-global li,
.room-results li {
    padding: 6px 10px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.results-global li span,
.room-results li span {
    font-weight: 600;
    color: #333;
}
.room-results li.subheader {
    background-color: #f8f9fa;
    padding: 5px 10px;
    margin: 8px -10px;
    font-weight: bold;
    color: #333;
    display: block; 
}
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-shadow: inset -10px 0 8px -10px rgba(0,0,0,0.05);
}
.heating-table { width: 100%; margin: 0; border-collapse: collapse; }
.heating-table th, .heating-table td { border: 1px solid #dee2e6; padding: 8px 12px; text-align: left; }
.heating-table th { background-color: #f8f9fa; }
.heating-table-note { font-size: 0.9em; color: #6c757d; margin-top: 10px; text-align: center; }

.pro-upsell-box {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #fdf8e1;
    border: 1px solid #ffc107;
    border-radius: 8px;
    text-align: center;
}
.pro-upsell-box a {
    text-decoration: none;
    color: #212529;
    display: block;
}
.pro-upsell-box a strong {
    display: block;
    font-size: 1.1em;
    margin-bottom: 5px;
}
.pro-upsell-box a small {
    display: block;
    color: var(--dark-gray);
}
.pro-upsell-box a:hover strong {
    text-decoration: underline;
}

#edit-panel {
    position: absolute;
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background-color: #ffffff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10;
    width: auto;
    min-width: 250px;
}
.edit-control {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
}
#edit-panel label {
    white-space: nowrap;
    font-weight: 500;
    margin-bottom: 0; 
    color: var(--dark-gray);
    width: 90px; 
    text-align: right;
    flex-shrink: 0;
}
#edit-panel input[type="number"],
#edit-panel input[type="color"] {
    width: 100px; 
    flex-grow: 1; 
    padding: 6px 10px;
    font-size: 14px;
}
#edit-panel input[type="color"] {
    padding: 2px 4px; 
    height: 35px;
    min-width: 50px;
    flex-grow: 0; 
}

.edit-control.pro-feature-disabled {
    opacity: 0.6;
}
.edit-control.pro-feature-disabled input {
    cursor: not-allowed;
    background-color: #e9ecef;
}
.edit-control.pro-feature-disabled label {
    color: #aaa;
}

.edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    width: 100%;
    justify-content: flex-end;
}
.edit-actions.single-button {
    justify-content: center; 
}

#edit-panel button { 
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;   
    color: white !important; 
    font-size: 16px;      
    line-height: 1;       
    border: none;         
}
#edit-panel #closeEditPanelBtn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    background: var(--pw-btn-edit_delete) !important;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#hamburger-btn {
    display: none;
    position: fixed !important;
    top: 15px;
    left: 15px;
    z-index: 1001;
    width: 50px;
    height: 50px;
    background-color: var(--pw-btn-hamburger) !important;
    background-image: none !important;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}
#hamburger-btn:active {
    transform: scale(0.9);
}
#mobile-controls-panel {
    transition: transform 0.3s ease-in-out;
}

@media (max-width: 1024px) {
    #planwisewp-container .main-container {
        padding: 1rem;
        max-width: 100%;
    }

    #hamburger-btn {
        background-color: var(--pw-btn-hamburger);
        display: block;
    }

    #mobile-controls-panel {
        position: fixed;
        top: 0;
        left: 0;
        width: 300px;
        height: 100%;
        background-color: #f8f9fa;
        z-index: 1000;
        overflow-y: auto;
        padding: 20px;
        padding-top: 70px;
        box-shadow: 5px 0 15px rgba(0,0,0,0.1);
        transform: translateX(-105%);
        box-sizing: border-box;
    }
    #mobile-controls-panel.is-open {
        transform: translateX(0);
    }
    #controls {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        box-shadow: none;
        padding: 0;
        border: none;
        background: transparent;
    }
    .control-group {
        flex-direction: column;
        align-items: flex-start;
        flex-grow: 0;
        width: 100%;
        margin-bottom: 15px;
    }
    #controls button,
    #controls input[type="number"],
    #controls select {
        width: 100% !important;
        margin-bottom: 8px;
    }
    #controls label {
        margin-bottom: 5px;
    }

    #edit-panel {
        top: auto !important;
        bottom: 10px !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        flex-direction: row !important;
        flex-wrap: wrap;
        justify-content: center;
    }

    #edit-panel .edit-control {
        flex-basis: 100%;
        justify-content: center;
    }
    #edit-panel .edit-control label {
        width: auto;
        text-align: left;
    }
    #edit-panel input[type="number"] {
        max-width: 100px;
    }
    #edit-panel .edit-actions {
        flex-basis: 100%;
        justify-content: center;
    }

    #planwisewp-container .main-container header p {
        text-align: center !important;
    }
}
@media (min-width: 1025px) {
    #edit-panel #closeEditPanelBtn {
        display: block;
    }
}
@media (max-width: 768px) {
    .app-logo {
        height: 30px;
        width: auto;
    }
}