/* 
 * Custom Admin CSS 
 * Add any future custom styles for the admin dashboard here.
 */

:root { --primary: #1E293B; }
body { font-family: 'Nunito', sans-serif; background-color: #f8f9fc; }
#wrapper { display: flex; }
#content-wrapper { width: 100%; overflow-x: hidden; }
.sidebar { width: 250px; min-height: 100vh; background: #1E293B; color: white; }
.sidebar .nav-item { padding: 15px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); cursor: pointer; transition: 0.3s; }
.sidebar .nav-item:hover { background: rgba(255,255,255,0.1); }
.sidebar .nav-item.active { background: rgba(255,255,255,0.2); font-weight: bold; }
.topbar { height: 70px; background: white; box-shadow: 0 .15rem 1.75rem 0 rgba(58,59,69,.15); display: flex; align-items: center; padding: 0 20px; margin-bottom: 25px; }
.card { border: none; border-radius: 0.35rem; box-shadow: 0 .15rem 1.75rem 0 rgba(58,59,69,.15); }
.card-header { background-color: #f8f9fc; border-bottom: 1px solid #e3e6f0; font-weight: bold; color: #1E293B; }

/* Override primary text and background colors */
.text-primary { color: #1E293B !important; }
.bg-primary { background-color: #1E293B !important; }

/* Override all buttons except danger/close to use #10B981 */
.btn:not(.btn-danger):not(.btn-outline-danger):not(.btn-close) {
    background-color: #10B981 !important;
    border-color: #10B981 !important;
    color: #ffffff !important;
}
.btn:not(.btn-danger):not(.btn-outline-danger):not(.btn-close):hover {
    background-color: #0ea171 !important;
    border-color: #0ea171 !important;
    color: #ffffff !important;
}

/* Custom styles for External Code badging and active chat items */
.user-item .ext-code-badge,
.support-item .ext-code-badge {
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: bold;
    color: #ffffff !important;
}
.ext-code-default { background-color: #00001A; }
.ext-code-military { background-color: #182916; }
.ext-code-bv { background-color: #000000; }
.ext-code-other { background-color: #6c757d; }

.user-item.active,
.support-item.active {
    background-color: #047857 !important;
    border-color: #047857 !important;
}
.user-item.active h6,
.user-item.active p,
.user-item.active .text-muted.chat-date,
.user-item.active .user-card-display,
.support-item.active h6,
.support-item.active p,
.support-item.active .text-muted {
    color: #ffffff !important;
}

/* Chat Layout Styles */
.chat-user-msg {
    max-width: 200px;
}
#chat-messages {
    height: 450px;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fc;
    border: 1px solid #eee;
    margin-bottom: 10px;
    border-radius: 5px;
}
#load-more-container, #close-chat-btn, #message-templates {
    display: none;
}
.msg-content-wrapper {
    max-width: 75%;
}
.msg-time {
    font-size: 0.7rem;
}

.sidebar-chat-list {
    max-height: 700px;
    overflow-y: auto;
}

/* --- Login Page Styles --- */
:root {
    --login-primary: #10B981;
    --login-primary-hover: #0ea171;
    --login-surface: rgba(30, 41, 59, 0.7);
    --login-surface-border: rgba(255, 255, 255, 0.1);
    --login-text-main: #f8fafc;
    --login-text-muted: #94a3b8;
    --login-error: #ef4444;
    --login-error-bg: rgba(239, 68, 68, 0.1);
}

.login-body {
    background-color: #ffffff !important;
    color: #1E293B !important;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    margin: 0;
}

.login-body * {
    box-sizing: border-box;
}

/* Animated Background Gradients */
.login-body .bg-shape {
    position: absolute;
    filter: blur(100px);
    border-radius: 50%;
    animation: float 20s infinite ease-in-out alternate;
    z-index: 0;
}

.login-body .shape1 {
    width: 400px;
    height: 400px;
    background: rgba(99, 102, 241, 0.3);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.login-body .shape2 {
    width: 500px;
    height: 500px;
    background: rgba(168, 85, 247, 0.2);
    bottom: -200px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, 50px) scale(1.1); }
    100% { transform: translate(-50px, 100px) scale(0.9); }
}

/* Glassmorphism Container */
.login-container {
    position: relative;
    z-index: 10;
    background: #1E293B !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--login-surface-border);
    padding: 3rem;
    border-radius: 1.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header p {
    color: var(--login-text-muted);
    font-size: 0.95rem;
    font-weight: 300;
}

.login-form-group {
    margin-bottom: 1.5rem;
}

.login-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--login-text-muted);
    font-weight: 400;
}

.login-form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid var(--login-surface-border) !important;
    border-radius: 0.75rem;
    color: white !important;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.login-form-control:focus {
    border-color: var(--login-primary) !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    background: rgba(15, 23, 42, 0.8) !important;
}

.login-btn-submit {
    width: 100%;
    padding: 0.875rem;
    border: none;
    border-radius: 0.75rem;
    background: var(--login-primary) !important;
    color: white !important;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.login-btn-submit:hover {
    background: var(--login-primary-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

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

.login-error-message {
    background: var(--login-error-bg);
    border-left: 4px solid var(--login-error);
    color: #fca5a5;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    animation: shake 0.5s ease-in-out;
}

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

/* Subtle glowing dots in background */
.login-body .dots {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 24px 24px;
    z-index: 1;
}

/* Sidebar Chat Tabs styles */
.chat-tab-item {
    width: 33.33%;
}
.chat-tab-btn {
    font-size: 0.85rem;
}

/* Sidebar Uman requests filtering */
.show-only-unassigned .user-item:not(.needs-operator-chat) {
    display: none !important;
}

.show-only-human .user-item:not(.needs-operator-chat):not(.assigned-operator-chat) {
    display: none !important;
}

/* Quick reply options styles */
.chat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    margin-top: 10px;
}

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

.chat-chip-btn {
    background: #ffffff;
    border: 1px solid rgb(38, 50, 56);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: rgb(38, 50, 56);
    transition: all 0.3s ease;
    animation: chipFadeIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.chat-chip-btn:hover {
    background: rgb(38, 50, 56);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(38, 50, 56, 0.2);
}

/* Chat points link style */
.chat-points-link {
    color: #000000;
    font-weight: bold;
    text-decoration: underline;
}
