/* ============================================
   AGLAR MASCOT - Animated Mascot Styles
   ============================================ */

/* ---- Main Container ---- */
#aglar-mascot-container {
    position: fixed;
    bottom: 20px;
    left: 30px;
    z-index: 9990;
    pointer-events: none;
}

/* ---- Mascot Character ---- */
.aglar-mascot {
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    transition: transform 0.3s ease;
    filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.3));
}

.aglar-mascot:hover {
    transform: scale(1.1) !important;
}

/* Dismiss button */
.aglar-mascot-dismiss {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    background: #fff;
    color: #999;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    font-size: 14px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s, color 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.aglar-mascot:hover .aglar-mascot-dismiss {
    opacity: 1;
}

.aglar-mascot-dismiss:hover {
    background: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
}

.aglar-mascot img {
    height: var(--mascot-size, 120px);
    width: auto;
    max-height: 120px;
    min-height: 80px;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

/* Flip when going right */
.aglar-mascot.facing-right img {
    transform: scaleX(-1);
}

/* Levitating animation */
.aglar-mascot.levitating {
    animation: aglar-levitate 2s ease-in-out infinite;
}

@keyframes aglar-levitate {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
}

.aglar-mascot.levitating:hover {
    animation: aglar-levitate-hover 2s ease-in-out infinite;
}

@keyframes aglar-levitate-hover {
    0%, 100% { transform: translateY(0px) scale(1.1); }
    50% { transform: translateY(-12px) scale(1.1); }
}

/* Wiggle when speaking */
.aglar-mascot.wiggle {
    animation: aglar-wiggle 0.5s ease !important;
}

@keyframes aglar-wiggle {
    0%   { transform: rotate(0deg); }
    20%  { transform: rotate(-8deg); }
    40%  { transform: rotate(8deg); }
    60%  { transform: rotate(-5deg); }
    80%  { transform: rotate(5deg); }
    100% { transform: rotate(0deg); }
}

/* ---- Speech Bubble ---- */
.aglar-mascot-bubble {
    position: absolute;
    bottom: calc(var(--mascot-size, 120px) + 15px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    color: #333;
    padding: 8px 16px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    max-width: 360px;
    min-width: 200px;
    width: max-content;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border: 2px solid #e05c0b;
    pointer-events: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
    transform: translateX(-50%) translateY(10px);
    white-space: normal;
    word-wrap: break-word;
    z-index: 9991;
}

/* Triangle pointer */
.aglar-mascot-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #fff;
}

.aglar-mascot-bubble::before {
    content: '';
    position: absolute;
    bottom: -13px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 12px solid #e05c0b;
}

.aglar-mascot-bubble.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ---- Close bubble X ---- */
.aglar-mascot-bubble-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    background: #e05c0b;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.aglar-mascot-bubble-close:hover {
    background: #c44a00;
}

/* ---- Modal ---- */
.aglar-mascot-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    animation: aglar-fadein 0.3s ease;
}

.aglar-mascot-modal.show {
    display: flex;
}

@keyframes aglar-fadein {
    from { opacity: 0; }
    to { opacity: 1; }
}

.aglar-mascot-modal-content {
    background: #fff;
    border-radius: 20px;
    width: 90%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0,0,0,0.25);
    animation: aglar-slidein 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

@keyframes aglar-slidein {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.aglar-mascot-modal-header {
    background: linear-gradient(135deg, #e05c0b 0%, #ff8c42 100%);
    border-radius: 20px 20px 0 0;
    padding: 28px 24px 24px;
    text-align: center;
    position: relative;
}

.aglar-mascot-header-bg {
    width: 72px;
    height: 72px;
    margin: 0 auto 12px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.aglar-mascot-modal-icon {
    height: 48px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.15));
}

.aglar-mascot-modal-title {
    margin: 0;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.aglar-mascot-modal-subtitle {
    margin: 4px 0 0;
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    font-weight: 400;
}

.aglar-mascot-close {
    position: absolute;
    top: 14px;
    right: 14px;
    color: rgba(255,255,255,0.7);
    font-size: 26px;
    cursor: pointer;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 2;
    line-height: 1;
}

.aglar-mascot-close:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* Product info bar */
.aglar-mascot-product-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: #fff8f2;
    border-bottom: 1px solid #fde8d0;
}

.aglar-mascot-product-badge {
    background: #e05c0b;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.aglar-mascot-product-name {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}

/* Form fields */
.aglar-mascot-modal-body {
    padding: 20px 24px 24px;
}

.aglar-mascot-fields-row {
    display: flex;
    gap: 12px;
}

.aglar-mascot-fields-row .aglar-mascot-field {
    flex: 1;
}

.aglar-mascot-field {
    margin-bottom: 14px;
}

.aglar-mascot-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.aglar-mascot-field input,
.aglar-mascot-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafafa;
}

.aglar-mascot-field input:focus,
.aglar-mascot-field textarea:focus {
    outline: none;
    border-color: #e05c0b;
    box-shadow: 0 0 0 3px rgba(224,92,11,0.1);
    background: #fff;
}

.aglar-mascot-field input::placeholder,
.aglar-mascot-field textarea::placeholder {
    color: #c0c4cc;
}

.aglar-mascot-field textarea {
    resize: vertical;
    min-height: 70px;
}

.aglar-mascot-submit {
    width: 100%;
    padding: 13px 20px;
    background: linear-gradient(135deg, #e05c0b 0%, #ff8c42 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 16px rgba(224,92,11,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
}

.aglar-mascot-submit:hover {
    box-shadow: 0 6px 24px rgba(224,92,11,0.45);
    transform: translateY(-1px);
}

.aglar-mascot-submit:active {
    transform: translateY(0);
}

.aglar-mascot-submit:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.aglar-mascot-submit-arrow {
    font-size: 18px;
    transition: transform 0.2s;
}

.aglar-mascot-submit:hover .aglar-mascot-submit-arrow {
    transform: translateX(3px);
}

.aglar-mascot-form-note {
    text-align: center;
    font-size: 11px;
    color: #9ca3af;
    margin: 12px 0 0;
}

/* Success */
.aglar-mascot-success {
    text-align: center;
    padding: 30px 20px;
}

.aglar-mascot-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    border-radius: 50%;
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 14px;
    box-shadow: 0 4px 16px rgba(34,197,94,0.3);
}

.aglar-mascot-success h3 {
    margin: 0 0 8px;
    color: #1a1a1a;
    font-size: 18px;
}

.aglar-mascot-success p {
    color: #6b7280;
    margin: 0 0 20px;
    font-size: 14px;
}

.aglar-mascot-ok-btn {
    padding: 10px 32px;
    background: #f3f4f6;
    color: #374151;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.aglar-mascot-ok-btn:hover {
    background: #e5e7eb;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .aglar-mascot img {
        height: calc(var(--mascot-size, 120px) * 0.7);
    }

    .aglar-mascot-bubble {
        max-width: 200px;
        font-size: 12px;
        padding: 10px 14px;
        bottom: calc(var(--mascot-size, 120px) * 0.7 + 10px);
    }

    .aglar-mascot-modal-content {
        width: calc(100% - 20px);
        margin: 10px;
        border-radius: 16px;
    }

    .aglar-mascot-modal-header {
        border-radius: 16px 16px 0 0;
    }

    .aglar-mascot-modal-body {
        padding: 16px;
    }

    .aglar-mascot-fields-row {
        flex-direction: column;
        gap: 0;
    }
}

/* ---- Hide on very small screens ---- */
@media (max-width: 400px) {
    #aglar-mascot-container {
        bottom: 10px;
    }
    
    .aglar-mascot img {
        height: calc(var(--mascot-size, 120px) * 0.55);
    }
    
    .aglar-mascot-bubble {
        max-width: 170px;
        font-size: 11px;
    }
}
