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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    color: #1f2838;
    line-height: 1.6;
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1f2838 0%, #2a3441 100%);
}

.login-box {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    color: #1f2838;
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
    font-weight: 600;
}

.login-box p {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    color: #1f2838;
    font-weight: 600;
    font-size: 1rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #ffc107;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.1);
}

/* Form Control Styles (for textareas and inputs) */
.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.3s;
    background-color: white;
    color: #1f2838;
    line-height: 1.6;
}

.form-control:focus {
    outline: none;
    border-color: #ffc107;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.1);
    background-color: #fffef9;
}

.form-control::placeholder {
    color: #999;
    opacity: 0.7;
}

/* Textarea specific styles */
textarea.form-control {
    min-height: 120px;
    resize: vertical;
    padding: 1rem 1.25rem;
    line-height: 1.7;
}

textarea.form-control:focus {
    min-height: 140px;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.btn-primary {
    background-color: #ffc107;
    color: #1f2838;
    width: 100%;
}

.btn-primary:hover {
    background-color: #ffb300;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background-color: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.alert-success {
    background-color: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

/* Admin Dashboard Styles */
.admin-container {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background-color: #1f2838;
    color: white;
    padding: 2rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.admin-sidebar h2 {
    padding: 0 1.5rem;
    margin-bottom: 2rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffc107;
}

.admin-sidebar nav ul {
    list-style: none;
}

.admin-sidebar nav ul li {
    margin-bottom: 0.25rem;
}

.admin-sidebar nav ul li a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.admin-sidebar nav ul li a:hover {
    background-color: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.admin-sidebar nav ul li a.active {
    background-color: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    border-left: 3px solid #ffc107;
}

.nav-group {
    position: relative;
}

.nav-submenu {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 1.5rem;
    max-height: 300px;
    overflow: visible;
}

.nav-submenu li {
    margin-bottom: 0.25rem;
}

.nav-submenu a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-submenu a:hover {
    background-color: rgba(255, 193, 7, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.nav-submenu a.active {
    background-color: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    font-weight: 500;
}

.admin-main {
    margin-left: 250px;
    flex: 1;
    padding: 2rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.admin-header h1 {
    color: #1f2838;
    font-size: 1.75rem;
    font-weight: 600;
}

.admin-header .user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-header .user-info span {
    color: #666;
    font-size: 0.9rem;
}

.admin-header .btn-logout {
    background-color: #1f2838;
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.admin-header .btn-logout:hover {
    background-color: #2a3441;
}

.admin-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.admin-content h2 {
    color: #1f2838;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.admin-content p {
    color: #666;
    line-height: 1.8;
}

/* Admin Manager Styles */
.invite-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #e0e0e0;
}

.invite-form {
    max-width: 500px;
}

.invite-form .btn-primary {
    width: auto;
}

.admins-list-section {
    margin-top: 2rem;
}

.admins-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.admins-table thead {
    background-color: #f8f9fa;
}

.admins-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #1f2838;
    border-bottom: 2px solid #e0e0e0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admins-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e0e0e0;
    color: #666;
}

.admins-table tbody tr:hover {
    background-color: #f8f9fa;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-active {
    background-color: #d4edda;
    color: #155724;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-closed {
    background-color: #f8d7da;
    color: #721c24;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.text-muted {
    color: #999;
    font-style: italic;
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: #666;
}

.form-group input[disabled] {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    margin: 0;
    color: #1f2838;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Email modal header with dark background */
.modal-large .modal-header {
    background: linear-gradient(135deg, #1f2838 0%, #2a3441 100%);
    color: white;
    border-bottom: none;
}

.modal-large .modal-header h3 {
    color: white;
}

.modal-large .modal-header p {
    color: rgba(255, 255, 255, 0.9);
}

.modal-body {
    padding: 1.5rem;
}

.modal-body p {
    margin: 0.5rem 0;
    color: #666;
    line-height: 1.6;
}

.modal-body strong {
    color: #1f2838;
    font-weight: 600;
}

.modal-warning {
    color: #dc3545;
    font-size: 0.9rem;
    margin-top: 0.75rem !important;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Curriculum Page Styles */
.curriculum-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #e0e0e0;
}

.curriculum-section:last-child {
    border-bottom: none;
}

.section-helper {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    padding: 1rem;
    background-color: #f8f9fa;
    border-left: 3px solid #ffc107;
    border-radius: 4px;
}

.large-textarea {
    min-height: 400px;
    padding: 1.25rem 1.5rem;
    font-size: 1rem;
    line-height: 1.8;
    resize: vertical;
}

.large-textarea:focus {
    min-height: 420px;
}

.field-helper {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    line-height: 1.6;
    font-style: normal;
    padding: 0.5rem 0.75rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 2px solid #ffc107;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.last-saved {
    color: #666;
    font-size: 0.85rem;
    margin-left: auto;
}

/* Module Layout */
.module-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
}

.module-list {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.module-list h3 {
    color: #1f2838;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.pillar-group {
    margin-bottom: 1.5rem;
}

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

.pillar-group h4 {
    color: #1f2838;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.module-list-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.module-list-items li {
    margin-bottom: 0.25rem;
}

.module-list-items a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.module-list-items a:hover {
    background-color: rgba(255, 193, 7, 0.1);
    color: #1f2838;
}

.module-list-items a.active {
    background-color: rgba(255, 193, 7, 0.15);
    color: #1f2838;
    font-weight: 500;
}

.module-editor {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.module-editor h3 {
    color: #1f2838;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

/* Intent Inputs */
.intent-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.intent-input-group input {
    flex: 1;
}

.btn-remove-intent {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.btn-remove-intent:hover {
    background-color: #c82333;
}

.btn-link {
    background: none;
    border: none;
    color: #1f2838;
    text-decoration: underline;
    cursor: pointer;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.btn-link:hover {
    color: #ffc107;
}

/* Responsive */
@media (max-width: 968px) {
    .module-layout {
        grid-template-columns: 1fr;
    }
    
    .module-list {
        position: static;
    }
}

/* Onboarding Chat Styles */
.onboarding-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1f2838 0%, #2a3441 100%);
    padding: 2rem;
}

.chat-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 800px;
    height: 80vh;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    padding: 2rem;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #1f2838 0%, #2a3441 100%);
    color: white;
}

.chat-header h1 {
    color: white;
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
    font-weight: 600;
}

.chat-header p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-size: 0.95rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    display: flex;
    margin-bottom: 1rem;
}

.message-user {
    justify-content: flex-end;
}

.message-assistant {
    justify-content: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 0.875rem 1.125rem;
    border-radius: 12px;
    word-wrap: break-word;
    line-height: 1.5;
}

.message-user .message-content {
    background: #ffc107;
    color: #1f2838;
    border-bottom-right-radius: 4px;
}

.message-assistant .message-content {
    background: #f0f0f0;
    color: #1f2838;
    border-bottom-left-radius: 4px;
}

.typing-indicator {
    display: none !important;
    justify-content: flex-start;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    min-height: 50px;
    opacity: 0;
    visibility: hidden;
    width: 100%;
    position: relative;
}

.typing-indicator.show {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.typing-dots {
    display: flex;
    gap: 0.5rem;
    padding: 0.875rem 1.125rem;
    background: #f0f0f0;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    align-items: center;
    min-width: 60px;
    max-width: fit-content;
}

.typing-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #666;
    animation: typing-bounce 1.4s infinite ease-in-out;
    display: inline-block;
    flex-shrink: 0;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.chat-input-container {
    padding: 1.5rem;
    border-top: 1px solid #e0e0e0;
    background: #fafafa;
}

.chat-form {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    padding: 1.25rem 1.25rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1.1rem;
    font-family: inherit;
    transition: border-color 0.2s;
    min-height: 60px;
}

.chat-input:focus {
    outline: none;
    border-color: #ffc107;
}

.chat-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.chat-form .btn {
    padding: 0.875rem 1.5rem;
    white-space: nowrap;
    font-size: 1rem;
    min-height: 60px;
    width: auto;
    align-self: flex-end;
}

/* Email Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    overflow: hidden;
}

.modal-large {
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}


.modal-body {
    padding: 1.5rem;
}

.modal-body p {
    margin-bottom: 1.5rem;
    color: #666;
    line-height: 1.6;
}

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

.modal-body .form-control {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}

.modal-body .form-control:focus {
    outline: none;
    border-color: #ffc107;
}

.modal-body .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.review-section {
    margin-bottom: 2rem;
}

.review-section h4 {
    color: #1f2838;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: #666;
}

/* Responsive adjustments for chat */
@media (max-width: 768px) {
    .onboarding-container {
        padding: 1rem;
    }
    
    .chat-wrapper {
        height: 90vh;
        max-height: none;
    }
    
    .chat-header {
        padding: 1.5rem;
    }
    
    .chat-header h1 {
        font-size: 1.5rem;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .chat-input-container {
        padding: 1rem;
    }
}

