/**
 * Caller ID Popup Stilleri
 * Orderly Restoran Yönetim Sistemi
 * 
 * Netgsm Caller ID entegrasyonu için popup stilleri.
 * Modern, animasyonlu ve responsive tasarım.
 */

/* ========================================
   CALLER ID POPUP CONTAINER
   ======================================== */
.callerid-popup-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    pointer-events: none;
}

.callerid-popup-container::-webkit-scrollbar {
    width: 4px;
}

.callerid-popup-container::-webkit-scrollbar-track {
    background: transparent;
}

.callerid-popup-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

/* ========================================
   CALLER ID POPUP CARD
   ======================================== */
.callerid-popup {
    width: 380px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    box-shadow: 
        0 20px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(0, 0, 0, 0.05),
        0 0 30px rgba(254, 100, 71, 0.15);
    overflow: hidden;
    pointer-events: auto;
    animation: calleridSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: top right;
}

.callerid-popup.callerid-popup-dismissing {
    animation: calleridSlideOut 0.3s ease-in forwards;
}

@keyframes calleridSlideIn {
    0% {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes calleridSlideOut {
    0% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }
}

/* ========================================
   POPUP HEADER
   ======================================== */
.callerid-popup-header {
    background: linear-gradient(135deg, #fe6447 0%, #ff7a5c 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.callerid-popup-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: calleridPulse 2s infinite;
}

@keyframes calleridPulse {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

.callerid-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.callerid-icon-wrapper {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: calleridRing 1s ease-in-out infinite;
}

@keyframes calleridRing {
    0%, 100% {
        transform: rotate(0deg);
    }
    10%, 30% {
        transform: rotate(-15deg);
    }
    20%, 40% {
        transform: rotate(15deg);
    }
    50%, 100% {
        transform: rotate(0deg);
    }
}

.callerid-icon-wrapper i {
    font-size: 22px;
    color: #fff;
}

.callerid-header-info {
    display: flex;
    flex-direction: column;
}

.callerid-header-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.callerid-header-time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 2px;
}

.callerid-close-btn {
    position: relative;
    z-index: 1;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.callerid-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* ========================================
   POPUP BODY
   ======================================== */
.callerid-popup-body {
    padding: 20px;
}

/* Telefon numarası */
.callerid-phone-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px dashed #e2e8f0;
}

.callerid-phone-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.callerid-phone-icon i {
    font-size: 24px;
    color: #fff;
}

.callerid-phone-info {
    flex: 1;
}

.callerid-phone-number {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: 1px;
}

.callerid-phone-label {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

/* Müşteri bilgileri */
.callerid-customer-section {
    margin-bottom: 16px;
}

.callerid-customer-known {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #a7f3d0;
    border-radius: 12px;
    padding: 14px 16px;
}

.callerid-customer-unknown {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #fcd34d;
    border-radius: 12px;
    padding: 14px 16px;
}

.callerid-customer-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.callerid-customer-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 20px;
}

.callerid-customer-known .callerid-customer-badge {
    background: #10b981;
    color: #fff;
}

.callerid-customer-unknown .callerid-customer-badge {
    background: #f59e0b;
    color: #fff;
}

.callerid-customer-name {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.callerid-customer-address {
    font-size: 13px;
    color: #475569;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.4;
}

.callerid-customer-address i {
    margin-top: 2px;
    color: #64748b;
}

/* Son siparişler */
.callerid-orders-section {
    margin-bottom: 16px;
}

.callerid-orders-title {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.callerid-orders-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.callerid-order-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
}

.callerid-order-date {
    color: #64748b;
}

.callerid-order-amount {
    font-weight: 600;
    color: #1e293b;
}

/* Yeni müşteri formu */
.callerid-new-customer-form {
    display: none;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.callerid-new-customer-form.show {
    display: flex;
}

.callerid-form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.callerid-form-group label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.callerid-form-group input,
.callerid-form-group textarea {
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    transition: all 0.2s ease;
}

.callerid-form-group input:focus,
.callerid-form-group textarea:focus {
    outline: none;
    border-color: #fe6447;
    box-shadow: 0 0 0 3px rgba(254, 100, 71, 0.1);
}

.callerid-form-group textarea {
    resize: none;
    min-height: 60px;
}

/* Adres seçimi */
.callerid-address-select {
    margin-bottom: 16px;
}

.callerid-address-select label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    display: block;
    margin-bottom: 8px;
}

.callerid-address-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.callerid-address-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.callerid-address-option:hover {
    border-color: #fe6447;
    background: #fff;
}

.callerid-address-option.selected {
    border-color: #fe6447;
    background: linear-gradient(135deg, #fff5f3 0%, #fff 100%);
}

.callerid-address-option input[type="radio"] {
    display: none;
}

.callerid-address-radio {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.callerid-address-option.selected .callerid-address-radio {
    border-color: #fe6447;
}

.callerid-address-option.selected .callerid-address-radio::after {
    content: '';
    width: 10px;
    height: 10px;
    background: #fe6447;
    border-radius: 50%;
}

.callerid-address-text {
    flex: 1;
    font-size: 13px;
    color: #1e293b;
    line-height: 1.4;
}

.callerid-address-title {
    font-weight: 600;
    color: #fe6447;
    margin-right: 4px;
}

/* ========================================
   POPUP FOOTER / ACTIONS
   ======================================== */
.callerid-popup-actions {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.callerid-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.callerid-btn-primary {
    background: linear-gradient(135deg, #fe6447 0%, #ff7a5c 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(254, 100, 71, 0.3);
}

.callerid-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(254, 100, 71, 0.4);
}

.callerid-btn-primary:active {
    transform: translateY(0);
}

.callerid-btn-secondary {
    background: #fff;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.callerid-btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.callerid-btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.callerid-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.callerid-btn i {
    font-size: 16px;
}

.callerid-btn-loading {
    pointer-events: none;
    opacity: 0.7;
}

.callerid-btn-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 480px) {
    .callerid-popup-container {
        top: 70px;
        right: 10px;
        left: 10px;
    }
    
    .callerid-popup {
        width: 100%;
    }
    
    .callerid-phone-number {
        font-size: 18px;
    }
    
    .callerid-popup-actions {
        flex-direction: column;
    }
}

/* ========================================
   CALLER ID INDICATOR (Header'da)
   ======================================== */
.callerid-indicator {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.callerid-indicator-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: #fe6447;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    animation: calleridBadgePulse 1.5s ease-in-out infinite;
}

@keyframes calleridBadgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.callerid-indicator-badge:empty {
    display: none;
}

/* ========================================
   CALLER ID SOUND INDICATOR
   ======================================== */
.callerid-sound-wave {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 8px;
}

.callerid-sound-wave span {
    width: 3px;
    height: 12px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 2px;
    animation: calleridSoundWave 0.5s ease-in-out infinite;
}

.callerid-sound-wave span:nth-child(1) { animation-delay: 0s; }
.callerid-sound-wave span:nth-child(2) { animation-delay: 0.1s; }
.callerid-sound-wave span:nth-child(3) { animation-delay: 0.2s; }
.callerid-sound-wave span:nth-child(4) { animation-delay: 0.1s; }

@keyframes calleridSoundWave {
    0%, 100% {
        height: 6px;
    }
    50% {
        height: 14px;
    }
}

