/**
 * Özdemir Makine - Sales-Oriented Features CSS
 * Price Calculator, Stock Counter, Live Visitors
 */

/* ==========================================
   1. PRICE CALCULATOR WIDGET
   ========================================== */
.price-calc-widget {
    position: fixed;
    bottom: 180px;
    left: 20px;
    z-index: 9989;
}

.price-calc-trigger {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-xl);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
    transition: all 0.3s ease;
    animation: calcPulse 2s infinite;
}

@keyframes calcPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 4px 30px rgba(245, 158, 11, 0.6); }
}

.price-calc-trigger:hover {
    transform: translateY(-3px) scale(1.02);
}

.calc-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.calc-text {
    text-align: left;
}

.calc-title {
    display: block;
    font-weight: 600;
    font-size: var(--text-sm);
}

.calc-desc {
    display: block;
    font-size: var(--text-xs);
    opacity: 0.9;
}

/* Price Calculator Modal */
.price-calc-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.price-calc-modal.active {
    opacity: 1;
    visibility: visible;
}

.price-calc-container {
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    max-width: 600px;
    width: 95%;
    max-height: 85vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.price-calc-modal.active .price-calc-container {
    transform: scale(1) translateY(0);
}

.price-calc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-6);
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.header-info {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 700;
    font-size: var(--text-lg);
}

.price-calc-close {
    background: rgba(255,255,255,0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    color: white;
    cursor: pointer;
}

.price-calc-body {
    padding: var(--space-6);
    max-height: 60vh;
    overflow-y: auto;
}

.calc-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.calc-step.active {
    display: block;
}

.calc-step h3 {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
    font-size: var(--text-lg);
}

.calc-step h3 i {
    color: var(--primary-500);
}

/* Machine Type Options */
.calc-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
}

.calc-option {
    cursor: pointer;
}

.calc-option input {
    display: none;
}

.option-card {
    padding: var(--space-4);
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all 0.2s;
}

.calc-option input:checked + .option-card {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.option-card i {
    font-size: 2rem;
    color: var(--primary-500);
    margin-bottom: var(--space-2);
}

.option-card span {
    display: block;
    font-weight: 600;
    margin-bottom: var(--space-1);
}

.option-card small {
    color: var(--text-tertiary);
    font-size: var(--text-xs);
}

/* Checkbox Options */
.calc-checkboxes {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.calc-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s;
}

.calc-checkbox:hover {
    border-color: var(--primary-300);
}

.calc-checkbox input {
    display: none;
}

.checkbox-mark {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s;
}

.calc-checkbox input:checked + .checkbox-mark {
    background: #f59e0b;
    border-color: #f59e0b;
}

.calc-checkbox input:checked + .checkbox-mark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-content {
    flex: 1;
}

.checkbox-content span {
    display: block;
    font-weight: 500;
}

.checkbox-content small {
    color: var(--success-600);
    font-weight: 600;
}

/* Price Result */
.price-result {
    text-align: center;
}

.price-breakdown {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border-light);
}

.breakdown-total {
    display: flex;
    justify-content: space-between;
    padding: var(--space-3) 0 0;
    font-size: var(--text-lg);
    font-weight: 700;
}

.breakdown-total span:last-child {
    color: #f59e0b;
    font-size: var(--text-xl);
}

#totalPriceDisplay.price-updated {
    animation: priceUpdate 0.5s ease;
}

@keyframes priceUpdate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); color: #10b981; }
}

.price-note {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-3);
    background: var(--info-50);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
    text-align: left;
}

.price-note i {
    color: var(--info-500);
    margin-top: 2px;
}

.price-note p {
    font-size: var(--text-sm);
    color: var(--info-700);
    margin: 0;
}

.price-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
}

/* Footer */
.price-calc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-6);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.step-indicators {
    display: flex;
    gap: var(--space-2);
}

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    background: var(--border-color);
    transition: all 0.3s;
}

.step-dot.active {
    background: #f59e0b;
    transform: scale(1.2);
}

.step-dot.completed {
    background: var(--success-500);
}

/* Quick Quote Button on Cards */
.quick-quote-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
}

/* ==========================================
   2. STOCK COUNTER BADGES
   ========================================== */
.stock-badge {
    position: absolute;
    top: var(--space-3);
    left: var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    z-index: 10;
    animation: slideIn 0.3s ease;
}

.stock-badge.low-stock {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #78350f;
}

.stock-badge.last-one {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.stock-badge.pulse {
    animation: stockPulse 1s ease;
}

@keyframes stockPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ==========================================
   3. LIVE VISITORS WIDGET
   ========================================== */
.live-visitors-widget {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9988;
}

.visitors-content {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--bg-card);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
}

.visitors-icon {
    position: relative;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--success-50);
    color: var(--success-600);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
}

.pulse-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: var(--success-500);
    border-radius: 50%;
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

.visitors-info {
    display: flex;
    flex-direction: column;
}

.visitors-count {
    font-weight: 700;
    font-size: var(--text-lg);
    line-height: 1;
    color: var(--text-primary);
}

.visitors-count.count-change {
    animation: countChange 0.5s ease;
}

@keyframes countChange {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); color: var(--success-500); }
    100% { transform: scale(1); }
}

.visitors-label {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

/* Viewer Notification */
.viewer-notification {
    position: fixed;
    bottom: 70px;
    left: 20px;
    background: var(--bg-card);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s ease;
    z-index: 9987;
}

.viewer-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.viewer-notification i {
    color: var(--primary-500);
}

/* Viewing Now Badge on Cards */
.viewing-now {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) 0;
    font-size: var(--text-xs);
    color: var(--success-600);
}

.viewing-dot {
    width: 6px;
    height: 6px;
    background: var(--success-500);
    border-radius: 50%;
    animation: pulseDot 2s infinite;
}

/* ==========================================
   4. URGENCY BANNERS
   ========================================== */
.urgency-banner {
    background: linear-gradient(90deg, #dc2626, #ef4444, #dc2626);
    background-size: 200% auto;
    animation: urgencyGradient 3s linear infinite;
    color: white;
    padding: var(--space-2) 0;
    text-align: center;
    position: relative;
    z-index: 1000;
}

@keyframes urgencyGradient {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.banner-text {
    font-size: var(--text-sm);
    font-weight: 500;
    transition: opacity 0.3s;
}

.banner-close {
    position: absolute;
    right: var(--space-4);
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.banner-close:hover {
    opacity: 1;
}

/* Detail Page Urgency */
.detail-urgency {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-4);
    margin-top: var(--space-4);
}

.urgency-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    font-size: var(--text-sm);
}

.urgency-item:not(:last-child) {
    border-bottom: 1px solid var(--border-light);
}

.urgency-item i {
    color: var(--warning-500);
    width: 20px;
}

/* ==========================================
   5. SOCIAL PROOF POPUPS
   ========================================== */
.social-proof-popup {
    position: fixed;
    bottom: 80px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    background: var(--bg-card);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-xl);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 320px;
    z-index: 9986;
    opacity: 0;
    transform: translateX(-100%);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.social-proof-popup.show {
    opacity: 1;
    transform: translateX(0);
}

.proof-avatar img {
    width: 45px;
    height: 45px;
    border-radius: var(--radius-full);
}

.proof-content {
    flex: 1;
}

.proof-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: 2px;
}

.proof-header strong {
    font-size: var(--text-sm);
}

.proof-location {
    font-size: 10px;
    color: var(--text-muted);
}

.proof-location i {
    font-size: 8px;
}

.proof-action {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.proof-time {
    font-size: 10px;
    color: var(--text-muted);
}

.proof-close {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 10px;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    .price-calc-widget {
        bottom: auto;
        top: 50%;
        left: -50px;
        transform: translateY(-50%) rotate(-90deg);
    }

    .calc-text {
        display: none;
    }

    .calc-options {
        grid-template-columns: 1fr;
    }

    .price-actions {
        flex-direction: column;
    }

    .live-visitors-widget {
        bottom: 10px;
        left: 10px;
    }

    .visitors-content {
        padding: var(--space-2) var(--space-3);
    }

    .social-proof-popup {
        bottom: 60px;
        left: 10px;
        right: 10px;
        max-width: none;
    }

    .urgency-banner {
        font-size: var(--text-xs);
    }
}

