/* YouShop Inspired HR Chatbot Theme */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;600;700&display=swap');

/* Activity Dashboard Styles */
.activity-dashboard {
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.activity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.activity-card {
    display: flex;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    border-left: 4px solid #ddd;
    transition: all 0.3s ease;
    cursor: pointer;
}

.activity-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.activity-card.completed {
    border-left-color: #28a745;
    background: rgba(40, 167, 69, 0.1);
}

.activity-card.pending {
    border-left-color: #ffc107;
    background: rgba(255, 193, 7, 0.1);
}

.activity-card.not-started {
    border-left-color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

.activity-icon {
    font-size: 24px;
    margin-right: 12px;
    min-width: 30px;
}

.activity-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.activity-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.activity-count {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.activity-status {
    font-size: 20px;
    margin-left: 8px;
}

.activity-status.completed {
    color: #28a745;
}

.activity-status.pending {
    color: #ffc107;
}

.activity-status.not-started {
    color: #dc3545;
}

.dashboard-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #0E3A44 0%, #217082 50%, #0E3A44 100%);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(14, 58, 68, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(224, 236, 246, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(33, 112, 130, 0.2) 0%, transparent 50%);
    pointer-events: none;
}

.chat-window {
    width: 500px;
    max-width: 90vw;
    background: rgba(224, 236, 246, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 
        0 20px 60px rgba(14, 58, 68, 0.2),
        0 8px 25px rgba(33, 112, 130, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 600px;
    animation: chatWindowAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(224, 236, 246, 0.3);
    position: relative;
    z-index: 1;
}

.chat-header {
    background: rgba(14, 58, 68, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(224, 236, 246, 0.2);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 12px;
    padding: 8px 12px;
    color: #ffffff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    position: relative;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.notification-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.notification-count {
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 600;
    position: absolute;
    top: -4px;
    right: -4px;
    animation: pulse 2s infinite;
}

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

.chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(224, 236, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.chat-title {
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 2;
    position: relative;
}

.chat-status {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    z-index: 2;
    position: relative;
}

.online-dot {
    width: 12px;
    height: 12px;
    background: #10d876;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 2s infinite;
    box-shadow: 0 0 0 0 rgba(16, 216, 118, 0.7);
}

.chat-body {
    flex: 1;
    padding: 28px;
    overflow-y: auto;
    background: rgba(224, 236, 246, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-bubble {
    max-width: 85%;
    padding: 16px 20px;
    border-radius: 20px;
    font-size: 0.8rem;
    line-height: 1.5;
    position: relative;
    animation: bubbleSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    word-wrap: break-word;
}

.chat-bubble.bot {
    background: rgba(14, 58, 68, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    align-self: flex-start;
    box-shadow: 0 8px 25px rgba(14, 58, 68, 0.2);
    border: 1px solid rgba(224, 236, 246, 0.2);
    border-bottom-left-radius: 8px;
}

.chat-bubble.user {
    background: rgba(33, 112, 130, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    align-self: flex-end;
    box-shadow: 0 8px 25px rgba(33, 112, 130, 0.2);
    border: 1px solid rgba(224, 236, 246, 0.2);
    border-bottom-right-radius: 8px;
}

.categories-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.category-button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding: 14px 18px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #E0ECF6 100%);
    color: #0E3A44;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 4px 15px rgba(14, 58, 68, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(224, 236, 246, 0.8);
    position: relative;
    overflow: hidden;
}

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

.category-button:hover::before {
    left: 100%;
}

.category-button:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 12px 35px rgba(15, 155, 142, 0.2),
        0 8px 25px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, #0E3A44 0%, #217082 100%);
    color: #fff;
    border-color: rgba(15, 155, 142, 0.3);
}

.category-button:active {
    transform: translateY(-2px) scale(1.01);
    transition: all 0.1s ease;
}

.category-icon {
    font-size: 1.1rem;
    margin-right: 12px;
    transition: transform 0.3s ease;
}

.category-button:hover .category-icon {
    transform: scale(1.2) rotate(10deg);
}

.input-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    border: 1px solid rgba(224, 236, 246, 0.8);
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 12px;
    outline: none;
    display: block;
    color: #2d3748;
    position: relative;
    overflow: hidden;
}

.input-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(15, 155, 142, 0.1), transparent);
    transition: left 0.5s;
}

.input-btn:hover::before {
    left: 100%;
}

.input-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #0E3A44 0%, #217082 100%);
    color: #fff;
    box-shadow: 0 8px 25px rgba(14, 58, 68, 0.3);
    border-color: rgba(15, 155, 142, 0.3);
}

.go-back-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    color: #0f9b8e;
    border: 2px solid #0f9b8e;
    border-radius: 25px;
    padding: 12px 24px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    width: fit-content;
    align-self: center;
    box-shadow: 0 4px 15px rgba(15, 155, 142, 0.2);
}

.go-back-btn:hover {
    background: linear-gradient(135deg, #0E3A44 0%, #217082 100%);
    color: #fff;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(14, 58, 68, 0.4);
}

.sub-option-btn {
    background: linear-gradient(135deg, #ffffff 0%, #E0ECF6 100%);
    border: 1px solid rgba(224, 236, 246, 0.8);
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    outline: none;
    color: #2d3748;
    margin: 6px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.sub-option-btn:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-color: #0f9b8e;
    color: #0f9b8e;
    transform: translateX(4px);
    box-shadow: 0 4px 15px rgba(15, 155, 142, 0.15);
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(15, 155, 142, 0.1);
    border-radius: 16px;
    align-self: flex-start;
    margin: 8px 0;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #0f9b8e;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

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

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

/* Animations */
@keyframes chatWindowAppear {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 216, 118, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(16, 216, 118, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 216, 118, 0);
    }
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    .chat-window {
        width: 95%;
        height: 90vh;
        margin: 20px auto;
    }
    
    .chat-body {
        padding: 20px;
    }
    
    .category-button {
        padding: 16px 20px;
        font-size: 0.8rem;
    }
}

/* Modal Backdrop */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(14, 58, 68, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: backdropFadeIn 0.3s ease;
}

.modal-dialog {
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(14, 58, 68, 0.25);
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    animation: modalSlideIn 0.3s ease;
    z-index: 1001;
}

@keyframes backdropFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Login Screen Styles */
.login-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0E3A44 0%, #217082 50%, #0E3A44 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.login-card {
    background: rgba(224, 236, 246, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 
        0 25px 60px rgba(14, 58, 68, 0.2),
        0 10px 30px rgba(33, 112, 130, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(224, 236, 246, 0.3);
    animation: loginSlideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    animation: bounce 2s infinite;
}

.login-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.login-subtitle {
    font-size: 0.9rem;
    color: #ffffff;
    margin: 0;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.form-input {
    padding: 14px 16px;
    border: 2px solid rgba(224, 236, 246, 0.8);
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #0E3A44;
    background: #ffffff;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: #217082;
    box-shadow: 0 0 0 3px rgba(33, 112, 130, 0.1);
    transform: translateY(-1px);
}

.form-input::placeholder {
    color: #217082;
    opacity: 0.6;
}

.login-btn {
    background: linear-gradient(135deg, #0E3A44 0%, #217082 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 16px 24px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 15px rgba(14, 58, 68, 0.2);
    position: relative;
    overflow: hidden;
    margin-top: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.login-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(14, 58, 68, 0.3);
}

.login-btn:active {
    transform: translateY(0) scale(0.98);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    display: none;
}

.login-btn.loading .btn-text {
    display: none;
}

.login-btn.loading .btn-loader {
    display: inline;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.forgot-password {
    font-size: 0.8rem;
    color: #ffffff;
    margin: 0;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.logout-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.logout-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Scrollbar Styling */
.chat-body::-webkit-scrollbar {
    width: 6px;
}

.chat-body::-webkit-scrollbar-track {
    background: rgba(224, 236, 246, 0.3);
    border-radius: 3px;
}

.chat-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #0E3A44 0%, #217082 100%);
    border-radius: 3px;
}

.chat-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #0E3A44 0%, #217082 100%);
}

/* Custom Robot Avatar */
.robot-avatar {
    width: 40px;
    height: 40px;
    position: relative;
    display: inline-block;
    margin-right: 8px;
    background-image: url('/static/assets/robot-avatar.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* === Toasts === */
#toast-container {
  position: fixed;
  z-index: 9999;
  inset: auto 16px 16px auto; /* bottom-right */
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none; /* clicks go through unless on toast */
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.toast {
  min-width: 260px;
  max-width: 420px;
  background: #111827; /* slate-900 */
  color: #f9fafb;      /* gray-50 */
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,.25);
  padding: 12px 14px 14px 14px;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: start;
  pointer-events: auto; /* allow hover/close click */
  opacity: 0;
  transform: translateY(10px) scale(.98);
  animation: toast-in .18s ease-out forwards;
}

.toast[data-type="success"] { border-left: 4px solid #10b981; } /* emerald-500 */
.toast[data-type="error"]   { border-left: 4px solid #ef4444; } /* red-500   */
.toast[data-type="info"]    { border-left: 4px solid #3b82f6; } /* blue-500  */
.toast[data-type="warning"] { border-left: 4px solid #f59e0b; } /* amber-500 */

.toast-icon {
  font-size: 18px;
  line-height: 1;
  margin-top: 1px;
}

.toast-content {
  display: grid;
  gap: 2px;
}

.toast-title {
  font-weight: 700;
  font-size: 14px;
}

.toast-msg {
  font-size: 13px;
  color: #e5e7eb; /* gray-200 */
}

.toast-close {
  border: 0;
  background: transparent;
  color: #9ca3af; /* gray-400 */
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
}
.toast-close:hover { color: #f3f4f6; }

.toast-progress {
  grid-column: 1 / -1;
  height: 3px;
  border-radius: 999px;
  background: #1f2937; /* gray-800 */
  overflow: hidden;
}
.toast-progress > span {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  background: linear-gradient(90deg,#16a34a,#22c55e); /* green */
  animation: toast-progress linear forwards;
}

@keyframes toast-in {
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(6px) scale(.98); }
}
@keyframes toast-progress {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .toast, .toast-progress > span { animation: none !important; }
}
