@font-face {
    font-family: 'Arizonia';
    src: url('../fonts/Arizonia-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap; /* Improves loading performance */
}

body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 0; 
    background-color: #e3e3e3;
    box-sizing: border-box;
    overflow: hidden;
}

.app-title {
    color: white;
    text-decoration: none;
    font-weight: bold;
    display: inline;
    padding: 15px 0;
    vertical-align: middle;
    font-size: 20px;
    /* font-size: 30px;
    font-family: 'Arizonia', cursive, serif; */
}

.admin-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    background-color: #f5f5f5;
    color: #333;
}

.admin-header {
    background-color: #5b7893;
    color: white;
    padding: 0 35px 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 3000;
    box-shadow: 0px 3px 11px -6px rgba(0, 0, 0, 0.75);
}

.admin-actions {
    display: flex;
    gap: 10px;
}

.admin-button {
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid #34495e;
    background-color: white;
    color: #000;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: bold;
    -webkit-box-shadow: 6px 6px 5px -4px rgba(75,81,112,1);
    -moz-box-shadow: 6px 6px 5px -4px rgba(75,81,112,1);
    box-shadow: 6px 6px 5px -4px rgba(75,81,112,1);
}

.admin-button.disabled {
    background-color: #abc9b8;
    color: #ebeaea;
    margin-right: 20px;
    box-shadow: none;
    border: none;
    cursor: not-allowed;
}

.admin-button.primary {
    color: black;
    margin-right: 20px;
    border: 1px solid black;
    position: fixed;
    right: 100px;
    z-index: 5;
    bottom: 30px;
    z-index: 1000;
}

.admin-button.primary.disabled {
    color: #c5c5c5;
    border: 1px solid #ccc;
    cursor: not-allowed;
    background-color: white;
}

.admin-button.primary.disabled:hover {
    background-color: white;
    color: #c5c5c5;
}

.admin-button.primary:hover {
    background-color: #2980b9;
    color: white;
}

.admin-button.test-app,
.admin-button.chat-app {
    font-size: 13px;
    font-weight: bold;
    background: #f4f4f4;
    min-width: 100px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    justify-content: center;
}

.admin-button.test-app:hover,
.admin-button.chat-app:hover {
    transform: translateY(-2px);
    background: #fff;
    box-shadow: 0 8px 30px rgba(6, 6, 6, 0.15);
}

.admin-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.admin-sidebar {
    width: 205px;
    background-color: #5b7893;
    color: white;
    overflow-y: auto;
    transition: width 0.3s ease;
}

.admin-sidebar.collapsed {
    width: 60px;
}

.sidebar-toggle {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    color: white;
    background-color: #5a7289;
    cursor: pointer;
    padding: 20px;
    border-bottom: 1px solid #34495e;
    gap: 10px;
}

.sidebar-toggle .toggle-text {
    font-size: 14px;
    font-weight: bold;
    transition: opacity 0.2s ease;
    padding-left: 5px;
}

.sidebar-toggle i {
    transition: transform 0.3s ease;
}

.admin-sidebar.collapsed .sidebar-toggle .toggle-text {
    display: none;
}

.admin-sidebar.collapsed .sidebar-toggle i {
    transform: rotate(0deg); /* No need to rotate the bars icon */
}

.nav-sections {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-section span {
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.2s ease;
}

.admin-sidebar.collapsed .nav-section span {
    display: none;
}

.admin-sidebar.collapsed .nav-section {
    justify-content: center;
    padding: 18px;
}

.admin-sidebar.collapsed .nav-section:hover:after {
    content: attr(data-section);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background-color: #2c3e50;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-left: 8px;
}

/* Add a pointer tip to the tooltip */
.admin-sidebar.collapsed .nav-section:hover:before {
    content: "";
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent #2c3e50 transparent transparent;
    z-index: 1000;
}

.nav-section {
    padding: 20px 18px;
    cursor: pointer;
    border-bottom: 1px solid #2c3e50;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.admin-sidebar.collapsed .nav-section .section-name {
    display: none;
}

.nav-section .section-name {
    transition: opacity 0.2s ease;
    padding-left: 5px;
}

.nav-section:hover {
    background-color: #2c3e50;
}

.nav-section.active {
    background-color: #35617f;
    border-radius: 0 20px 20px 0;
    position: relative;
    margin: 4px 10px 4px 3px;
    padding: 15px;
}

.nav-section.active::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: -10px;
    right: -10px;
    height: 0.6px;
    background-color: #2c3e50;
}

.nav-section i {
    width: 20px;
    text-align: center;
}

.admin-main {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

.section-content {
    display: none;
    height: 100%;
}

.section-content.active {
    display: block;
}

.placeholder-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #95a5a6;
    font-size: 18px;
    text-align: center;
    padding: 20px;
}

.placeholder-message i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #e74c3c;
    text-align: center;
}

.error-message i {
    font-size: 48px;
    margin-bottom: 16px;
}

.error-message button {
    margin-top: 16px;
}

.admin-button.error {
    background-color: #e74c3c;
}

.admin-container .bot-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 8px;
    object-fit: cover;
    flex-shrink: 0;
    vertical-align: middle;
}

/* Christmas hat decoration on user avatar */
.admin-container .user-avatar::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 20%;
    transform: translateX(-50%);
    width: 35px;
    height: 35px;
    background-image: url('/assets/christmas-hat-png-19607.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 15; /* Above the avatar and language badge */
    pointer-events: none; /* Allow clicks to pass through to avatar */
}

/* Subtle bounce animation on hover for festive effect */
@keyframes hat-bounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-2px);
    }
}

.admin-container .user-avatar:hover::before {
    animation: hat-bounce 0.6s ease-in-out infinite;
}

/* Custom tooltip styling */
.has-tooltip {
    position: relative;
}

/* Workflow styling */
.workflow-header {
    cursor: pointer;
    background-color: #f5f5f5;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
}

.workflow-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold; 
}

.workflow-count {
    background-color: #ddd;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.8em;
}

.workflow-container {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: white;
}

.workflow-container.hidden {
    max-height: 0;
}

/* Make workflow items indented */
.workflow-container li {
    padding-left: 24px;
}

.section-container .section-header {
    padding: 20px 50px 0 30px;
    display: block;
    justify-content: space-between;
    align-items: center;
    /* border-bottom: 1px solid #ddd; */
    background-color: #f4f3f3;
    /* box-shadow: -4px 9px 7px -8px rgba(0,0,0,0.75); */
    z-index: 1000;
    position: sticky;
    top: 0;
}

.section-container {
    height: 100%;
    overflow-y: auto;
}

.section-header-title {
    display: inline-block
}

.section-header .reload-button {
    display: inline-block;
    padding-left: 20px;
}

.reload-button #refreshInstructions:hover,
.reload-button #refreshAgentsNew:hover, 
.reload-button #refreshCalls:hover, 
.reload-button #refreshLogs:hover,
.reload-button #refreshRag:hover, 
.reload-button #refreshWorkflows:hover,
.reload-button #refreshUsage:hover,
.reload-button #refreshUsers:hover,
.reload-button #refreshSessions:hover,
.reload-button #refreshConfigs:hover,
.reload-button #refreshMcpServers:hover {
    background: white;
}

.reload-button #refreshInstructions,
.reload-button #refreshAgentsNew, 
.reload-button #refreshCalls, 
.reload-button #refreshLogs,
.reload-button #refreshRag, 
.reload-button #refreshWorkflows,
.reload-button #refreshUsage,
.reload-button #refreshUsers,
.reload-button #refreshSessions,
.reload-button #refreshConfigs,
.reload-button #refreshMcpServers {
    font-size: 15px;
    background: none;
    border: 1px solid #bcbcbc;
    border-radius: 54px;
    padding: 10px;
    cursor: pointer;
    box-shadow: 6px 6px 5px -4px rgba(75,81,112,1);
    vertical-align: super;
}

/* Agent configuration panel */
.agents-layout, .workflows-layout, .instructions-layout,
.rag-content, .logs-table-container,
.calls-layout, .users-container {
    display: flex;
    height: 100%;
    border: 1px solid #d0cece;
    border-radius: 11px;
    margin: 0 20px 0 20px;
    background-color: white;
}

.admin-container .user-avatar-container {
    margin-left: 15px;
    padding: 0 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    position: relative;
}

.admin-container .user-avatar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 0;
    background-color: transparent;
}

.admin-container .user-avatar i {
    background-color: transparent;
    padding: 0;
    border: none;
    font-size: 28px;
    color: white;
    flex-shrink: 0;
}

.admin-container .user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
}

/* User dropdown styles */
.admin-container .user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: none;
    z-index: 1000;
    min-width: 120px;
}


.admin-container .user-avatar-container:hover .user-dropdown {
    display: block;
}

.admin-container .user-dropdown .dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 15px;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    font-size: 0.85rem;
}

.admin-container .user-dropdown .dropdown-item:hover {
    background-color: #f5f5f5;
}

.user-info .role-badge {
    font-family: Arial, sans-serif;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    color: white;
    background-color: #dc3545;
    margin: 0;
    line-height: 1;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 0;
}

.username {
    margin: 0;
    font-size: 14px;
    color: white;
    line-height: 1.2;
    font-weight: 500;
}

.admin-button.test-app i, 
.admin-button.chat-app i {
    padding-right: 5px;
}

/* Custom styles for toast notifications */
.toastify {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    display: flex;
    align-items: center;
    padding: 12px 20px !important;
    font-size: 14px;
    max-width: 400px;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

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

.toast-icon {
    margin-right: 10px;
    display: inline-flex;
    font-size: 18px;
}

.toast-message {
    flex: 1;
}

/* Optional close button styling */
.toastify .toast-close {
    color: white;
    opacity: 0.7;
}

.toastify .toast-close:hover {
    opacity: 1;
}

.app-title sup {
    font-size: 0.4rem;
    border: 1px solid white;
    border-radius: 15px;
    padding: 2px 4px;
    margin-left: 2px;
    display: inline-flex;
    vertical-align: text-top;
}

#welcomeSection .welcome-container {
    padding: 20px 60px;
    height: 100%;
    margin: auto;
    overflow-y: auto;
}

.welcome-hero {
    background: linear-gradient(135deg, #9fbfde 0%, #2c3e50 100%);
    color: white;
    padding: 60px 40px;
    text-align: center;
    margin-bottom: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(229, 235, 248, 0.1);
    box-sizing: border-box;
}

.welcome-hero-content {
    margin: 0 auto;
}

.welcome-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 20px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.welcome-hero h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: bold;
}

.welcome-hero h1 sup {
    font-size: 0.4em;
    border: 1px solid white;
    border-radius: 15px;
    padding: 2px 6px;
    margin-left: 5px;
}

.welcome-subtitle {
    font-size: 1.3em;
    margin-bottom: 20px;
    color: #ecf0f1;
    font-weight: 300;
}

.welcome-hero-content .welcome-description {
    font-size: 1.1em;
    line-height: 1.6;
    color: #c7dbf7;
    max-width: 600px;
    margin: 0 auto;
}

.welcome-features, .welcome-screenshots, .welcome-tutorials {
    padding: 50px 40px;
    background: #FAF9F6;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.welcome-features h2, .welcome-screenshots h2, .welcome-tutorials h2 {
    text-align: center;
    font-size: 2em;
    color: #2c3e50;
    margin-bottom: 40px;
    font-weight: 600;
}

.features-grid, .screenshots-grid, .tutorials-grid {
    display: grid;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.features-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.screenshots-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.tutorials-grid {
    grid-template-columns: repeat(auto-fit, minmax(275px, 1fr));
    max-width: none;
}

.feature-card, .screenshot-card, .tutorial-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #ecf0f1;
}

.feature-card:hover, .screenshot-card:hover, .tutorial-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

/* Clickable tutorial card styling */
.tutorial-card.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.tutorial-card.clickable:hover {
    transform: translateY(-15px);
    box-shadow: 0 12px 40px rgba(52, 152, 219, 0.2);
}

/* .tutorial-card.clickable .tutorial-placeholder {
    transition: all 0.3s ease;
} */

.tutorial-card.clickable:hover .tutorial-placeholder {
    background: linear-gradient(135deg, #005289, #3a83b3);
    color: white;
}

.tutorial-card.clickable:hover .tutorial-placeholder p  {
    color: white;
}

.tutorial-card.clickable:hover .tutorial-placeholder i {
    color: white;
    transform: scale(1.1);
}

.welcome-features .feature-card i {
    font-size: 3em;
    color: #3498db;
    margin-bottom: 20px;
}

.welcome-features .feature-card h3, 
.welcome-features .tutorial-card h3 {
    font-size: 1.3em;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
    top: 0;

}

.welcome-features .feature-card p, .tutorial-card p {
    color: #7f8c8d;
    line-height: 1.6;
    margin: 0;
}

.screenshot-placeholder, .tutorial-placeholder {
    background: #ecf0f1;
    border-radius: 8px;
    padding: 60px 20px;
    margin-bottom: 20px;
    color: #95a5a6;
    border: 2px dashed #bdc3c7;
}

.screenshot-placeholder i, .tutorial-placeholder i {
    font-size: 3em;
    margin-bottom: 15px;
    display: block;
}

.tutorial-placeholder {
    background: #34495e;
    color: white;
    border-color: #2c3e50;
}

.tutorial-placeholder i {
    color: #3498db;
}

/* Responsive Design */
@media (max-width: 768px) {
    .welcome-hero {
        padding: 40px 20px;
    }
    
    .welcome-hero h1 {
        font-size: 2em;
    }
    
    .welcome-features, .welcome-screenshots, .welcome-tutorials {
        padding: 30px 20px;
    }
    
    .feature-card, .screenshot-card, .tutorial-card {
        padding: 20px;
    }
}

/* Screenshot Image Styling */
.screenshot-image {
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
}

.screenshot-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.screenshot-card:hover .screenshot-image img {
    transform: scale(1.02);
}

.screenshot-card h3 {
    font-size: 1.2em;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 600;
}

.screenshot-card p {
    color: #7f8c8d;
    line-height: 1.5;
    font-size: 0.95em;
}

/* Remove the old placeholder styling since we're using real images now */
.screenshot-placeholder {
    display: none;
}
