/**
 * SmartHome Price Calculator Styles
 * Štýly pre real-time cenový kalkul átor
 */

/* ========================================
   Live Price Widget
   ======================================== */

.smarthome-live-price-widget {
    position: sticky;
    top: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.smarthome-live-price-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.4);
}

.smarthome-live-price-widget .widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.smarthome-live-price-widget .widget-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.smarthome-live-price-widget .live-indicator {
    color: #4ade80;
    font-size: 12px;
    animation: pulse 2s infinite;
}

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

.smarthome-live-price-widget .main-price {
    text-align: center;
    margin: 20px 0;
}

.smarthome-live-price-widget .live-price-amount {
    font-size: 48px;
    font-weight: 700;
    display: block;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.smarthome-live-price-widget .live-price-amount.price-updating {
    opacity: 0.6;
    transform: scale(0.95);
}

.smarthome-live-price-widget .live-price-amount.price-updated {
    animation: priceUpdate 0.5s ease;
}

@keyframes priceUpdate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.smarthome-live-price-widget .price-breakdown-mini {
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
}

.smarthome-live-price-widget .breakdown-line {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.smarthome-live-price-widget .breakdown-line.discount {
    color: #4ade80;
    font-weight: 600;
}

.smarthome-live-price-widget .breakdown-line:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========================================
   Price Breakdown
   ======================================== */

.price-breakdown-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.price-breakdown-section h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.price-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.price-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.price-line:hover {
    background: #f3f4f6;
    transform: translateX(4px);
}

.price-line.subtotal {
    background: #e5e7eb;
    font-weight: 600;
    border-top: 2px solid #d1d5db;
    margin-top: 8px;
}

.price-line.grand-total {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 700;
    font-size: 18px;
    padding: 16px;
    margin-top: 12px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.price-line.grand-total .price-value {
    color: white !important;
    font-size: 24px;
}

.price-line.total-discount {
    background: #dcfce7;
    color: #166534;
    font-weight: 600;
}

.price-line.discount-item {
    background: #f0fdf4;
}

.price-label {
    font-size: 14px;
    color: #4b5563;
    flex: 1;
}

.price-line.grand-total .price-label {
    color: white;
    font-size: 16px;
}

.price-value {
    font-weight: 600;
    font-size: 16px;
    color: #1f2937;
    white-space: nowrap;
}

.price-value.positive {
    color: #1f2937;
}

.price-value.negative {
    color: #059669;
}

.price-line.category-item,
.price-line.room-item {
    padding-left: 24px;
    font-size: 14px;
}

/* ========================================
   Price Limit Progress Bar
   ======================================== */

.price-limit-progress {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.price-limit-progress .progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
}

.price-limit-progress .progress-bar {
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.price-limit-progress .progress-fill {
    height: 100%;
    transition: width 0.5s ease, background 0.3s ease;
    border-radius: 6px;
}

.price-limit-progress .progress-fill.good {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.price-limit-progress .progress-fill.warning {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.price-limit-progress .progress-fill.danger {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

/* ========================================
   Price Loading States
   ======================================== */

.price-loading,
.price-error {
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    font-size: 14px;
}

.price-loading {
    background: #f9fafb;
    color: #6b7280;
}

.price-loading::after {
    content: '...';
    animation: dots 1.5s infinite;
}

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

.price-error {
    background: #fee2e2;
    color: #991b1b;
}

/* ========================================
   Discount Section
   ======================================== */

.discount-section {
    border: 2px dashed #4ade80;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.discount-section h4 {
    color: #166534;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .smarthome-live-price-widget {
        position: relative;
        top: 0;
    }

    .smarthome-live-price-widget .live-price-amount {
        font-size: 36px;
    }

    .price-line {
        padding: 10px;
        font-size: 13px;
    }

    .price-value {
        font-size: 14px;
    }

    .price-line.grand-total {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .price-line.grand-total .price-value {
        font-size: 20px;
    }
}

/* ========================================
   Dark Mode Support
   ======================================== */

@media (prefers-color-scheme: dark) {
    .price-breakdown-section {
        background: #1f2937;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    .price-breakdown-section h4 {
        color: #f9fafb;
    }

    .price-line {
        background: #374151;
        color: #f9fafb;
    }

    .price-line:hover {
        background: #4b5563;
    }

    .price-label {
        color: #d1d5db;
    }

    .price-value {
        color: #f9fafb;
    }

    .price-loading {
        background: #374151;
        color: #9ca3af;
    }
}

/* ========================================
   Animation Enhancements
   ======================================== */

.price-breakdown-section {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .smarthome-live-price-widget .live-indicator,
    .smarthome-live-price-widget .widget-header {
        display: none;
    }

    .smarthome-live-price-widget {
        box-shadow: none;
        background: white;
        color: black;
        border: 2px solid #e5e7eb;
    }

    .price-line:hover {
        transform: none;
    }
}
