/* ===================================
   PAUL'S ASSISTANT - DARK THEME WIDGET
   =================================== */

.paul-assistant {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Toggle Button */
.pa-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.pa-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 32px rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.2);
}

.pa-toggle-icon,
.pa-toggle-close {
    color: #ffffff;
    transition: all 0.3s ease;
    position: absolute;
}

.pa-toggle-close {
    opacity: 0;
    transform: rotate(90deg) scale(0);
}

.pa-toggle.active .pa-toggle-icon {
    opacity: 0;
    transform: rotate(-90deg) scale(0);
}

.pa-toggle.active .pa-toggle-close {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Pulse animation on toggle */
.pa-toggle::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.15);
    animation: paPulse 2s infinite;
}

.pa-toggle.active::after {
    display: none;
}

@keyframes paPulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* Widget Window */
.pa-window {
    position: absolute;
    bottom: 76px;
    right: 0;
    width: 400px;
    height: 560px;
    background: #0a0a0a;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: translateY(16px) scale(0.96);
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pa-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */
.pa-header {
    padding: 20px 24px;
    background: #000000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.pa-header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #333 0%, #1a1a1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.pa-header-info {
    flex: 1;
}

.pa-header-name {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
}

.pa-header-status {
    font-size: 12px;
    color: #666;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pa-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    display: inline-block;
}

/* Chat Messages */
.pa-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #0a0a0a;
}

.pa-msg {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    animation: paSlideIn 0.3s ease;
}

.pa-msg-user {
    flex-direction: row-reverse;
}

.pa-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}

.pa-msg-user .pa-msg-avatar {
    background: #ffffff;
    color: #000;
    border-color: transparent;
}

.pa-msg-bubble {
    max-width: 78%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
    color: #e0e0e0;
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.pa-msg-user .pa-msg-bubble {
    background: #ffffff;
    color: #000000;
    border-color: transparent;
    border-bottom-right-radius: 4px;
}

.pa-msg-bot .pa-msg-bubble {
    border-bottom-left-radius: 4px;
}

.pa-msg-bubble p {
    margin: 0;
    white-space: pre-line;
}

.pa-msg-bubble a {
    color: #60a5fa;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.pa-msg-user .pa-msg-bubble a {
    color: #2563eb;
}

/* Typing Indicator */
.pa-typing {
    display: none;
    gap: 5px;
    padding: 12px 16px;
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    align-items: center;
}

.pa-typing.active {
    display: flex;
}

.pa-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #555;
    animation: paTypingDot 1.4s infinite;
}

.pa-typing span:nth-child(2) { animation-delay: 0.2s; }
.pa-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes paTypingDot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-8px); opacity: 1; }
}

/* Input Area */
.pa-input-area {
    padding: 16px 20px;
    background: #000000;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.pa-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.pa-input {
    flex: 1;
    padding: 12px 18px;
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    color: #ffffff;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
}

.pa-input::placeholder {
    color: #555;
}

.pa-input:focus {
    border-color: rgba(255, 255, 255, 0.25);
    background: #1a1a1a;
}

.pa-send {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #ffffff;
    border: none;
    color: #000000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.pa-send:hover {
    background: #e6e6e6;
    transform: scale(1.06);
}

.pa-send:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
    transform: none;
}

/* Powered by */
.pa-powered {
    text-align: center;
    padding: 8px;
    font-size: 10px;
    color: #444;
    background: #000;
    letter-spacing: 0.03em;
}

/* Scrollbar */
.pa-messages::-webkit-scrollbar { width: 5px; }
.pa-messages::-webkit-scrollbar-track { background: transparent; }
.pa-messages::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
.pa-messages::-webkit-scrollbar-thumb:hover { background: #555; }

@keyframes paSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===================================
   COOKIE CONSENT BANNER
   =================================== */

.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    padding: 0;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-consent.active {
    transform: translateY(0);
}

.cookie-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px clamp(1.5rem, 5vw, 4rem);
}

.cookie-card {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 24px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.4);
}

.cookie-text {
    flex: 1;
}

.cookie-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-desc {
    font-size: 13px;
    color: #888;
    margin: 0;
    line-height: 1.5;
}

.cookie-desc a {
    color: #ccc;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-desc a:hover {
    color: #fff;
}

.cookie-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.cookie-btn {
    padding: 10px 22px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
}

.cookie-btn-accept {
    background: #ffffff;
    color: #000000;
}

.cookie-btn-accept:hover {
    background: #e6e6e6;
    transform: translateY(-1px);
}

.cookie-btn-decline {
    background: transparent;
    color: #999;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cookie-btn-decline:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
}

/* Mobile - Tablets */
@media (max-width: 768px) {
    .paul-assistant {
        bottom: 16px;
        right: 16px;
    }

    .pa-toggle {
        width: 54px;
        height: 54px;
    }

    .pa-window {
        width: calc(100vw - 32px);
        max-width: 400px;
        height: 500px;
        bottom: 72px;
        right: -8px;
    }

    .cookie-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
        gap: 16px;
    }

    .cookie-actions {
        width: 100%;
        justify-content: center;
    }

    .cookie-btn {
        flex: 1;
        padding: 12px 16px;
    }
}

/* Mobile - Phones */
@media (max-width: 480px) {
    .paul-assistant {
        bottom: 12px;
        right: 12px;
    }

    .pa-toggle {
        width: 52px;
        height: 52px;
    }

    /* Floating chat on small phones instead of full-screen */
    .pa-window {
        position: fixed;
        top: auto;
        left: 12px;
        right: 12px;
        bottom: 80px;
        width: auto;
        max-width: none;
        height: 70vh;
        max-height: 500px;
        border-radius: 16px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        z-index: 10001;
    }

    .pa-header {
        padding: 16px 20px;
        padding-top: calc(16px + env(safe-area-inset-top, 0px));
    }

    .pa-header-name {
        font-size: 16px;
    }

    .pa-messages {
        padding: 16px;
        gap: 14px;
    }

    .pa-msg-bubble {
        max-width: 85%;
        font-size: 14px;
        padding: 11px 14px;
    }

    .pa-input-area {
        padding: 12px 16px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .pa-input {
        padding: 12px 16px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    .pa-send {
        width: 44px;
        height: 44px;
    }

    .pa-powered {
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    }

    /* Cookie banner mobile */
    .cookie-inner {
        padding: 12px;
    }

    .cookie-card {
        flex-direction: column;
        text-align: center;
        padding: 18px 16px;
        gap: 14px;
        border-radius: 14px;
    }

    .cookie-title {
        font-size: 14px;
        justify-content: center;
    }

    .cookie-desc {
        font-size: 12px;
    }

    .cookie-actions {
        width: 100%;
        gap: 8px;
    }

    .cookie-btn {
        flex: 1;
        padding: 12px 16px;
        font-size: 13px;
    }
}
