/**
 * Door Price Manager - Price Calculator Styles
 */

/* Calculator Wrapper */
.dpm-calculator-wrapper {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Calculator Container */
.dpm-calculator-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* Input Groups */
.dpm-input-group {
    display: flex;
    flex-direction: column;
}

.dpm-input-group label {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Dimension Select */
.dpm-dimension-select {
    padding: 12px 14px;
    border: 2px solid #0073aa;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.dpm-dimension-select:hover {
    border-color: #005a87;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.15);
}

.dpm-dimension-select:focus {
    outline: none;
    border-color: #005a87;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
    background-color: #f0f9ff;
}

.dpm-dimension-select option {
    padding: 8px;
    background: white;
    color: #333;
}

.dpm-dimension-select option:checked {
    background: linear-gradient(#0073aa, #0073aa);
    background-color: #0073aa !important;
    color: white;
}

/* Area Display */
.dpm-area-display {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px 14px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.dpm-area-display:hover {
    border-color: #0073aa;
}

.dpm-area-display label {
    font-weight: 600;
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dpm-area-value {
    font-size: 20px;
    font-weight: 700;
    color: #0073aa;
}

.dpm-area-value::after {
    content: ' m²';
    font-size: 12px;
    font-weight: 400;
    color: #666;
    margin-left: 4px;
}

/* Price Result Wrapper */
.dpm-price-result-wrapper {
    padding: 30px 20px;
    background: white;
    border: 2px solid #0073aa;
    border-radius: 8px;
    text-align: center;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1);
    transition: all 0.3s ease;
}

.dpm-price-result-wrapper.success-animation {
    animation: priceFlash 0.6s ease-out;
}

@keyframes priceFlash {
    0% {
        background: #e8f4f8;
        transform: scale(1);
    }
    50% {
        background: #e8f4f8;
        transform: scale(1.02);
    }
    100% {
        background: white;
        transform: scale(1);
    }
}

/* Price Result */
.dpm-price-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.dpm-price-label {
    font-size: 13px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dpm-price-value {
    font-size: 36px;
    font-weight: 700;
    color: #0073aa;
    line-height: 1;
    word-break: break-word;
}

/* Loading State */
.dpm-loading {
    color: #0073aa;
    font-weight: 600;
    font-size: 14px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.dpm-loading::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

/* Error State */
.dpm-error {
    color: #dc3545;
    font-weight: 600;
    font-size: 14px;
    padding: 10px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 10px 0;
    display: none;
}

.dpm-error::before {
    content: '⚠ ';
    font-size: 16px;
    margin-right: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dpm-calculator-wrapper {
        padding: 15px;
    }

    .dpm-calculator-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .dpm-price-value {
        font-size: 28px;
    }

    .dpm-price-result-wrapper {
        padding: 20px 15px;
        min-height: 90px;
    }
}

@media (max-width: 480px) {
    .dpm-calculator-wrapper {
        padding: 12px;
    }

    .dpm-input-group label {
        font-size: 12px;
    }

    .dpm-dimension-select {
        font-size: 13px;
        padding: 10px 12px;
    }

    .dpm-price-value {
        font-size: 24px;
    }

    .dpm-price-label {
        font-size: 12px;
    }
}

/* Quick Price Display */
.dpm-quick-price-display {
    padding: 15px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

.dpm-quick-dimensions {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.dpm-quick-price {
    font-size: 24px;
    font-weight: 700;
    color: #0073aa;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .dpm-calculator-wrapper {
        background: #2a2a2a;
        border-color: #444;
    }

    .dpm-dimension-select,
    .dpm-area-display {
        background: #333;
        color: #e0e0e0;
        border-color: #0073aa;
    }

    .dpm-dimension-select option {
        background: #333;
        color: #e0e0e0;
    }

    .dpm-price-result-wrapper {
        background: #2a2a2a;
        border-color: #0073aa;
    }

    .dpm-input-group label,
    .dpm-price-label,
    .dpm-quick-dimensions {
        color: #b0b0b0;
    }

    .dpm-error {
        background: #5a3c3c;
        border-color: #8a5c5c;
        color: #ffb3ba;
    }
}

/* Print Styles */
@media print {
    .dpm-calculator-wrapper {
        page-break-inside: avoid;
    }
}
