/* ===================================
   Bus2College - Main Styles
   =================================== */

/* Color Scheme */
:root {
    --navy-blue: #002855;
    --yellow: #FFD700;
    --orange: #C8511F;
    --light-gray: #f5f5f5;
    --medium-gray: #e0e0e0;
    --dark-gray: #333;
    --white: #ffffff;
    --success: #28a745;
    --error: #dc3545;
    --border-radius: 8px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-gray);
    background-color: var(--light-gray);
}

/* ===================================
   Login Page Styles
   =================================== */

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f0f4f8 0%, #d9e8f5 100%);
}

.login-container {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--medium-gray);
    max-width: 450px;
    width: 90%;
    padding: 40px;
}

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

.login-logo {
    max-width: 200px;
    width: 100%;
    height: auto;
    margin-bottom: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.login-header h1 {
    color: var(--navy-blue);
    font-size: 28px;
    margin-bottom: 10px;
}

.login-header p {
    color: var(--dark-gray);
    font-size: 14px;
}

.auth-forms {
    margin-top: 20px;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    color: var(--navy-blue);
    margin-bottom: 20px;
    font-size: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark-gray);
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--navy-blue);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background-color: var(--orange);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #a63d17;
}

.form-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
}

.form-footer a {
    color: var(--orange);
    text-decoration: none;
    font-weight: 500;
}

.form-footer a:hover {
    text-decoration: underline;
}

.message-box {
    margin-top: 20px;
    padding: 12px;
    border-radius: var(--border-radius);
    display: none;
    text-align: center;
}

.message-box.success {
    display: block;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-box.error {
    display: block;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ===================================
   Home Page Styles
   =================================== */

.home-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background-color: #f8f9fa;
}

/* Header */
.app-header {
    background-color: var(--white);
    color: var(--dark-gray);
    padding: 12px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-bottom: 3px solid var(--navy-blue);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    max-height: 60px;
    height: auto;
    width: auto;
}

.header-branding {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.app-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--navy-blue);
    margin: 0;
    line-height: 1.2;
}

.app-motto {
    font-size: 13px;
    color: var(--orange);
    margin: 0;
    font-style: italic;
    font-weight: 500;
    line-height: 1.2;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.user-name {
    font-weight: 600;
    color: var(--navy-blue);
    font-size: 15px;
}

.user-role {
    font-size: 12px;
    color: var(--orange);
    font-weight: 500;
    background-color: rgba(200, 81, 31, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.btn-logout {
    padding: 8px 16px;
    background-color: var(--orange);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn-logout:hover {
    background-color: #a63d17;
}

/* Main Container with Three Panels */
.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Left Navigation Panel */
.left-nav {
    width: 250px;
    background-color: var(--white);
    border-right: 2px solid var(--medium-gray);
    padding: 20px;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
    transition: width 0.3s ease, padding 0.3s ease;
    position: relative;
}

.left-nav.collapsed {
    width: 60px;
    padding: 20px 5px;
}

.left-nav.collapsed .nav-text {
    display: none;
}

.left-nav.collapsed .nav-icon {
    margin-right: 0;
    font-size: 24px;
}

.left-nav.collapsed .nav-link {
    justify-content: center;
    padding: 12px 8px;
}

.btn-toggle-nav {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--navy-blue);
    border: none;
    color: var(--white);
    cursor: pointer;
    font-size: 14px;
    padding: 6px 10px;
    border-radius: 4px;
    transition: background 0.3s;
    z-index: 10;
}

.btn-toggle-nav:hover {
    background: #003366;
}

.left-nav.collapsed .btn-toggle-nav {
    right: 50%;
    transform: translateX(50%);
}

.left-nav h3 {
    color: var(--navy-blue);
    margin-bottom: 20px;
    font-size: 18px;
}

.nav-menu {
    list-style: none;
    margin-top: 50px;
}

.nav-menu li {
    margin-bottom: 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--dark-gray);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: background-color 0.3s, color 0.3s;
}

.nav-link:hover {
    background-color: var(--light-gray);
}

.nav-link.active {
    background-color: var(--navy-blue);
    color: var(--white);
}

.nav-icon {
    margin-right: 10px;
    font-size: 20px;
    filter: grayscale(40%) contrast(150%);
    opacity: 0.85;
    font-weight: 300;
}

.nav-text {
    font-size: 14px;
}

/* Center Content Panel */
.center-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background-color: var(--white);
}

.content-page {
    display: none;
}

.content-page.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

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

.content-page h2 {
    color: var(--navy-blue);
    margin-bottom: 12px;
    margin-top: 0;
    font-size: 24px;
    border-bottom: 3px solid var(--orange);
    padding-bottom: 6px;
}

.content-section {
    margin-top: 15px;
}

.content-section p {
    margin-bottom: 15px;
    color: var(--dark-gray);
}

.action-bar {
    margin: 20px 0;
}

.btn-secondary {
    padding: 10px 20px;
    background-color: var(--navy-blue);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    margin-right: 10px;
}

.btn-secondary:hover {
    background-color: #003d6b;
}

.data-list {
    margin-top: 20px;
    padding: 20px;
    background-color: var(--light-gray);
    border-radius: var(--border-radius);
    min-height: 150px;
}

.empty-state {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 40px 20px;
}

/* Essay Section */
.essay-section {
    margin-top: 20px;
}

.page-subtitle {
    color: #666;
    font-size: 14px;
    margin: 15px 0 15px 0;
    font-style: italic;
}

.info-banner-grey {
    background: #f5f5f5;
    color: #333;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
}

.prompt-selection-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    margin-bottom: 20px;
    align-items: start;
}

.prompt-dropdown-section {
    display: flex;
    flex-direction: column;
}

.prompt-dropdown-section label {
    font-weight: 600;
    color: var(--navy-blue);
    margin-bottom: 8px;
    font-size: 14px;
}

.form-select-compact {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    font-size: 14px;
    background: white;
}

.prompt-description-side {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #002855;
    font-size: 14px;
    color: #555;
    min-height: 100px;
}

.prompt-description-side strong {
    display: block;
    color: var(--navy-blue);
    margin-bottom: 8px;
    font-size: 13px;
    text-transform: uppercase;
}

.prompt-description-side p {
    margin: 0;
    line-height: 1.6;
}

.dual-editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.editor-panel {
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    overflow: hidden;
}

.editor-header {
    background: #f8f9fa;
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.editor-header h4 {
    margin: 0;
    font-size: 15px;
    color: var(--navy-blue);
    font-weight: 600;
}

.btn-get-feedback {
    padding: 6px 12px;
    font-size: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-get-feedback:hover {
    transform: translateY(-2px);
}

.rich-text-editor {
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    line-height: 1.8;
    color: #333;
}

.rich-text-editor[contenteditable="true"]:focus {
    outline: none;
    background: #fafafa;
}

.rich-text-editor.readonly {
    background: #f9f9f9;
    color: #666;
}

.rich-text-editor:empty:before {
    content: attr(data-placeholder);
    color: #999;
    font-style: italic;
}

.essay-word-count {
    font-size: 13px;
    color: #666;
    font-weight: 600;
}

/* Health Meter Styles */
.health-meter-container {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 15px;
}

.health-meter-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.health-label-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--navy-blue);
}

.health-score {
    font-size: 16px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 12px;
    background: #e9ecef;
    color: var(--navy-blue);
}

.health-meter-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.health-meter-fill {
    height: 100%;
    background: linear-gradient(90deg, #dc3545 0%, #ffc107 50%, #28a745 100%);
    transition: width 0.6s ease-in-out;
    border-radius: 10px;
}

.health-indicators {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.health-indicator {
    font-size: 11px;
    padding: 4px 8px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    color: #6c757d;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.health-indicator .indicator-label {
    font-weight: 500;
}

.health-indicator .indicator-score {
    font-weight: 700;
    font-size: 12px;
    padding: 1px 5px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

.health-indicator.good {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.health-indicator.good .indicator-score {
    background: rgba(21, 87, 36, 0.15);
}

.health-indicator.medium {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.health-indicator.medium .indicator-score {
    background: rgba(133, 100, 4, 0.15);
}

.health-indicator.poor {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.health-indicator.poor .indicator-score {
    background: rgba(114, 28, 36, 0.15);
}

/* Page Title with Help Icon */
.page-title-with-help {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
    margin-top: 0;
    padding-bottom: 8px;
    border-bottom: 3px solid var(--orange);
}

.page-title-with-help h2 {
    margin: 0;
    padding: 0;
    font-size: 24px;
    color: var(--navy-blue);
    border-bottom: none;
}

.page-action-icons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.action-icon-btn,
.help-icon-btn {
    padding: 0;
    background-color: var(--orange);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    max-width: 40px;
    min-width: 40px;
    height: 40px;
}

.action-icon-btn:hover,
.action-icon-btn.expanded,
.help-icon-btn:hover {
    background-color: #a63d17;
    transform: translateY(-1px);
    max-width: 200px;
    padding: 0 12px;
}

.action-label {
    display: inline-block;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-width 0.3s ease, opacity 0.3s ease;
}

.action-icon-btn:hover .action-label,
.action-icon-btn.expanded .action-label,
.help-icon-btn:hover .action-label {
    max-width: 150px;
    opacity: 1;
    margin-left: 4px;
}

.action-icon,
.help-icon {
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    color: white;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    width: 18px;
    height: 18px;
}

/* Help Popover */
.help-popover {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    overflow: hidden;
    animation: popoverFadeIn 0.3s ease;
}

@keyframes popoverFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.help-popover-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.help-popover-title {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-popover-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}

.help-popover-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.help-popover-body {
    padding: 25px;
    max-height: calc(80vh - 80px);
    overflow-y: auto;
}

/* Popover Overlay */
.help-popover-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    animation: overlayFadeIn 0.3s ease;
}

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

/* How to Use Section Styles (kept for popover content) */
.how-to-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.how-to-step {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.step-number {
    min-width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.step-content {
    flex: 1;
}

.step-content h4 {
    color: var(--navy-blue);
    margin: 0 0 8px 0;
    font-size: 16px;
}

.step-content p {
    margin: 0;
    color: #555;
    font-size: 14px;
    line-height: 1.6;
}

.how-to-tip {
    margin-top: 20px;
    padding: 15px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 5px;
    color: #856404;
    font-size: 14px;
}

.how-to-tip strong {
    color: #856404;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .dual-editor-container {
        grid-template-columns: 1fr;
    }
    
    .prompt-selection-container {
        grid-template-columns: 1fr;
    }
}

.form-select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    font-size: 14px;
}

.essay-textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    resize: vertical;
    min-height: 300px;
}

.essay-textarea:focus {
    outline: none;
    border-color: var(--navy-blue);
}

.essay-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

/* Status Summary */
.status-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.status-card {
    background-color: var(--light-gray);
    padding: 20px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--orange);
}

.status-card h3 {
    color: var(--navy-blue);
    margin-bottom: 15px;
    font-size: 20px;
}

.status-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background-color: var(--white);
    border-radius: var(--border-radius);
}

.stat-label {
    font-weight: 500;
    color: var(--dark-gray);
}

.stat-value {
    font-weight: 700;
    color: var(--orange);
    font-size: 18px;
}

.deadlines-list {
    background-color: var(--white);
    padding: 15px;
    border-radius: var(--border-radius);
}

/* Right AI Chat Panel */
.right-chat {
    width: 350px;
    background-color: #f8f9fa;
    border-left: 2px solid var(--medium-gray);
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.05);
    transition: width 0.3s ease;
    position: relative;
}

.right-chat.collapsed {
    width: 50px;
}

.right-chat.collapsed .chat-content {
    display: none;
}

.right-chat.collapsed .chat-header h3 {
    display: none;
}

.right-chat.collapsed .btn-clear-chat {
    display: none;
}

.chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background-color: var(--navy-blue);
    color: var(--white);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--orange);
    cursor: pointer;
    user-select: none;
}

.chat-header:hover {
    background-color: #003366;
}

.chat-header h3 {
    font-size: 18px;
    margin: 0;
}

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

.btn-clear-chat {
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    transition: opacity 0.3s;
}

.btn-clear-chat:hover {
    opacity: 0.7;
}

.btn-toggle-chat {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--white);
    cursor: pointer;
    font-size: 16px;
    padding: 5px 8px;
    border-radius: 4px;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
}

.btn-toggle-chat:hover {
    background: rgba(255, 255, 255, 0.3);
}

.right-chat.collapsed .btn-toggle-chat {
    position: absolute;
    right: 10px;
    top: 15px;
}

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

.chat-message {
    padding: 12px;
    border-radius: var(--border-radius);
    max-width: 90%;
    word-wrap: break-word;
}

.chat-message.user-message {
    background-color: var(--navy-blue);
    color: var(--white);
    align-self: flex-end;
    margin-left: auto;
}

.chat-message.ai-message {
    background-color: var(--white);
    color: var(--dark-gray);
    border: 1px solid var(--medium-gray);
    align-self: flex-start;
}

.chat-message p {
    margin: 0 0 10px 0;
}

.chat-message p:last-child {
    margin-bottom: 0;
}

.chat-message ul {
    margin: 10px 0;
    padding-left: 20px;
}

.chat-message li {
    margin-bottom: 5px;
}

.chat-input-container {
    padding: 15px;
    background-color: var(--white);
    border-top: 1px solid var(--medium-gray);
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    resize: none;
}

.chat-input:focus {
    outline: none;
    border-color: var(--navy-blue);
}

.btn-send-chat {
    padding: 10px 20px;
    background-color: var(--orange);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s;
}

.btn-send-chat:hover {
    background-color: #a63d17;
}

.btn-send-chat:disabled {
    background-color: var(--medium-gray);
    cursor: not-allowed;
}

.chat-status {
    padding: 10px 15px;
    text-align: center;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .right-chat {
        width: 300px;
    }
}

@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }

    .left-nav {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--medium-gray);
    }

    .nav-menu {
        display: flex;
        overflow-x: auto;
        gap: 10px;
    }

    .nav-menu li {
        margin-bottom: 0;
    }

    .nav-link {
        white-space: nowrap;
        padding: 10px 15px;
    }

    .right-chat {
        width: 100%;
        max-height: 400px;
        border-left: none;
        border-top: 1px solid var(--medium-gray);
    }

    .center-content {
        padding: 20px;
    }
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--medium-gray);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-gray);
}

/* ===================================
   Modal Styles
   =================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-in;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    max-width: 450px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideIn 0.3s ease-out;
}

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

.modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: var(--dark-gray);
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--orange);
}

.modal-content h2 {
    color: var(--navy-blue);
    margin-bottom: 15px;
    font-size: 24px;
}

.modal-content p {
    color: var(--dark-gray);
    margin-bottom: 20px;
    font-size: 14px;
}

.modal-content .form-group button {
    width: auto;
    margin-right: 10px;
    padding: 10px 20px;
}

/* Modal Variations */
.modal-large {
    max-width: 700px;
}

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

.modal-subtitle {
    color: #666;
    font-size: 14px;
    margin-bottom: 25px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    justify-content: flex-end;
}

.modal-actions button {
    width: auto;
    padding: 10px 20px;
}

/* Questionnaire Styles */
.questionnaire-container {
    min-height: 350px;
    position: relative;
}

.question-slide {
    display: none;
}

.question-slide.active {
    display: block;
    animation: fadeSlide 0.3s ease-in;
}

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

.question-number {
    color: var(--orange);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.question-slide h3 {
    color: var(--navy-blue);
    font-size: 20px;
    margin-bottom: 10px;
}

.question-help {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

.questionnaire-input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--medium-gray);
    border-radius: var(--border-radius);
    font-size: 16px;
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

.questionnaire-input:focus {
    outline: none;
    border-color: var(--navy-blue);
}

.questionnaire-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--medium-gray);
    border-radius: var(--border-radius);
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    resize: vertical;
    margin-bottom: 20px;
}

.questionnaire-textarea:focus {
    outline: none;
    border-color: var(--navy-blue);
}

.form-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--medium-gray);
    border-radius: var(--border-radius);
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    resize: vertical;
    min-height: 80px;
    margin-bottom: 10px;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--navy-blue);
}

/* Responsive textarea sizing */
@media (max-width: 768px) {
    .form-textarea {
        min-height: 60px;
    }
}

@media (min-width: 1200px) {
    .form-textarea {
        min-height: 100px;
    }
}

.interests-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.interest-checkbox {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: var(--light-gray);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.3s;
}

.interest-checkbox:hover {
    background-color: var(--medium-gray);
}

.interest-checkbox input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

/* Test Type Selection */
.test-type-selection {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.test-type-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background-color: var(--light-gray);
    border: 2px solid var(--medium-gray);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s;
}

.test-type-option:hover {
    background-color: var(--medium-gray);
}

.test-type-option input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
}

.test-type-option input[type="radio"]:checked + .test-label {
    font-weight: 600;
    color: var(--navy-blue);
}

.test-label {
    font-size: 16px;
    cursor: pointer;
}

.test-score-input {
    margin-bottom: 20px;
}

.question-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Loading Spinner */
.loading-container {
    text-align: center;
    padding: 40px 20px;
}

.spinner {
    border: 4px solid var(--light-gray);
    border-top: 4px solid var(--orange);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-container h3 {
    color: var(--navy-blue);
    margin-bottom: 10px;
}

.loading-container p {
    color: #666;
}

/* College Results Styles */
.college-results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

@media (max-width: 1200px) {
    .college-results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .college-results-grid {
        grid-template-columns: 1fr;
    }
}

.college-category {
    margin-bottom: 30px;
    padding-bottom: 20px;
}

.college-category:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

.college-category h3 {
    color: var(--navy-blue);
    font-size: 20px;
    font-weight: 300;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--orange);
    display: flex;
    align-items: center;
    gap: 10px;
}

.college-category.safety h3 {
    border-bottom-color: #b8b8b8;
}

.college-category.target h3 {
    border-bottom-color: #b8b8b8;
}

.college-category.reach h3 {
    border-bottom-color: #b8b8b8;
}

.college-card {
    background-color: var(--white);
    border: 2px solid var(--medium-gray);
    border-radius: var(--border-radius);
    padding: 14px;
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.2s;
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.college-card:hover {
    border-color: var(--navy-blue);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.college-card.selected {
    border-color: var(--orange);
    background-color: #fff8f0;
}

.college-card-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
}

.college-checkbox {
    margin-right: 12px;
    margin-top: 3px;
}

.college-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.college-info {
    flex: 1;
}

.college-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.3;
}

.college-name a {
    color: var(--navy-blue);
}

.college-location {
    color: #666;
    font-size: 13px;
    margin-bottom: 8px;
}

.college-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #666;
}

.college-meta span {
    display: block;
}

.college-details {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--light-gray);
}

.college-detail {
    font-size: 13px;
}

.college-detail-label {
    color: #666;
    font-weight: 500;
}

.college-detail-value {
    color: var(--dark-gray);
    font-weight: 600;
}

.college-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.college-badge.safety {
    background-color: #d4edda;
    color: #155724;
}

.college-badge.target {
    background-color: #fff3cd;
    color: #856404;
}

.college-badge.reach {
    background-color: #f8d7da;
    color: #721c24;
}

/* My Colleges List */
.colleges-list-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 3-Column Grid Layout for My Colleges */
.colleges-list-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.colleges-column {
    background: #f8f9fa;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.column-header {
    padding: 15px;
    margin: 0;
    font-size: 18px;
    font-weight: 300;
    color: white;
    text-align: center;
}

.safety-header {
    background: var(--navy-blue);
}

.target-header {
    background: var(--navy-blue);
}

.reach-header {
    background: var(--navy-blue);
}

.colleges-column-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 300px;
}

.empty-column {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 40px 20px;
}

/* Responsive Layout */
@media (max-width: 1200px) {
    .colleges-list-grid {
        grid-template-columns: 1fr;
    }
    
    .colleges-column-content {
        min-height: auto;
    }
}

.college-item {
    background: white;
    padding: 12px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--orange);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s;
}

.college-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.college-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 8px;
}

.college-item-title {
    flex: 1;
}

.college-item-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--navy-blue);
    margin-bottom: 5px;
    line-height: 1.3;
}

.college-link {
    color: var(--navy-blue);
    text-decoration: none;
    transition: color 0.2s;
}

.college-link:hover {
    color: var(--orange);
    text-decoration: underline;
}

.deadline-type-badge {
    display: inline-block;
    margin-left: 10px;
    padding: 3px 8px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.common-app-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px;
    background: none;
    color: inherit;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    max-width: 30px;
    overflow: hidden;
    white-space: nowrap;
}

.common-app-badge:hover {
    max-width: 200px;
}

.common-app-badge-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--navy-blue);
    opacity: 0;
    max-width: 0;
    transition: opacity 0.3s ease, max-width 0.3s ease;
}

.common-app-badge:hover .common-app-badge-label {
    opacity: 1;
    max-width: 150px;
}

.common-app-actions {
    margin-top: 8px;
}

.btn-common-app {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.btn-common-app:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2, #667eea);
}

.ca-icon {
    font-size: 14px;
}

.btn-common-app-export {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(245, 87, 108, 0.3);
}

.btn-common-app-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(245, 87, 108, 0.4);
    background: linear-gradient(135deg, #f5576c, #f093fb);
}

.college-item-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 13px;
    color: #666;
}

.college-item-meta span {
    display: block;
}

.college-item-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    transition: all 0.3s ease;
    max-width: 30px;
    overflow: hidden;
    white-space: nowrap;
}

.btn-icon:hover {
    max-width: 150px;
}

.btn-icon-label {
    font-size: 12px;
    font-weight: 600;
    opacity: 0;
    max-width: 0;
    transition: opacity 0.3s ease, max-width 0.3s ease;
}

.btn-icon:hover .btn-icon-label {
    opacity: 1;
    max-width: 100px;
}

.btn-edit {
    color: var(--navy-blue);
}

.btn-edit .btn-icon-label {
    color: var(--navy-blue);
}

.btn-delete {
    color: var(--error);
}

.btn-delete .btn-icon-label {
    color: var(--error);
}

/* Searchable Dropdown for College Selection */
.searchable-dropdown {
    position: relative;
    width: 100%;
}

.college-search-input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--medium-gray);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: border-color 0.3s;
}

.college-search-input:focus {
    outline: none;
    border-color: var(--navy-blue);
}

.college-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: white;
    border: 2px solid var(--navy-blue);
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    margin-top: -2px;
}

.college-dropdown-item {
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid var(--light-gray);
}

.college-dropdown-item:last-child {
    border-bottom: none;
}

.college-dropdown-item:hover {
    background-color: var(--light-gray);
}

.college-dropdown-item-name {
    font-weight: 600;
    color: var(--navy-blue);
    margin-bottom: 3px;
    font-size: 14px;
}

.college-dropdown-item-location {
    font-size: 12px;
    color: #666;
}

.college-dropdown-empty {
    padding: 15px;
    text-align: center;
    color: #999;
    font-style: italic;
}

/* Common App Integration Styles */
.common-app-stats-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.common-app-stats-section h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.2);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 13px;
    opacity: 0.9;
}

.common-app-features {
    margin-top: 20px;
}

.common-app-features h3 {
    color: var(--navy-blue);
    margin-bottom: 20px;
    font-size: 18px;
}

.feature-section {
    background: var(--light-gray);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.feature-section h4 {
    color: var(--navy-blue);
    margin: 0 0 10px 0;
    font-size: 16px;
}

.feature-section p {
    color: #666;
    margin: 0 0 15px 0;
    font-size: 14px;
    line-height: 1.6;
}

.feature-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.form-help {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* Deadline Urgency Indicators */
.deadline-urgent {
    color: #dc3545;
    font-weight: 600;
}

.deadline-soon {
    color: #ff8c00;
    font-weight: 600;
}

.deadline-passed {
    color: #999;
    text-decoration: line-through;
}

.deadline-not-set {
    color: #666;
    font-style: italic;
}

/* Essay Feedback Modal Styles */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 20px;
}

.modal-header h3 {
    color: var(--navy-blue);
    font-size: 24px;
    margin: 0;
}

.modal-body {
    padding: 20px 0;
}

.modal-body h4 {
    color: var(--navy-blue);
    margin-top: 25px;
    margin-bottom: 10px;
    font-size: 18px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 5px;
}

.modal-body ul {
    margin: 15px 0;
    padding-left: 25px;
    color: #333;
}

.modal-body li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.modal-body p {
    margin-bottom: 15px;
    color: #333;
    line-height: 1.7;
}

.modal-body code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #667eea;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
    margin-top: 20px;
}

.modal-footer button {
    padding: 10px 20px;
    min-width: 100px;
}

.info-banner {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.prompt-description {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    margin: 10px 0;
    font-size: 14px;
    color: #555;
    border-left: 4px solid #667eea;
}

.essay-word-count {
    text-align: right;
    margin-bottom: 5px;
    font-size: 14px;
    color: #666;
    font-weight: 600;
}
