@font-face {
    font-family: 'Montserrat';
    src: url('../assets/fonts/montserrat/font.woff2') format('woff2');
    font-weight: 100 900; /* range of supported weights */
    font-style: normal;
}

@font-face {
    font-family: 'Montserrat';
    src: url('../assets/fonts/montserrat/italic.woff2') format('woff2');
    font-weight: 100 900; /* range of supported weights */
    font-style: italic;
}

@font-face {
    font-family: 'Unbounded';
    src: url('../assets/fonts/unbounded/font.woff2') format('woff2');
    font-weight: 100 900; /* range of supported weights */
    font-style: normal;
}

* {
    box-sizing: border-box;
    font-family: 'Unbounded', sans-serif;
    -moz-text-size-adjust: none;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
}

.chat-timestamp, .warning, .error, span, .user-info, label, p, a, input, textarea, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
}
 
.btn {
    font-family: 'Unbounded', sans-serif;
}

body {
    margin: 0;
    padding: 1.5rem;
    padding-top: 0;
    padding-bottom: 0;
    background: linear-gradient(135deg, #fdf7f7 0%, #ffffff 50%, #fef5f8 100%);
    color: #2d1b2e;
    line-height: 1.5;
    min-height: 100vh;
    animation: fadeIn 0.6s ease-out;
}

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

.container {
    max-width: 720px;
    margin: 0 auto;
    animation: slideUp 0.8s ease-out;
}

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

h1 {
    font-size: 1.4rem;
    margin: 0;
    font-weight: 500;
    color: #2d1b2e;
    animation: slideInLeft 0.7s ease-out;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Login Form */
.login-container {
    max-width: 720px;
    margin: 0.5rem auto;
    margin-top: 1.5rem;
    padding: 1.25rem !important;
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 30px;
    border: 1px solid rgba(251, 207, 232, 0.5);
    animation: scaleIn 0.5s ease-out;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(251, 182, 206, 0.1);
}

.login-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(251, 182, 206, 0.2);
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.login-container h1 {
    text-align: left;
    margin-bottom: 0.5rem;
    margin-top: -0.45rem;
    font-size: 1.3rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    margin-top: -0.5rem;
    font-size: 0.9rem;
    color: #6d4c7d;
    animation: fadeInUp 0.6s ease-out;
}

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

input[type="email"], input[type="text"],
input[type="password"],
textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid rgba(251, 207, 232, 0.6);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.8);
    color: #2d1b2e;
    font-size: 0.95rem;
    margin-bottom: 0;
    transition: all 0.3s ease;
    outline: none;
    animation: slideInRight 0.7s ease-out;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

input[type="email"]:focus, input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
    border-color: #e879ac;
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(232, 121, 172, 0.15);
}

textarea {
    min-height: 6.25rem;
    resize: vertical;
}

button,
.btn {
    background: linear-gradient(135deg, #e879ac 0%, #f3b1ce 100%);
    color: #ffffff;
    border: none;
    padding: 0.875rem 1.5rem;
    font-size: 0.9rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    animation: bounceIn 0.6s ease-out;
    box-shadow: 0 4px 15px rgba(232, 121, 172, 0.2);
}

button:hover,
.btn:hover {
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(232, 121, 172, 0.3);
    background: linear-gradient(135deg, #e066a3 0%, #f0a4c7 100%);
}

button svg,
.btn svg {
    display: block;
    vertical-align: middle;
}

@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3); }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

button::before,
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

button:hover::before,
.btn:hover::before {
    left: 100%;
}

button:active,
.btn:active {
    transform: translateY(0);
    transition: transform 0.1s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #d1477a 0%, #e879ac 100%);
    width: 100%;
    margin-top: 0.5rem;
    box-shadow: 0 4px 15px rgba(209, 71, 122, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #c63d70 0%, #e066a3 100%);
    box-shadow: 0 8px 25px rgba(209, 71, 122, 0.3);
}

.btn-wide-danger {
    background: linear-gradient(135deg, #e87c7c 0%, #f4a6a6 100%);
    width: 100%;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(232, 124, 124, 0.2);
}

.btn-wide-danger:hover {
    background: linear-gradient(135deg, #e66767 0%, #f29999 100%);
    color: #ffffff;
    box-shadow: 0 8px 25px rgba(232, 124, 124, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #e87c7c 0%, #f4a6a6 100%);
    border: 2px solid #e66767;
    margin-left: 0.75rem;
    margin-top: 0.25rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: #ffffff;
    margin-bottom: 0.25rem;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 4px 15px rgba(232, 124, 124, 0.2);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #e66767 0%, #f29999 100%);
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(232, 124, 124, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #f2b47a 0%, #f9d5a6 100%);
    border: 2px solid #efa760;
    margin-left: 0.5rem;
    margin-top: 0.25rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-bottom: 0.25rem;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 4px 15px rgba(242, 180, 122, 0.2);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #efa760 0%, #f7c799 100%);
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(242, 180, 122, 0.3);
}

.error {
    color: #c53030;
    margin-bottom: 0.95rem;
    margin-top: -0.05rem;
    font-size: 0.9rem;
    text-align: center;
    padding: 0.75rem;
    background: rgba(254, 226, 226, 0.8);
    border-radius: 30px;
    animation: shake 0.5s ease-in-out, fadeInDown 0.5s ease-out;
    border: 2px solid rgba(252, 165, 165, 0.6);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.warning {
    color: #d69e2e;
    margin-bottom: 0.95rem;
    margin-top: -0.05rem;
    font-size: 0.9rem;
    text-align: center;
    padding: 0.75rem;
    background: rgba(255, 248, 235, 0.8);
    border-radius: 30px;
    animation: pulse 0.6s ease-out, fadeInDown 0.5s ease-out;
    border: 2px solid rgba(251, 211, 141, 0.6);
}

.success {
    border-color: #10b981;
    background-color: rgba(16, 185, 129, 0.12);
    color: #047857;
    border-width: 2px;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* User Info Bar */
.user-info {
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem 1.25rem;
    border-radius: 30px;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(251, 207, 232, 0.5);
    font-size: 0.9rem;
    flex-wrap: wrap;
    gap: 0.75rem;
    animation: slideInFromTop 0.8s ease-out;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(251, 182, 206, 0.1);
}

.user-info:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(251, 207, 232, 0.8);
    box-shadow: 0 6px 25px rgba(251, 182, 206, 0.15);
}

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

/* Chat History */
.chat-history {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 30px;
    margin-bottom: 1.5rem;
    max-height: 25rem;
    overflow-y: auto;
    border: 1px solid rgba(251, 207, 232, 0.5);
    animation: expandHeight 0.8s ease-out;
    transition: box-shadow 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(251, 182, 206, 0.1);
}

.chat-history:hover {
    box-shadow: 0 12px 40px rgba(251, 182, 206, 0.15);
}

@keyframes expandHeight {
    from { max-height: 0; opacity: 0; }
    to { max-height: 25rem; opacity: 1; }
}

.chat-message {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(251, 207, 232, 0.3);
    position: relative;
    animation: messageSlideIn 0.5s ease-out;
    transition: all 0.3s ease;
}

@keyframes messageSlideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.chat-message:last-child {
    border-bottom: none;
}

.chat-user {
    background: rgba(251, 242, 248, 0.6);
    animation-delay: 0.1s;
}

.chat-assistant {
    background: rgba(255, 250, 253, 0.6);
    padding-right: 3.125rem;
    animation-delay: 0.2s;
}

.chat-timestamp {
    font-size: 0.75rem;
    color: #a078aa;
    margin-bottom: 0.375rem;
    animation: fadeIn 0.8s ease-out;
}

/* Copy Button */
.copy-btn {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(232, 121, 172, 0.3);
    color: #a078aa;
    cursor: pointer;
    padding: 0.375rem;
    border-radius: 30px;
    font-size: 0.75rem;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.8);
    backdrop-filter: blur(5px);
}

.chat-message:hover .copy-btn {
    opacity: 1;
    transform: scale(1);
}

.copy-btn:hover {
    color: #e879ac;
    background: rgba(255, 255, 255, 0.95);
    border-color: #e879ac;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(232, 121, 172, 0.2);
}

.copy-btn:active {
    transform: scale(0.95);
}

.copy-btn.copied {
    color: #38a169;
    border-color: #38a169;
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.copy-btn svg {
    pointer-events: none;
    transition: transform 0.2s ease;
}

.copy-btn:hover svg {
    transform: rotate(5deg);
}

.response-text {
    user-select: text;
}

h2 {
    font-size: 1.1rem;
    margin: 1.25rem 0 0.75rem;
    font-weight: 500;
    color: #2d1b2e;
    animation: slideInLeft 0.7s ease-out;
}

/* Scrollbar */
.chat-history::-webkit-scrollbar {
    width: 0.375rem;
}

.chat-history::-webkit-scrollbar-track {
    background: rgba(251, 207, 232, 0.2);
    border-radius: 30px;
}

.chat-history::-webkit-scrollbar-thumb {
    background: rgba(232, 121, 172, 0.5);
    border-radius: 30px;
    transition: background 0.3s ease;
}

.chat-history::-webkit-scrollbar-thumb:hover {
    background: rgba(232, 121, 172, 0.7);
}

/* Hover highlight */
.chat-message:hover {
    background: rgba(251, 242, 248, 0.8);
    transform: translateX(3px);
}

/* Forms */
form {
    margin-bottom: 0;
    animation: slideUp 0.8s ease-out;
}

.form-group {
    margin-bottom: 1rem;
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }
.form-group:nth-child(4) { animation-delay: 0.4s; }

.form-group:last-child {
    margin-bottom: 0;
}

::placeholder {
    color: #a078aa;
    opacity: 1;
    transition: color 0.3s ease;
}

input:focus::placeholder,
textarea:focus::placeholder {
    color: #c4a5ce;
}

#bottom {
    height: 1px;
}

.send-form {
    margin-top: 0;
}

.send-form .btn-primary {
    margin-top: 0;
}

hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(251, 207, 232, 0.6), transparent);
    border-radius: 30px;
    margin: 1rem 0;
    margin-bottom: 0;
    animation: expandWidth 0.8s ease-out;
}

@keyframes expandWidth {
    from { width: 0; opacity: 0; }
    to { width: 100%; opacity: 1; }
}

.logo-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0;
    margin-bottom: 1rem;
    animation: logoEntrance 1s ease-out;
}

@keyframes logoEntrance {
    from { 
        opacity: 0; 
        transform: translateY(-20px) rotate(-10deg); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) rotate(0deg); 
    }
}

.logo-header img {
    height: 2rem;
    width: 2rem;
    margin-bottom: 0.25rem;
    margin-top: 0.25rem;
    object-fit: contain;
    transition: transform 0.4s ease;
    filter: drop-shadow(0 2px 4px rgba(232, 121, 172, 0.1));
}

.logo-header:hover img {
    transform: rotate(360deg) scale(1.1);
    filter: drop-shadow(0 4px 8px rgba(232, 121, 172, 0.2));
}

a {
    color: #d1477a;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: linear-gradient(90deg, #e879ac, #f3b1ce);
    transition: width 0.3s ease;
}

a:hover::after,
a:focus::after {
    width: 100%;
}

a:hover,
a:focus {
    color: #e879ac;
    text-decoration: none;
    outline: none;
    transform: translateY(-1px);
}

a:active {
    color: #b8356a;
    transform: translateY(0);
}

/* Loading animation for dynamic content */
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.loading {
    background: linear-gradient(90deg, rgba(251, 242, 248, 0.8) 25%, rgba(255, 250, 253, 0.8) 37%, rgba(251, 242, 248, 0.8) 63%);
    background-size: 400px 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

/* Stagger animations for multiple elements */
.chat-message:nth-child(odd) {
    animation-delay: 0.1s;
}

.chat-message:nth-child(even) {
    animation-delay: 0.2s;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus ring improvements */
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #e879ac;
    outline-offset: 2px;
}

/* Micro-interactions */
.user-info > * {
    transition: transform 0.2s ease;
}

.user-info > *:hover {
    transform: scale(1.02);
}

/* Enhanced message animations */
.chat-message {
    transform-origin: left center;
}

.chat-message:hover .chat-timestamp {
    color: #c4a5ce;
    transition: color 0.3s ease;
}

/* Button click feedback */
@keyframes buttonPress {
    0% { transform: scale(1); }
    50% { transform: scale(0.98); }
    100% { transform: scale(1); }
}

button:active,
.btn:active {
    animation: buttonPress 0.15s ease-out;
}

/* Add Responsive design fixes */
@media screen and (max-width: 768px) {
    html {
        font-size: 90%;
    }
}

/* For high DPI screens, ensure logo stays crisp */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-header img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}