/**
 * Kanjoos Kart - AI Bargain Engine
 * Frontend Styles
 * Version: 1.0.0
 * Author: Kanjoos Kart Technologies
 */

/*------------------------------------*\
  #ANIMATIONS
\*------------------------------------*/

@keyframes slideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes messagePop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100%) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/*------------------------------------*\
  #MODAL OVERLAY
\*------------------------------------*/

.kanjoos-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.85);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.kanjoos-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/*------------------------------------*\
  #MODAL CONTAINER
\*------------------------------------*/

.kanjoos-modal-container {
    width: 90%;
    max-width: 800px;
    height: 90vh;
    max-height: 900px;
    background-color: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    animation: slideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/*------------------------------------*\
  #HEADER SECTION
\*------------------------------------*/

.kanjoos-modal-header {
    background: linear-gradient(135deg, #764ba2, #667eea);
    padding: 20px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #ffffff;
}

.kanjoos-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.kanjoos-logo {
    width: 40px;
    height: 40px;
    background-color: #ffffff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.kanjoos-brand-text {
    display: flex;
    flex-direction: column;
}

.kanjoos-brand-name {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    color: #ffffff;
}

.kanjoos-brand-url {
    font-size: 12px;
    opacity: 0.9;
    color: #ffffff;
}

.kanjoos-close-btn {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.kanjoos-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.kanjoos-close-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
}

/*------------------------------------*\
  #PRODUCT INFO SECTION
\*------------------------------------*/

.kanjoos-product-info {
    padding: 25px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    gap: 20px;
    align-items: center;
}

.kanjoos-product-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    background-color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.kanjoos-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.kanjoos-product-details {
    flex: 1;
}

.kanjoos-product-name {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #333333;
}

.kanjoos-price-row {
    display: flex;
    gap: 20px;
    align-items: baseline;
    flex-wrap: wrap;
}

.kanjoos-mrp {
    font-size: 16px;
    color: #666666;
    margin: 0;
}

.kanjoos-mrp span {
    text-decoration: line-through;
    margin-left: 5px;
    font-weight: 600;
    color: #333333;
}

.kanjoos-bargain-badge {
    background: linear-gradient(135deg, #764ba2, #667eea);
    color: #ffffff;
    padding: 6px 15px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    animation: pulse 2s infinite;
}

/*------------------------------------*\
  #CHAT AREA
\*------------------------------------*/

.kanjoos-chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    background-color: #f5f7fb;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.kanjoos-message {
    max-width: 80%;
    padding: 15px 20px;
    border-radius: 20px;
    animation: messagePop 0.3s ease;
    word-wrap: break-word;
}

.kanjoos-message.bot {
    align-self: flex-start;
    background-color: #ffffff;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.kanjoos-message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #764ba2, #667eea);
    color: #ffffff;
    border-bottom-right-radius: 5px;
}

.kanjoos-message-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.kanjoos-message-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.kanjoos-message-text {
    flex: 1;
    line-height: 1.5;
    font-size: 15px;
}

/*------------------------------------*\
  #ROUND INDICATOR
\*------------------------------------*/

.kanjoos-round-indicator {
    padding: 20px 25px;
    background-color: #ffffff;
    border-top: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.kanjoos-round-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #e0e0e0;
    transition: all 0.3s ease;
}

.kanjoos-round-dot.active {
    background: linear-gradient(135deg, #764ba2, #667eea);
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.5);
}

.kanjoos-round-dot.completed {
    background: #38ef7d;
}

/*------------------------------------*\
  #INPUT AREA
\*------------------------------------*/

.kanjoos-bargain-input-area {
    padding: 25px;
    background-color: #ffffff;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 15px;
}

.kanjoos-bargain-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.kanjoos-bargain-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.kanjoos-send-btn {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #764ba2, #667eea);
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    flex-shrink: 0;
}

.kanjoos-send-btn:hover {
    transform: scale(1.05);
}

.kanjoos-influence-message {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: #ffffff;
    padding: 15px 20px;
    border-radius: 12px;
    margin: 10px 0;
    font-weight: 700;
    text-align: center;
    animation: pulse 2s infinite;
}

.kanjoos-accept-offer {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: #ffffff;
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(56, 239, 125, 0.4);
    margin: 15px 0;
    width: 100%;
}

.kanjoos-footer {
    padding: 15px 25px;
    background: linear-gradient(135deg, #764ba2, #667eea);
    color: #ffffff;
    text-align: center;
    font-size: 14px;
}

/*------------------------------------*\
  #RESPONSIVE DESIGN
\*------------------------------------*/

@media (max-width: 768px) {
    .kanjoos-modal-container {
        width: 100%;
        height: 100vh;
        max-height: none;
        border-radius: 0;
    }
    
    .kanjoos-product-info {
        flex-direction: column;
        text-align: center;
    }
    
    .kanjoos-bargain-input-area {
        padding: 15px;
    }
}

.kanjoos-hidden { display: none !important; }