/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* Login Page Styles */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    max-width: 400px;
    width: 100%;
    text-align: center;
}

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

.advisor-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    font-size: 32px;
}

.login-header h1 {
    color: #4A90E2;
    font-size: 28px;
    margin-bottom: 5px;
}

.login-header p {
    color: #666;
    font-size: 16px;
    margin-bottom: 15px;
}

.specialty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #e74c3c;
    font-weight: 600;
}

.specialty i {
    font-size: 18px;
}

.login-form h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 24px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #4A90E2;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

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

.error-message {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #fcc;
}

.test-credentials {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    text-align: left;
}

.test-credentials p {
    margin-bottom: 5px;
    font-size: 14px;
}

.test-credentials code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

.disclaimer {
    background: #2c3e50;
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-top: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

/* Main Application Styles */
.app-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e1e5e9;
}

.advisor-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.advisor-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.advisor-details h1 {
    color: #333;
    font-size: 20px;
    margin-bottom: 5px;
}

.specialty {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #e74c3c;
    font-weight: 600;
    font-size: 14px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
}

.notifications {
    position: relative;
    cursor: pointer;
}

.notifications i {
    font-size: 20px;
    color: #666;
}

.admin-menu {
    position: relative;
    cursor: pointer;
    display: inline-block;
}

.admin-menu i {
    font-size: 20px;
    color: #666;
    transition: color 0.2s ease;
}

.admin-menu:hover i {
    color: #4A90E2;
}

.admin-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
    margin-top: 5px;
    white-space: nowrap;
    display: block;
}

.admin-menu:hover .admin-dropdown,
.admin-menu:focus-within .admin-dropdown,
.admin-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Ensure dropdown is completely hidden when not active */
.admin-dropdown:not(.show):not(:hover) {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
    pointer-events: none !important;
}

.admin-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.admin-dropdown a:last-child {
    border-bottom: none;
}

.admin-dropdown a:hover {
    background-color: #f8f9fa;
    color: #4A90E2;
}

.admin-dropdown i {
    font-size: 16px;
    color: inherit;
}

/* Mobile responsiveness for admin menu */
@media (max-width: 768px) {
    .admin-dropdown {
        right: -50px;
        min-width: 180px;
    }
    
    .header-actions {
        gap: 15px;
    }
    
    .admin-menu i {
        font-size: 18px;
    }
    
    .notifications i {
        font-size: 18px;
    }
}

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

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logout-btn {
    color: #666;
    text-decoration: none;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

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

.nav-tabs {
    display: flex;
    background: #f8f9fa;
    padding: 0 20px;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn.active {
    background: #4A90E2;
    color: white;
}

.tab-btn:hover:not(.active) {
    background: #e9ecef;
}

.disclaimer-banner {
    background: #2c3e50;
    color: white;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}

/* Main Content */
.main-content {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.tab-content {
    display: none;
}

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

/* Chat Styles */
.chat-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.chat-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e1e5e9;
}

.chat-header h2 {
    color: #333;
    font-size: 20px;
}

.chat-messages {
    height: 500px;
    overflow-y: auto;
    padding: 20px;
}

.message {
    margin-bottom: 20px;
    display: flex;
}

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

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

.message-content {
    max-width: 70%;
    padding: 15px 20px;
    border-radius: 20px;
    position: relative;
}

.user-message .message-content {
    background: #4A90E2;
    color: white;
    border-bottom-right-radius: 5px;
}

.assistant-message .message-content {
    background: #f8f9fa;
    color: #333;
    border-bottom-left-radius: 5px;
}

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

.quick-action-btn {
    background: white;
    color: #4A90E2;
    border: 2px solid #4A90E2;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.quick-action-btn:hover {
    background: #4A90E2;
    color: white;
}

.chat-input {
    padding: 20px;
    border-top: 1px solid #e1e5e9;
    background: #f8f9fa;
}

.input-container {
    display: flex;
    gap: 10px;
}

#message-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

#message-input:focus {
    outline: none;
    border-color: #4A90E2;
}

#message-input:disabled {
    background: #e9ecef;
    cursor: not-allowed;
}

#send-btn {
    width: 50px;
    height: 50px;
    background: #4A90E2;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#send-btn:hover:not(:disabled) {
    background: #357ABD;
}

#send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Resources and Services Styles */
.resources-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.resources-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e1e5e9;
}

.resources-header h2 {
    color: #333;
    font-size: 20px;
}

.resources-content {
    padding: 20px;
}

.resource-category {
    margin-bottom: 30px;
}

.resource-category h3 {
    color: #333;
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #4A90E2;
    display: flex;
    align-items: center;
    gap: 10px;
}

.resource-category h3 i {
    color: #4A90E2;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.resource-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.resource-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: #4A90E2;
}

.service-item {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-left: 4px solid #28a745;
}

.service-item:hover {
    border-color: #28a745;
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
}

.resource-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    margin-bottom: 15px;
}

.service-item .resource-icon {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.resource-info h4 {
    color: #333;
    font-size: 16px;
    margin-bottom: 8px;
}

.resource-info p {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* Recommended sections styling */
.services-section h3 {
    border-bottom-color: #28a745;
}

.services-section h3 i {
    color: #28a745;
}

.recommended-resources-section h3 {
    border-bottom-color: #ffc107;
}

.recommended-resources-section h3 i {
    color: #ffc107;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e1e5e9;
    display: flex;
    padding: 10px 0;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 50;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    color: #666;
    padding: 10px;
    transition: color 0.2s ease;
}

.nav-item.active {
    color: #4A90E2;
}

.nav-item:hover {
    color: #4A90E2;
}

.nav-item i {
    font-size: 18px;
}

.nav-item span {
    font-size: 12px;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-container {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .header-content {
        flex-direction: row !important;
        gap: 10px;
        padding: 12px 15px;
        align-items: center;
    }
    
    .advisor-info {
        flex-direction: row !important;
        text-align: left;
        gap: 10px;
        flex: 1;
        align-items: center;
        min-width: 0; /* Allow flex item to shrink */
    }
    
    .advisor-avatar {
        width: 45px !important;
        height: 45px !important;
        font-size: 20px;
        flex-shrink: 0;
    }
    
    .advisor-details {
        min-width: 0; /* Allow text to truncate if needed */
        flex: 1;
    }
    
    .advisor-details h1 {
        font-size: 16px;
        margin-bottom: 3px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .specialty {
        font-size: 12px;
    }
    
    .header-actions {
        flex-shrink: 0;
        gap: 12px;
    }
    
    .nav-tabs {
        padding: 0;
    }
    
    .tab-btn {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .main-content {
        padding: 15px;
        margin-bottom: 80px;
    }
    
    .chat-container {
        margin-bottom: 80px;
    }
    
    .chat-input {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
    
    .chat-messages {
        height: 400px;
    }
    
    .resource-grid {
        grid-template-columns: 1fr;
    }
    
    .message-content {
        max-width: 85%;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 25px 15px;
    }
    
    .login-page .advisor-avatar {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    
    .login-header h1 {
        font-size: 24px;
    }
    
    .header-content {
        padding: 10px 12px;
    }
    
    .advisor-avatar {
        width: 40px !important;
        height: 40px !important;
        font-size: 18px;
    }
    
    .advisor-details h1 {
        font-size: 14px;
    }
    
    .specialty {
        font-size: 11px;
    }
    
    .header-actions {
        gap: 10px;
    }
    
    .header-actions .notifications i,
    .header-actions .admin-menu i {
        font-size: 16px;
    }
    
    .chat-container {
        margin-bottom: 80px;
    }
    
    .chat-input {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
    
    .chat-messages {
        height: 350px;
        padding: 15px;
    }
    
    .message-content {
        max-width: 90%;
        padding: 12px 16px;
    }
    
    .quick-actions {
        gap: 8px;
    }
    
    .quick-action-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* Resource Detail Page Styles */
.resource-detail-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto;
}

.resource-detail-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-btn {
    color: #4A90E2;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease;
}

.back-btn:hover {
    color: #357ABD;
}

.resource-type-badge {
    background: #4A90E2;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.resource-detail-content {
    padding: 40px;
    text-align: center;
}

.resource-detail-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 40px;
    margin: 0 auto 30px;
}

.resource-detail-info h1 {
    color: #333;
    font-size: 28px;
    margin-bottom: 20px;
}

.resource-description,
.service-description {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.external-link {
    margin-top: 30px;
}

.external-link .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: transform 0.2s ease;
}

.external-link .btn-primary:hover {
    transform: translateY(-2px);
}

/* Update navigation tabs for resource detail page */
.nav-tabs .tab-btn {
    text-decoration: none;
    color: inherit;
}

/* Mobile responsiveness for resource detail page */
@media (max-width: 768px) {
    .resource-detail-container {
        margin: 15px;
    }
    
    .resource-detail-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .resource-detail-content {
        padding: 20px;
    }
    
    .resource-detail-icon {
        width: 80px;
        height: 80px;
        font-size: 32px;
    }
    
    .resource-detail-info h1 {
        font-size: 24px;
    }
    
    .resource-description,
    .service-description {
        font-size: 14px;
    }
}
