/**
 * Configurator Simplu - Styles
 * Mobile-first responsive design
 */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    padding: 0;
}

/* Header */
.header {
    background: #fff;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

/* Layout Grid */
.layout {
    display: grid;
    grid-template-columns: 320px 1fr 280px;
    height: calc(100vh - 303px);
    min-height: 520px;
    gap: 0;
}

/* Panels */
.panel {
    background: #fff;
    padding: 20px;
    overflow-y: auto;
}

.panel-left {
    border-right: 1px solid #e0e0e0;
}

.panel-center {
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-right {
    border-left: 1px solid #e0e0e0;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
}

.form-control:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Button Select */
.btn-select {
    width: 100%;
    padding: 12px 16px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-select:hover {
    border-color: #3498db;
    background: #f8f9fa;
}

.btn-select::after {
    content: '▼';
    font-size: 12px;
    color: #7f8c8d;
}

/* Selection Display - Layout compact orizontal */
.selection-display {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.selection-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px;
    background: #fff;
    object-fit: contain;
}

.selection-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.3;
}

.btn-change {
    flex-shrink: 0;
    padding: 6px 16px;
    background: #3498db;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-change:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
}

.btn-change:active {
    transform: translateY(0);
}

.btn-secondary {
    padding: 10px 16px;
    background: #6c757d;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(108, 117, 125, 0.3);
}

.btn-secondary:active {
    background: #545b62;
    transform: translateY(0);
}

/* Dimensions Section */
.dimensions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.dimension-input {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.input-label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
}

.dimension-field {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: border-color 0.2s;
}

.dimension-field:focus {
    outline: none;
    border-color: #3498db;
}

.dimension-field.error {
    border-color: #e74c3c;
    background-color: #fff5f5;
}

.dimension-range {
    font-size: 11px;
    color: #7f8c8d;
    margin-top: 2px;
}

.dimension-range.error {
    color: #e74c3c;
}

/* Frame Extenders */
.frame-extenders {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

.section-label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    display: block;
}

.extenders-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.extender-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.extender-item label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
}

.extender-select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
}

.extender-select:focus {
    outline: none;
    border-color: #3498db;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #7f8c8d;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #2c3e50;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

/* Window Type Grid (în modal) */
.window-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.window-type-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    display: flex;
    flex-direction: column;
    position: relative;
    aspect-ratio: 1;
}

.window-type-card:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
    transform: translateY(-2px);
}

.window-type-card.selected {
    border-color: #3498db;
    background: #e3f2fd;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.window-type-image {
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.window-type-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

.window-type-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: transparent;
    padding: 6px 8px;
    text-align: center;
}

.window-type-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 11px;
    line-height: 1.2;
    text-shadow: 0 0 3px rgba(255,255,255,0.8), 0 0 5px rgba(255,255,255,0.6);
}

/* Tooltip pentru window types */
.window-type-tooltip {
    position: absolute;
    bottom: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: #fff;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    white-space: normal;
    min-width: 200px;
    max-width: 400px;
    text-align: center;
    line-height: 1.5;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.window-type-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #2c3e50;
}

.window-type-card:hover .window-type-tooltip {
    opacity: 1;
}

/* Profile Grid (Button Cards) */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.profile-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    display: flex;
    flex-direction: column;
    position: relative;
    aspect-ratio: 1;
}

.profile-card:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
    transform: translateY(-2px);
    z-index: 10002;
}

.profile-card.selected {
    border-color: #3498db;
    background: #e3f2fd;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.profile-image {
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

.profile-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: transparent;
    padding: 6px 8px;
    text-align: center;
}

.profile-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 11px;
    line-height: 1.2;
    text-shadow: 0 0 3px rgba(255,255,255,0.8), 0 0 5px rgba(255,255,255,0.6);
}

.profile-details {
    display: none;
}

/* Tooltip */
.profile-tooltip {
    position: absolute;
    bottom: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: #fff;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    white-space: normal;
    min-width: 200px;
    max-width: 400px;
    text-align: center;
    line-height: 1.5;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 10003;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.profile-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #2c3e50;
}

.profile-card:hover .profile-tooltip {
    opacity: 1;
}

/* Profile tooltips extend outside their cards; do not clip them at the
   scrollable modal body boundary. This override is intentionally scoped. */
#profile-modal .modal-content,
#profile-modal .modal-body,
#profile-modal .profile-grid {
    overflow: visible;
}

.loading-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .profile-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

/* Inline editor shown directly over an SVG dimension label. */
.drawing-dimension-input {
    position: fixed;
    transform: translate(-50%, -50%);
    z-index: 20000;
    width: 76px;
    height: 32px;
    padding: 3px 6px;
    border: 2px solid #1687d9;
    border-radius: 2px;
    background: #fff;
    color: #222;
    font: 16px/1 Arial, sans-serif;
    text-align: center;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
    outline: none;
}

.drawing-dimension-input:focus {
    border-color: #0066cc;
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.18);
}

@media (max-width: 768px) {
    .drawing-dimension-input {
        width: 88px;
        height: 40px;
        padding: 5px 8px;
        font-size: 18px;
    }
}

/* Headings */
h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

/* Summary */
.summary-item {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

/* Color Selection Styles */
.color-section {
    margin-top: 15px;
}

.color-label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.color-preview {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border: 2px solid #ddd;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
}

.color-preview.solid-color {
    background-size: auto;
}

.modal-color .modal-content {
    max-width: 900px;
}

.color-category {
    margin-bottom: 30px;
}

.category-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #3498db;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 10px;
}

.color-card {
    aspect-ratio: 1;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    background-size: cover;
    background-position: center;
    position: relative;
}

.color-card:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border-color: #3498db;
}

.color-card.selected {
    border-color: #3498db;
    border-width: 3px;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.3);
}

.color-card.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: #fff;
    text-shadow: 0 0 3px rgba(0,0,0,0.5);
}

.custom-ral-input {
    max-width: 300px;
}

.custom-ral-input input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.custom-ral-input input:focus {
    outline: none;
    border-color: #0066cc;
}

/* =================================================================
   GLAZING STYLES
   ================================================================= */

/* Glazing Filters */
.glazing-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background: #f9f9f9;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #ddd;
    background: #fff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: #0066cc;
    background: #f0f7ff;
}

.filter-btn.active {
    background: #0066cc;
    color: #fff;
    border-color: #0066cc;
}

/* Glazing Grid */
.glazing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px;
}

/* Glazing Card */
.glazing-card {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.glazing-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #0066cc;
}

.glazing-card.selected {
    border-color: #0066cc;
    background: #f0f7ff;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.glazing-card.hidden {
    display: none;
}

.glazing-card-image {
    width: 100%;
    max-width: 150px;
    height: auto;
    margin-bottom: 10px;
}

.glazing-card-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    color: #2c3e50;
}

.glazing-card-specs {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.glazing-card-icons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
}

.glazing-icon {
    font-size: 18px;
}

.glazing-card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #0066cc;
    color: #fff;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.glazing-card-checkmark {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #0066cc;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.glazing-card.selected .glazing-card-checkmark {
    display: flex;
}

/* Modal Glazing */
.modal-glazing {
    max-width: 900px;
    max-height: 90vh;
}

.modal-glazing .modal-body {
    max-height: calc(90vh - 180px);
    overflow-y: auto;
}

/* ============================================================================
   HANDLE GRID STYLES
   ============================================================================ */

/* Modal Handle */
.modal-handle {
    max-width: 1000px;
    max-height: 90vh;
}

.modal-handle .modal-body {
    max-height: calc(90vh - 120px);
    overflow-y: auto;
    padding: 20px;
}

/* Handle Grid - Special Layout (7 rows × 5 columns) */
.handle-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    padding: 20px;
}

/* Handle Card */
.handle-card {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    position: relative;
}

.handle-card:hover {
    border-color: #0066cc;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2);
    transform: translateY(-2px);
}

.handle-card.selected {
    border-color: #0066cc;
    background: #f0f7ff;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.handle-card.empty {
    visibility: hidden;
    pointer-events: none;
}

/* Handle Card Image */
.handle-card-image {
    max-width: 100px;
    max-height: 120px;
    object-fit: contain;
    margin-bottom: 12px;
}

/* Handle Card Names */
.handle-card-type {
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 5px;
}

.handle-card-color {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.handle-card-price {
    font-size: 13px;
    font-weight: 600;
    color: #0066cc;
    margin-top: 5px;
}

/* Checkmark for selected handle */
.handle-card-checkmark {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #0066cc;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.handle-card.selected .handle-card-checkmark {
    display: flex;
}

/* Handle Grid Responsive - Tablets */
@media (max-width: 768px) {
    .handle-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        padding: 15px;
    }
    
    .handle-card {
        min-height: 160px;
        padding: 12px;
    }
    
    .handle-card-image {
        max-width: 80px;
        max-height: 100px;
    }
    
    .handle-card-type {
        font-size: 12px;
    }
    
    .handle-card-color {
        font-size: 11px;
    }
}

/* Handle Grid Responsive - Mobile */
@media (max-width: 480px) {
    .modal-handle {
        max-width: 100%;
    }
    
    .handle-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px;
    }
    
    .handle-card {
        min-height: 140px;
        padding: 10px;
    }
    
    .handle-card-image {
        max-width: 70px;
        max-height: 90px;
    }
    
    .handle-card-type {
        font-size: 11px;
    }
    
    .handle-card-color {
        font-size: 10px;
    }
    
    .handle-card-checkmark {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }
}

/* ============================================================================
   HARDWARE (BESCHLÄGE) STYLES
   ============================================================================ */

/* Hardware Modal */
.modal-hardware {
    max-width: 900px;
    max-height: 90vh;
}

.modal-hardware .modal-body {
    max-height: calc(90vh - 180px);
    overflow-y: auto;
}

/* Hardware Grid */
.hardware-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px;
}

/* Hardware Card */
.hardware-card {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    min-height: 220px;
}

.hardware-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #0066cc;
}

.hardware-card.selected {
    border-color: #0066cc;
    background: #f0f7ff;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.hardware-card-image {
    width: 100%;
    max-width: 150px;
    height: auto;
    margin-bottom: 10px;
}

.hardware-card-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    color: #2c3e50;
}

.hardware-card-price {
    font-size: 13px;
    color: #0066cc;
    font-weight: 500;
    margin-top: auto;
}

.hardware-card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #0066cc;
    color: #fff;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.hardware-card-checkmark {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #0066cc;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.hardware-card.selected .hardware-card-checkmark {
    display: flex;
}

/* Hardware Grid Responsive - Tablets */
@media (max-width: 768px) {
    .hardware-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 15px;
    }
    
    .hardware-card {
        min-height: 200px;
        padding: 12px;
    }
    
    .hardware-card-image {
        max-width: 120px;
    }
}

/* Hardware Grid Responsive - Mobile */
@media (max-width: 480px) {
    .modal-hardware {
        max-width: 100%;
    }
    
    .hardware-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px;
    }
    
    .hardware-card {
        min-height: 180px;
        padding: 10px;
    }
    
    .hardware-card-image {
        max-width: 100px;
    }
}

/* ========================================================================
   ORNAMENTAL GLASS SECTION
   ======================================================================== */

/* Ornamental Glass Section - Sub-section under Glazing */
.ornamental-glass-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.form-sublabel {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    display: block;
    margin-bottom: 8px;
}

.form-hint {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.4;
}

/* Interactive Opening Type Image Container */
.opening-type-interactive-container {
    position: relative;
    display: inline-block;
    max-width: 400px;
    width: 100%;
}

#opening-type-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* Hotspot Overlay - Container for all hotspot zones */
.hotspot-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Individual Hotspot Zone */
.hotspot-zone {
    position: absolute;
    border: 1px solid rgba(255, 0, 0, 0.6);
    background: transparent;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.2s ease;
    border-radius: 2px;
}

/* Hotspot Zone Hover State */
.hotspot-zone:hover {
    border: 2px solid rgba(255, 0, 0, 0.9);
    background: rgba(255, 0, 0, 0.15);
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.4);
}

/* Hotspot Zone Active/Selected State */
.hotspot-zone.selected {
    border: 2px solid rgba(0, 102, 204, 0.9);
    background: rgba(0, 102, 204, 0.15);
}

.hotspot-zone.selected:hover {
    border: 2px solid rgba(0, 102, 204, 1);
    background: rgba(0, 102, 204, 0.25);
}

/* Hotspot Zone Label */
.hotspot-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Ornamental Selection Summary */
.ornamental-summary {
    background: #fff;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.ornamental-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

.ornamental-summary-item:last-child {
    border-bottom: none;
}

.ornamental-summary-item .eye-number {
    font-weight: 600;
    color: #2c3e50;
    min-width: 60px;
}

.ornamental-summary-item .glass-type {
    color: #666;
}

.ornamental-summary-item .glass-type.selected {
    color: #0066cc;
    font-weight: 500;
}

/* Modal: Ornamental Glass */
.modal-ornamental-glass {
    max-width: 700px;
    width: 90%;
}

/* Ornamental Glass Grid */
.ornamental-glass-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
}

/* Ornamental Glass Card */
.ornamental-glass-card {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 160px;
}

.ornamental-glass-card:hover {
    border-color: #0066cc;
    background: #f0f7ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.15);
}

.ornamental-glass-card.selected {
    border-color: #0066cc;
    background: #e6f2ff;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.ornamental-glass-card.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    background: #0066cc;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.ornamental-glass-card-image {
    width: 100%;
    max-width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
    border: 1px solid #eee;
}

.ornamental-glass-card-name {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    margin-top: auto;
}

.ornamental-glass-card-price {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* Ornamental Glass Grid Responsive */
@media (max-width: 768px) {
    .ornamental-glass-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
        padding: 15px;
    }
    
    .ornamental-glass-card {
        min-height: 140px;
        padding: 10px;
    }
    
    .ornamental-glass-card-image {
        max-width: 80px;
        height: 80px;
    }
}

@media (max-width: 480px) {
    .modal-ornamental-glass {
        max-width: 100%;
    }
    
    .ornamental-glass-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px;
    }
    
    .ornamental-glass-card {
        min-height: 130px;
        padding: 8px;
    }
    
    .ornamental-glass-card-image {
        max-width: 70px;
        height: 70px;
    }
    
    .ornamental-glass-card-name {
        font-size: 13px;
    }
}

/* Responsive - Tablets */
@media (max-width: 768px) {
    .glazing-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
        padding: 15px;
    }
    
    .glazing-filters {
        padding: 10px 15px;
    }
    
    .filter-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* Responsive - Mobile */
@media (max-width: 480px) {
    .glazing-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 10px;
    }
    
    .glazing-card {
        padding: 10px;
    }
    
    .glazing-card-image {
        max-width: 100px;
    }
    
    .glazing-card-name {
        font-size: 12px;
    }
    
    .glazing-card-specs {
        font-size: 11px;
    }
    
    .glazing-filters {
        gap: 5px;
    }
    
    .filter-btn {
        font-size: 11px;
        padding: 5px 10px;
    }
}
    border-color: #3498db;
}

/* Responsive for color grid */
@media (max-width: 768px) {
    .color-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .color-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item strong {
    color: #555;
    display: block;
    margin-bottom: 4px;
}

.summary-item span {
    color: #333;
}

/* Drawing Placeholder */
.drawing-placeholder {
    text-align: center;
    color: #999;
}

.drawing-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.drawing-text {
    font-size: 16px;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .panel-left,
    .panel-right {
        border: none;
        border-bottom: 1px solid #ddd;
    }
    
    .panel-center {
        min-height: 500px;
        height: 60vh;
    }
    
    .drawing-area {
        padding: 8px;
    }
}

@media (min-width: 1025px) and (max-height: 850px) {
    .layout { height: 620px; }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .panel {
        padding: 15px;
    }
    
    h3 {
        font-size: 16px;
    }
    
    .panel-center {
        min-height: 400px;
        height: 50vh;
    }
    
    .drawing-area {
        padding: 5px;
    }
}

@media (max-width: 480px) {
    .panel {
        padding: 12px;
    }
    
    .form-label {
        font-size: 13px;
    }
    
    .form-control {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .panel-center {
        min-height: 350px;
        height: 45vh;
    }
    
    .drawing-area {
        padding: 3px;
    }
    
    .drawing-paper {
        box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    }
}
/* ==========================================
   GLAZING BARS (STEP 9) STYLES
   ========================================== */

/* Yes/No Toggle */
.glazing-bars-toggle {
    display: flex;
    gap: 20px;
    margin: 10px 0;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.radio-option input[type='radio'] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.radio-option span {
    user-select: none;
}

/* Configuration Container */
.glazing-bars-config {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.glazing-bars-section {
    margin-bottom: 20px;
}

.glazing-bars-section:last-child {
    margin-bottom: 0;
}

.section-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
}

.glazing-bars-description {
    font-size: 12px;
    color: #6c757d;
    margin: 5px 0 15px 0;
    font-style: italic;
}

/* Width Options (Radio Buttons) */
.glazing-bar-width-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.glazing-bar-width-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
}

.glazing-bar-width-option input[type='radio'] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

/* Number of Bars Grid */
.glazing-bars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.glazing-bar-eye-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.glazing-bar-eye-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #0066cc, #0052a3);
    color: white;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
    margin: 0 auto 5px;
    box-shadow: 0 2px 4px rgba(0,102,204,0.3);
}

.glazing-bar-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.glazing-bar-dropdown-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.glazing-bar-dropdown-label {
    font-size: 11px;
    color: #6c757d;
    text-align: center;
}

.glazing-bar-dropdown {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
    background: white;
    cursor: pointer;
}

.glazing-bar-dropdown:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 2px rgba(0,102,204,0.1);
}

/* ========================================
   DRAWING AREA (Window Rendering)
   ======================================== */

.drawing-area {
    background: #bfc5ce;
    overflow: auto;
    position: relative;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    width: 100%;
    height: 100%;
    padding: 20px;
}

.drawing-paper {
    width: 100%;
    max-width: 100%;
    min-height: 100%;
    background: #ffffff;
    border: 1px solid #7d8794;
    box-shadow: 0 4px 18px rgba(0,0,0,0.25);
    position: relative;
    display: block;
    overflow: visible;
}

.drawing-paper svg {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Keep old placeholder for reference (hidden) */
.drawing-placeholder {
    display: none;
}

/* Color Selection Display */
.color-selection-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.color-preview {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    border: 2px solid #dee2e6;
    background: #f8f9fa;
    flex-shrink: 0;
}

.color-name {
    flex: 1;
    font-size: 14px;
    color: #212529;
}

.btn-change-small {
    padding: 6px 12px;
    font-size: 13px;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-change-small:hover {
    background: #0052a3;
}

/* Color Grid in Modal */
.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    padding: 15px;
    max-height: 500px;
    overflow-y: auto;
}

.color-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.color-card:hover {
    border-color: #0066cc;
    box-shadow: 0 2px 8px rgba(0,102,204,0.2);
    transform: translateY(-2px);
}

.color-card.selected {
    border-color: #0066cc;
    background: #e6f2ff;
}

.color-card-preview {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    margin-bottom: 8px;
}

.color-card-name {
    font-size: 12px;
    text-align: center;
    color: #495057;
    word-break: break-word;
}

.color-card.selected .color-card-name {
    font-weight: 600;
    color: #0066cc;
}

/* Glazing Bar Count Modal */
.modal-small {
    max-width: 400px;
}

.glazing-bar-count-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px 0;
}

.glazing-bar-count-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.glazing-bar-count-form .form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
}

.glazing-bar-count-form .form-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.glazing-bar-count-form .form-select:hover {
    border-color: #0066cc;
}

.glazing-bar-count-form .form-select:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.glazing-bar-count-form .btn-primary {
    width: 100%;
    padding: 10px 20px;
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0,102,204,0.2);
}

.glazing-bar-count-form .btn-primary:hover {
    background: linear-gradient(135deg, #0052a3 0%, #004080 100%);
    box-shadow: 0 4px 8px rgba(0,102,204,0.3);
    transform: translateY(-1px);
}

.glazing-bar-count-form .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,102,204,0.2);
}

/* Glazing Bar Hotspot Indicator */
.glazing-bar-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 102, 204, 0.95);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

/* Glazing Bars Interactive Container (similar to ornamental glass) */
.glazing-bars-interactive-container {
    position: relative;
    display: inline-block;
    max-width: 400px;
    width: 100%;
    margin-top: 15px;
}

#glazing-bars-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* Responsive */
@media (max-width: 768px) {
    .glazing-bars-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 12px;
    }
    
    .color-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 10px;
    }
    
    .color-card-preview {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .glazing-bars-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .glazing-bar-width-options {
        flex-direction: column;
        gap: 10px;
    }
}
.facade-assistant-link{margin-left:auto;margin-right:14px;padding:8px 13px;border-radius:6px;background:#17a2b8;color:#fff;text-decoration:none;font-size:14px;font-weight:600}.facade-assistant-link:hover{background:#128496}@media(max-width:700px){.facade-assistant-link{order:3;width:100%;margin:8px 0 0;text-align:center}}
