/* ===================================
   Dr. Propheal - Premium UI Styles
   =================================== */

/* === Global Styles === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Animated Gradient Background === */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    animation: gradientShift 15s ease infinite;
}

.dark body::before {
    background: linear-gradient(135deg, #0a0e1a 0%, #1a1f35 50%, #0a0e1a 100%);
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* === Floating Orbs Background === */
body::after {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 30%, rgba(74, 222, 128, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(45, 212, 191, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
    animation: floatingOrbs 20s ease-in-out infinite;
    z-index: -1;
    pointer-events: none;
}

@keyframes floatingOrbs {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(30px, -30px) rotate(120deg);
    }

    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

/* === Custom Scrollbar === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #4ade80, #2dd4bf);
    border-radius: 10px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #22c55e, #14b8a6);
}

/* === Glassmorphic Chat Container === */
main {
    backdrop-filter: blur(20px);
    background: rgba(58, 151, 45, 0.05);
    border: 1px solid rgba(58, 151, 45, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.dark main {
    background: rgba(16, 25, 34, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* === Header Enhancements === */
header {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.1), rgba(45, 212, 191, 0.1));
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.dark header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

header h2 {
    background: linear-gradient(135deg, #4ade80, #2dd4bf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* === Avatar Styles === */
.avatar {
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    aspect-ratio: 1 / 1;
    border-radius: 9999px;
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.3);
    border: 2px solid rgba(74, 222, 128, 0.2);
    transition: all 0.3s ease;
}

.avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(74, 222, 128, 0.5);
}

.bot-avatar {
    background-image: url("https://lh3.googleusercontent.com/aida-public/AB6AXuBP2hr54wCMJB1_XIVnlOvc7UuJR_biBhpuaUoKHB2Yf9KhNAKbq6cgYS7fMHwQVYA9DekEnMfOf4uYGvY5N4-5k2lj_H8CvCem51qwNDW5sugsfuxSUrhzO6KZolhXOy6VQUkOVyuGT0pkxxnKPGcWeGlb2QRCNkvfYPLaSSIYId8VH_UBWiU5KrFMugAK9Wt7mi_XD8_hdIYv9w62z9062Dsm7ayljA5kgNsGBLhMtkbozaIxfSMXV5XZzN4oO259q4YSgAZoXBl-");
    animation: avatarGlow 3s ease-in-out infinite;
}

.user-avatar {
    background-image: url("https://lh3.googleusercontent.com/aida-public/AB6AXuCHdYZvwThdRwWckjlGZX1ziccUM9eId1yLIWDmSYXO71YnVSREh1MmUByEDy0PTjhDXKUpXQdIiWvQAG_nh4J2b5nMyyA0eZoambJSmwhC5FUx0IxUiMNi_6Z0aRtq9kGMhPO2JOcrqGZF6h0dUuIPvSiHsDn2NmBl2ZjsaJK0lmOayS3xP1yzjJJHb15sY69Zfj2PDO4oIK0AZEAi2dW2ABPlrtWYXMDMO0M28LLRrIE7e9Fwd-H4z_kW2rPpNTwzXaKtiojbpC0A");
    border-color: rgba(45, 212, 191, 0.2);
    box-shadow: 0 4px 12px rgba(45, 212, 191, 0.3);
}

@keyframes avatarGlow {

    0%,
    100% {
        box-shadow: 0 4px 12px rgba(74, 222, 128, 0.3);
    }

    50% {
        box-shadow: 0 6px 24px rgba(74, 222, 128, 0.6);
    }
}

/* === Message Bubbles === */
.message-bubble {
    animation: messageSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: all 0.3s ease;
}

.message-bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bot message styling */
.bot-message {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.1), rgba(74, 222, 128, 0.05));
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-left: 3px solid #4ade80;
    box-shadow: 0 2px 8px rgba(74, 222, 128, 0.1);
}

.dark .bot-message {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.15), rgba(74, 222, 128, 0.08));
}

/* User message styling */
.user-message {
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.1), rgba(45, 212, 191, 0.05));
    border: 1px solid rgba(45, 212, 191, 0.3);
    border-right: 3px solid #2dd4bf;
    box-shadow: 0 2px 8px rgba(45, 212, 191, 0.1);
}

.dark .user-message {
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.15), rgba(45, 212, 191, 0.08));
}

/* === Typing Indicator === */
.typing-indicator {
    display: inline-flex;
    gap: 4px;
    padding: 12px 16px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    animation: typingBounce 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-10px);
    }
}

/* === Input Area === */
#message-input {
    transition: all 0.3s ease;
    resize: none;
    min-height: 44px;
    max-height: 200px;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.dark #message-input {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#message-input:focus {
    outline: none;
    border-color: #4ade80 !important;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.1), 0 4px 12px rgba(74, 222, 128, 0.15);
    transform: translateY(-1px);
}

/* === Input Area Styling (Bottom Section) === */
.input-area {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.1), rgba(45, 212, 191, 0.1));
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.05);
}

.dark .input-area {
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* === Buttons === */
button {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:active::before {
    width: 300px;
    height: 300px;
}

#send-button {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.4);
}

#send-button:hover {
    background: linear-gradient(135deg, #22c55e, #4ade80);
    box-shadow: 0 6px 20px rgba(74, 222, 128, 0.6);
    transform: scale(1.05);
}

#send-button:active {
    transform: scale(0.95);
}

#file-attach-button {
    transition: all 0.3s ease;
}

#file-attach-button:hover {
    background: rgba(74, 222, 128, 0.1);
    transform: rotate(15deg) scale(1.1);
}

#file-attach-button.file-attached {
    color: #4ade80 !important;
    background: rgba(74, 222, 128, 0.15);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* === Image Preview === */
.chat-image {
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
}

.chat-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* === Loading Skeleton === */
.skeleton {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.05) 25%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* === Status Badges === */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-analyzing {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.2), rgba(74, 222, 128, 0.1));
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.status-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.1));
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* === Result Cards === */
.result-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
    transition: all 0.3s ease;
}

.dark .result-card {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.result-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(74, 222, 128, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(74, 222, 128, 0.2);
}

/* === Responsive Design === */
@media (max-width: 768px) {
    header h2 {
        font-size: 16px;
    }

    .avatar {
        width: 32px;
        height: 32px;
    }

    #message-input {
        font-size: 14px;
    }
}

/* === Utility Classes === */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.slide-up {
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Success Confetti === */
@keyframes confetti {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}