/**
 * Professional Quote System V21.0.0
 * Modern, Excel-like interface with advanced controls
 * 
 * @version 21.0.0
 * @author Adam Ramadan
 */

/* ========================================
   PRICING CONTROL PANEL
   ======================================== */

.pricing-control-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
    color: white;
}

.pricing-control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.pricing-control-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.pricing-control-actions {
    display: flex;
    gap: 10px;
}

.pricing-preset-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.preset-btn {
    padding: 10px 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    font-size: 14px;
}

.preset-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.preset-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
}

.pricing-controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.pricing-control-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.pricing-control-section h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.9;
}

.pricing-slider-group {
    margin-bottom: 15px;
}

.pricing-slider-group:last-child {
    margin-bottom: 0;
}

.pricing-slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
}

.pricing-slider-value {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 14px;
    min-width: 60px;
    text-align: center;
}

.pricing-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 5px;
}

.pricing-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
}

.pricing-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.pricing-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.pricing-input-group {
    margin-bottom: 15px;
}

.pricing-input-group:last-child {
    margin-bottom: 0;
}

.pricing-input-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
}

.pricing-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s;
}

.pricing-input:focus {
    outline: none;
    border-color: white;
    background: rgba(255, 255, 255, 0.25);
}

.pricing-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Live Preview Panel */
.pricing-live-preview {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.pricing-live-preview h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-tier {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-tier:last-child {
    border-bottom: none;
}

.preview-tier-label {
    font-size: 13px;
    opacity: 0.9;
}

.preview-tier-value {
    font-size: 16px;
    font-weight: 700;
}

/* Quick Actions */
.pricing-quick-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.quick-action-btn {
    flex: 1;
    min-width: 140px;
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.quick-action-btn:hover {
    background: white;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ========================================
   HISTORY & UNDO/REDO CONTROLS
   ======================================== */

.history-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
}

.history-btn {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.history-btn:hover:not(:disabled) {
    background: #e9ecef;
    border-color: #adb5bd;
}

.history-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.history-counter {
    padding: 8px 16px;
    background: white;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    border: 1px solid #dee2e6;
}

.unsaved-indicator {
    padding: 8px 16px;
    background: #fff3cd;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #856404;
    display: none;
}

.history-dropdown {
    position: relative;
}

.history-dropdown-btn {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.history-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

.history-dropdown.active .history-dropdown-content {
    display: block;
}

.history-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f3f5;
    cursor: pointer;
    transition: background 0.2s;
}

.history-item:hover {
    background: #f8f9fa;
}

.history-item.current {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.history-item-action {
    font-weight: 600;
    color: #212529;
    margin-bottom: 4px;
}

.history-item-time {
    font-size: 12px;
    color: #6c757d;
}

/* ========================================
   VISUAL PRICE CARDS
   ======================================== */

.price-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.price-card {
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.price-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.price-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.price-card.gpl {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #2c3e50;
}

.price-card.gpl::before {
    background: #3498db;
}

.price-card.disti {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    color: #2d3436;
}

.price-card.disti::before {
    background: #f39c12;
}

.price-card.partner {
    background: linear-gradient(135deg, #a8e6cf 0%, #3dc9b0 100%);
    color: #00695c;
}

.price-card.partner::before {
    background: #00bfa5;
}

.price-card.eu {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.price-card.eu::before {
    background: #ffffff;
}

.price-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.price-card-icon {
    font-size: 24px;
}

.price-card-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.price-card-value {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
    line-height: 1;
}

.price-card-subvalue {
    font-size: 18px;
    font-weight: 600;
    opacity: 0.8;
    margin-bottom: 12px;
}

.price-card-action {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.price-card-action:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ========================================
   ADVANCED FILTERS
   ======================================== */

.advanced-filters {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 6px;
}

.filter-input,
.filter-select {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.saved-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.saved-filter-chip {
    padding: 6px 12px;
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #1976d2;
    cursor: pointer;
    transition: all 0.2s;
}

.saved-filter-chip:hover {
    background: #2196f3;
    color: white;
}

.saved-filter-chip.active {
    background: #2196f3;
    color: white;
}

/* ========================================
   KEYBOARD SHORTCUTS INDICATOR
   ======================================== */

.keyboard-shortcuts {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    font-size: 12px;
    z-index: 9999;
    max-width: 300px;
    display: none;
}

.keyboard-shortcuts.show {
    display: block;
}

.keyboard-shortcuts h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 700;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.shortcut-key {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 11px;
}

/* ========================================
   PRICING SCENARIOS COMPARISON
   ======================================== */

.scenarios-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.scenario-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #dee2e6;
    transition: all 0.3s;
}

.scenario-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.scenario-card.active {
    border-color: #667eea;
    background: #f8f9ff;
}

.scenario-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #dee2e6;
}

.scenario-title {
    font-size: 16px;
    font-weight: 700;
    color: #212529;
}

.scenario-badge {
    padding: 4px 12px;
    background: #667eea;
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.scenario-settings {
    margin-bottom: 15px;
}

.scenario-setting {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
}

.scenario-setting-label {
    color: #6c757d;
}

.scenario-setting-value {
    font-weight: 600;
    color: #212529;
}

.scenario-result {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

.scenario-result-label {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 4px;
}

.scenario-result-value {
    font-size: 24px;
    font-weight: 800;
    color: #212529;
}

.scenario-actions {
    display: flex;
    gap: 8px;
}

.scenario-btn {
    flex: 1;
    padding: 8px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}

.scenario-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .pricing-controls-grid {
        grid-template-columns: 1fr;
    }
    
    .price-cards-container {
        grid-template-columns: 1fr;
    }
    
    .scenarios-container {
        grid-template-columns: 1fr;
    }
    
    .filter-row {
        grid-template-columns: 1fr;
    }
    
    .pricing-quick-actions {
        flex-direction: column;
    }
    
    .quick-action-btn {
        min-width: 100%;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */

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

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

.animate-in {
    animation: slideIn 0.3s ease-out;
}

.pulse {
    animation: pulse 2s infinite;
}

/* ========================================
   DARK MODE SUPPORT
   ======================================== */

@media (prefers-color-scheme: dark) {
    .advanced-filters {
        background: #1a1a1a;
        border-color: #333;
    }
    
    .filter-input,
    .filter-select {
        background: #2a2a2a;
        border-color: #444;
        color: white;
    }
    
    .scenario-card {
        background: #1a1a1a;
        border-color: #333;
        color: white;
    }
    
    .scenario-result {
        background: #2a2a2a;
    }
}
