/**
 * Terrasse Calculator CSS - 2 Column Layout
 * Kompatibel med Avada tema
 */

/* Container */
.terrasse-calculator-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    font-family: inherit;
}

/* 2-Kolonne Layout */
.tc-two-column-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 768px) {
    .tc-two-column-layout {
        grid-template-columns: 1fr;
    }
}

/* Kolonner */
.tc-left-column,
.tc-right-column {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tc-right-column {
    position: sticky;
    top: 100px;
}

@media (max-width: 768px) {
    .tc-right-column {
        position: static;
    }
}

/* Sektioner */
.tc-section {
    margin-bottom: 30px;
}

.tc-section h3 {
    color: #333;
    font-size: 20px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0066cc;
}

.tc-section h4 {
    color: #444;
    font-size: 16px;
    margin-bottom: 10px;
}

/* Type Buttons */
.tc-type-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.tc-type-btn {
    padding: 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.tc-type-btn:hover {
    border-color: #0066cc;
    background: #f0f8ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,102,204,0.2);
}

.tc-type-btn.active {
    border-color: #0066cc;
    background: #0066cc;
    color: #fff;
}

.tc-type-name {
    display: block;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
}

.tc-type-desc {
    display: block;
    font-size: 13px;
    opacity: 0.8;
}

/* Input Fields */
.tc-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.tc-input-group {
    display: flex;
    flex-direction: column;
}

.tc-input-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.tc-input,
input[type="number"].tc-input,
select.tc-glass-dropdown {
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
    line-height: 1.4;
    transition: border-color 0.3s;
    background: #fff;
    color: #333;
}

.tc-input:focus,
input[type="number"].tc-input:focus,
select.tc-glass-dropdown:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0,102,204,0.1);
}

.tc-dimension-range {
    display: block;
    font-size: 13px;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

/* Info Texts */
.tc-info-text {
    background: #f0f8ff;
    padding: 12px;
    border-left: 4px solid #0066cc;
    margin: 10px 0;
    font-size: 14px;
    color: #555;
}

.tc-included-text {
    background: #e8f5e9;
    padding: 12px;
    border-left: 4px solid #4caf50;
    margin: 10px 0;
    font-size: 14px;
    color: #2e7d32;
    font-weight: 600;
}

/* Glass Selection */
.tc-glass-section {
    margin-bottom: 20px;
}

.tc-glass-options {
    margin-top: 15px;
}

.tc-glass-options label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.tc-glass-dropdown {
    width: 100%;
    padding: 10px 12px !important;
    background-color: #fff !important;
    color: #333 !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
    height: auto !important;
    min-height: 42px;
}

.tc-glass-dropdown option {
    padding: 8px;
    background-color: #fff;
    color: #333;
}

/* Roof Type Section (Dynamisk tagtype section) */
.tc-roof-type-section {
    margin-bottom: 20px;
}

#tc-roof-type-selector-container {
    margin-bottom: 15px;
}

#tc-roof-type-selector-container label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

#tc-roof-type-select {
    width: 100%;
    padding: 10px 12px !important;
    background-color: #fff !important;
    color: #333 !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
    height: auto !important;
    min-height: 42px;
    border: 2px solid #ddd;
    border-radius: 4px;
}

#tc-roof-type-select:focus {
    border-color: #0066cc;
    outline: none;
}

#tc-roof-extras-container {
    margin-top: 15px;
}

#tc-roof-extras-container label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

#tc-roof-extras-select {
    width: 100%;
    padding: 10px 12px !important;
    background-color: #fff !important;
    color: #333 !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
    height: auto !important;
    min-height: 42px;
}

/* Extras */
.tc-extras-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tc-extra-item {
    padding: 12px;
    background: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    transition: background-color 0.2s;
}

.tc-extra-item:hover {
    background: #f0f0f0;
}

.tc-extra-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 10px;
}

.tc-extra-name {
    font-weight: 500;
}

.tc-extra-description {
    display: block;
    font-size: 13px;
    color: #666;
    margin-left: 30px;
    margin-top: 4px;
}

/* Quantity-baserede extras */
.tc-extra-quantity {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tc-extra-quantity label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tc-extra-price {
    font-weight: 600;
    color: #0066cc;
    font-size: 14px;
}

.tc-quantity-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tc-quantity-field,
input.tc-quantity-field,
input[type="number"].tc-quantity-field {
    width: 100px !important;
    padding: 10px 12px !important;
    border: 2px solid #4caf50 !important;
    border-radius: 4px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    text-align: center !important;
    transition: border-color 0.3s !important;
    background: #e8f5e9 !important;
    background-color: #e8f5e9 !important;
    color: #2e7d32 !important;
    box-shadow: none !important;
}

.tc-quantity-field:focus,
input.tc-quantity-field:focus,
input[type="number"].tc-quantity-field:focus {
    outline: none !important;
    border-color: #2e7d32 !important;
    box-shadow: 0 0 0 3px rgba(46,125,50,0.15) !important;
    background: #e8f5e9 !important;
    background-color: #e8f5e9 !important;
    color: #2e7d32 !important;
}

/* Tvinger scroll wheel til at være synlig på ALLE browsere */
.tc-quantity-field::-webkit-inner-spin-button,
.tc-quantity-field::-webkit-outer-spin-button,
input.tc-quantity-field::-webkit-inner-spin-button,
input.tc-quantity-field::-webkit-outer-spin-button {
    opacity: 1 !important;
    -webkit-appearance: auto !important;
    height: 32px !important;
    width: 16px !important;
    cursor: pointer !important;
    position: relative !important;
    display: inline-block !important;
}

/* Firefox */
.tc-quantity-field,
input.tc-quantity-field {
    -moz-appearance: auto !important;
}

/* Større på mobil/tablet med TYDELIGT scroll wheel */
@media (max-width: 1024px) {
    .tc-quantity-field,
    input.tc-quantity-field,
    input[type="number"].tc-quantity-field {
        width: 140px !important;
        padding: 14px !important;
        font-size: 20px !important;
        min-height: 56px !important;
    }
    
    .tc-quantity-field::-webkit-inner-spin-button,
    .tc-quantity-field::-webkit-outer-spin-button,
    input.tc-quantity-field::-webkit-inner-spin-button,
    input.tc-quantity-field::-webkit-outer-spin-button {
        height: 48px !important;
        width: 24px !important;
    }
}

.tc-quantity-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.tc-no-extras {
    padding: 20px;
    text-align: center;
    color: #666;
    background: #f9f9f9;
    border-radius: 4px;
    font-style: italic;
}

/* Color Info Box */
.tc-info-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 20px;
}

.tc-info-box h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #856404;
}

.tc-color-list {
    list-style: none;
    padding: 0;
    margin: 8px 0;
    line-height: 1.4;
}

.tc-color-list li {
    padding: 2px 0;
    color: #856404;
    line-height: 1.4;
}

.tc-color-note {
    font-style: italic;
    color: #856404;
    margin: 8px 0 0 0;
    line-height: 1.4;
}

/* Dimension Info - Kompakt og diskret design */
.tc-dimension-info-section {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 4px;
    margin-top: 12px;
    border: 1px solid #dee2e6;
}

.tc-dimension-info-section h4 {
    margin-top: 0;
    margin-bottom: 8px;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
}

.tc-dimension-info-box {
    background: transparent;
    padding: 0;
}

.tc-dim-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

@media (max-width: 768px) {
    .tc-dim-info-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

.tc-dim-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background: #fff;
    border-radius: 3px;
    border: 1px solid #e9ecef;
}

.tc-dim-info-label {
    font-weight: 500;
    color: #6c757d;
    font-size: 13px;
}

.tc-dim-info-value {
    font-weight: 600;
    color: #0066cc;
    font-size: 14px;
}

/* Actions */
.tc-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.tc-button {
    padding: 15px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tc-button-primary {
    background: #0066cc;
    color: #fff;
}

.tc-button-primary:hover {
    background: #0052a3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,102,204,0.3);
}

.tc-button-secondary {
    background: #f0f0f0;
    color: #333;
}

.tc-button-secondary:hover {
    background: #e0e0e0;
}

/* Right Column - Results */
.tc-right-column h3 {
    color: #333;
    font-size: 24px;
    margin-bottom: 20px;
}

/* Placeholder */
.tc-result-placeholder {
    background: #f9f9f9;
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 60px 30px;
    text-align: center;
}

.tc-placeholder-icon {
    font-size: 60px;
    margin-bottom: 20px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tc-money-icon {
    font-size: 60px;
}

.tc-type-image-wrapper {
    text-align: center;
}

.tc-type-image {
    max-width: 200px;
    max-height: 150px;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tc-type-image:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.tc-image-hint {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* Lightbox */
.tc-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

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

.tc-lightbox-content {
    position: relative;
    width: 100%;
    height: calc(100% - 180px);
    margin-top: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    box-sizing: border-box;
    z-index: 1000000;
}

.tc-lightbox-image-wrapper {
    position: relative;
    display: inline-block;
    max-width: none;
    max-height: none;
}

.tc-lightbox-close {
    position: absolute;
    top: 50%;
    left: calc(50% + 30vw + 20px);
    transform: translateY(-50%);
    background: #fff;
    border: 2px solid #333;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    color: #333;
    transition: all 0.2s ease;
    z-index: 1000001;
    box-shadow: 0 4px 16px rgba(0,0,0,0.6);
}

.tc-lightbox-close:hover {
    background: #f0f0f0;
    transform: translateY(-50%) scale(1.1);
}

#tc-lightbox-image {
    display: block;
    width: 60vw;
    max-width: 90vw;
    max-height: 85vh;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    object-fit: contain;
}

.tc-lightbox-caption {
    margin-top: 20px;
    color: #fff;
    font-size: 20px;
    font-weight: 500;
    text-align: center;
    text-shadow: 0 2px 6px rgba(0,0,0,0.7);
}

/* Mobile responsiveness for lightbox */
@media (max-width: 1024px) and (min-width: 769px) {
    /* Tablet - close knap øverst højre */
    .tc-lightbox-content {
        margin-top: 0;
        height: 100%;
    }
    
    .tc-lightbox-close {
        position: fixed;
        top: 30px;
        right: 30px;
        left: auto;
        transform: none;
    }
    
    .tc-lightbox-close:hover {
        transform: scale(1.1);
    }
}

@media (max-width: 768px) {
    .tc-lightbox-content {
        margin-top: 0;
        height: 100%;
        padding: 30px 10px;
    }
    
    .tc-lightbox-close {
        position: fixed;
        top: 20px;
        right: 20px;
        left: auto;
        transform: none;
        width: 55px;
        height: 55px;
        font-size: 32px;
    }
    
    .tc-lightbox-close:hover {
        transform: scale(1.1);
    }
    
    #tc-lightbox-image {
        width: 85vw;
        max-width: 95vw;
        max-height: 80vh;
    }
    
    .tc-lightbox-caption {
        font-size: 18px;
        margin-top: 15px;
    }
}

.tc-placeholder-content p {
    color: #666;
    font-size: 16px;
}

/* Result */
.tc-result {
    background: #fff;
}

.tc-messages {
    margin-bottom: 20px;
}

.tc-message {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.tc-message-info {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    color: #1565c0;
}

/* Messages */
.tc-messages {
    margin-bottom: 20px;
}

.tc-message {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tc-message::before {
    font-size: 18px;
}

.tc-message-info {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    color: #1565c0;
}

.tc-message-info::before {
    content: "ℹ️";
}

.tc-message-error {
    background: #ffebee;
    border-left: 4px solid #f44336;
    color: #c62828;
}

.tc-message-error::before {
    content: "⚠️";
}

.tc-message-persistent {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
    font-weight: 500;
}

.tc-message-persistent::before {
    content: "📏";
}

/* Breakdown */
.tc-breakdown {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 6px;
    margin: 20px 0;
}

.tc-breakdown-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.tc-breakdown-row:last-child {
    border-bottom: none;
}

.tc-breakdown-label {
    font-weight: 500;
    color: #555;
}

.tc-breakdown-price {
    font-weight: 600;
    color: #0066cc;
}

/* Total */
.tc-total {
    background: #0066cc;
    color: #fff;
    padding: 20px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
}

.tc-total-label {
    font-size: 18px;
    font-weight: 600;
}

.tc-total-price {
    font-size: 32px;
    font-weight: 700;
}

/* Contact Section */
.tc-contact-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.tc-contact-section h4 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.tc-button-contact {
    display: block;
    width: 100%;
    background: #4caf50;
    color: #fff;
    padding: 16px 24px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s;
}

.tc-button-contact:hover {
    background: #45a049;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* Loading State */
.tc-loading {
    opacity: 0.6;
    pointer-events: none;
}

.tc-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0066cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .tc-left-column,
    .tc-right-column {
        padding: 20px;
    }
    
    .tc-input-row {
        grid-template-columns: 1fr;
    }
    
    .tc-actions {
        flex-direction: column;
    }
    
    .tc-button {
        width: 100%;
    }
    
    .tc-type-buttons {
        grid-template-columns: 1fr;
    }
    
    /* Total pris - reduceret på mobil */
    .tc-total {
        padding: 16px;
        gap: 10px;
    }
    
    .tc-total-label {
        font-size: 15px;
        flex: 1;
        min-width: 0;
    }
    
    .tc-total-price {
        font-size: 20px;
        white-space: nowrap;
        text-align: right;
    }
    
    /* Breakdown priser - højrestillet med kr. efter beløbet */
    .tc-breakdown-price {
        text-align: right;
        white-space: nowrap;
    }
}

/* Tablet landscape (769-1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .tc-total {
        padding: 18px;
    }
    
    .tc-total-label {
        font-size: 16px;
    }
    
    .tc-total-price {
        font-size: 26px;
    }
}

/* Mobile landscape (481-768px landscape) */
@media (max-width: 768px) and (orientation: landscape) {
    .tc-total {
        padding: 14px;
    }
    
    .tc-total-label {
        font-size: 14px;
    }
    
    .tc-total-price {
        font-size: 18px;
    }
}

/* Mobile portrait - extra small (< 480px) */
@media (max-width: 480px) {
    .tc-total {
        padding: 14px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .tc-total-label {
        font-size: 14px;
    }
    
    .tc-total-price {
        font-size: 22px;
        align-self: flex-end;
    }
}

/* Avada Theme Compatibility */
.fusion-body .terrasse-calculator-wrapper {
    margin-top: 0;
}

.fusion-body .tc-button {
    font-family: inherit;
}

/* ULTRA-SPECIFIK CSS FOR QUANTITY FIELD - OVERSKRIVER AVADA */
.terrasse-calculator-wrapper .tc-extras-list .tc-extra-item.tc-extra-quantity .tc-quantity-input input.tc-quantity-field,
.terrasse-calculator-wrapper .tc-extras-list .tc-extra-item.tc-extra-quantity .tc-quantity-input input[type="number"].tc-quantity-field,
.fusion-body .terrasse-calculator-wrapper .tc-extras-list .tc-extra-item.tc-extra-quantity .tc-quantity-input input.tc-quantity-field,
.fusion-body .terrasse-calculator-wrapper .tc-extras-list .tc-extra-item.tc-extra-quantity .tc-quantity-input input[type="number"].tc-quantity-field {
    width: 100px !important;
    padding: 10px 12px !important;
    border: 2px solid #4caf50 !important;
    border-radius: 4px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    text-align: center !important;
    background: #e8f5e9 !important;
    background-color: #e8f5e9 !important;
    color: #2e7d32 !important;
    box-shadow: none !important;
    line-height: normal !important;
}

.terrasse-calculator-wrapper .tc-extras-list .tc-extra-item.tc-extra-quantity .tc-quantity-input input.tc-quantity-field:focus,
.terrasse-calculator-wrapper .tc-extras-list .tc-extra-item.tc-extra-quantity .tc-quantity-input input[type="number"].tc-quantity-field:focus,
.fusion-body .terrasse-calculator-wrapper .tc-extras-list .tc-extra-item.tc-extra-quantity .tc-quantity-input input.tc-quantity-field:focus,
.fusion-body .terrasse-calculator-wrapper .tc-extras-list .tc-extra-item.tc-extra-quantity .tc-quantity-input input[type="number"].tc-quantity-field:focus {
    outline: none !important;
    border-color: #2e7d32 !important;
    box-shadow: 0 0 0 3px rgba(46,125,50,0.15) !important;
    background: #e8f5e9 !important;
    background-color: #e8f5e9 !important;
    color: #2e7d32 !important;
}

@media (max-width: 1024px) {
    .terrasse-calculator-wrapper .tc-extras-list .tc-extra-item.tc-extra-quantity .tc-quantity-input input.tc-quantity-field,
    .terrasse-calculator-wrapper .tc-extras-list .tc-extra-item.tc-extra-quantity .tc-quantity-input input[type="number"].tc-quantity-field,
    .fusion-body .terrasse-calculator-wrapper .tc-extras-list .tc-extra-item.tc-extra-quantity .tc-quantity-input input.tc-quantity-field,
    .fusion-body .terrasse-calculator-wrapper .tc-extras-list .tc-extra-item.tc-extra-quantity .tc-quantity-input input[type="number"].tc-quantity-field {
        width: 140px !important;
        padding: 14px !important;
        font-size: 20px !important;
        min-height: 56px !important;
    }
}
