/* Body (dashboard) */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #d9ecff;
    color: #1a202c;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Header (dashboard) */
.header {
    background: #0da1d9;
    color: white;
    padding: 3px 2px;
    box-shadow: 0 2px 10px rgba(76,81,191,0.15);
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 101;
}
.header-content { max-width: 1400px; margin: 0 auto; padding: 0 1.5rem; text-align:center; }
.header h1 { font-size: 1.375rem; font-weight: 600; margin-bottom: 0.375rem; }
.school-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 10px 0;
}
.navbar.navbar-expand{padding: 1px 0;}
.navbar-brand .d-flex {    text-align: left;    margin-left: 8px;}
.school-info span { color: #fff; font-size: 14px; }
.logout-btn { background: #ff4757; color: white; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; font-size: 12px; }
.logout-btn:hover { background: #ff3742; }
.status-indicators { display:flex; justify-content:center; gap:1rem; }
.status { padding: 0.1875rem 0.625rem; border-radius: 0.875rem; font-size: 0.6875rem; font-weight:500; background: rgba(72,187,120,0.9); }
.status.error { background: rgba(245,101,101,0.9); }

/* Main layout (dashboard) */
.main-container {
    display: grid;
    grid-template-columns: 320px 1fr 300px;
    gap: 1.25rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    min-height: 0;
}

/* Subtle surface styling for main work area */
.main-container {
    margin-top: 5rem;
    flex: 1 0 auto;
    margin-bottom: 4rem;
}

/* Give bottom spacing so boxes don't stick to footer */
.query-panel, .results-panel, .alert-panel { margin-bottom: 1rem; }

/* Footer styling */
.page-footer { background: #0f172a; color: #e5e7eb; padding: 12px 0; position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; }
.footer-content {     text-align: center;max-width: 1400px; margin: 0 auto; padding: 0 1.5rem; font-size: 0.85rem; }

/* Query panel */
.query-panel { background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%); border-radius: 14px; padding: 1.25rem; box-shadow: 0 8px 24px rgba(17,24,39,0.06); border: 1px solid #e6ecf2; display:flex; flex-direction:column; align-items:center; justify-content:center; height: 100%; min-height: 0; position: relative; overflow: hidden; }
.query-panel { transition: box-shadow 220ms ease, transform 220ms ease, border-color 220ms ease; }
.query-panel::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px; background: linear-gradient(90deg, #4c51bf, #667eea); border-top-left-radius: 14px; border-top-right-radius: 14px; }
.panel-title { display:none; }
/* Centered prompt box inside query panel */
.prompt-box { max-width: 720px; width: 100%; }

#questionInput { width:100%; min-height:120px; height:auto; max-height:50vh; padding:0.9rem 1rem; 
    border:1.5px solid #e5e7eb; border-radius:12px; font-size:0.95rem; resize: vertical; 
    font-family: inherit; margin-bottom: 1rem;     background: #f1f1f1; transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease; overflow-y:auto; line-height:1.5; }
#questionInput:focus { border-color:#4c51bf; box-shadow: 0 0 0 4px rgba(76,81,191,0.16); }
.input-hint { margin-top: 0; margin-bottom: 8px; color:#1f2937; font-size: 1rem; display:flex; align-items:center; gap:8px; justify-content: center; font-weight: 700; }
#questionInput::placeholder { color:#9ca3af; }
#questionInput:focus { outline:none; border-color:#4c51bf; box-shadow: 0 0 0 4px rgba(76,81,191,0.16); background:#fcfdff; }
/* Scrollbar styling for the textarea */
#questionInput::-webkit-scrollbar { width: 10px; }
#questionInput::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 10px; }
#questionInput::-webkit-scrollbar-thumb { background: #c7d2fe; border-radius: 10px; border: 2px solid #f1f5f9; }
#questionInput::-webkit-scrollbar-thumb:hover { background: #a5b4fc; }

.examples { margin-bottom:0.875rem; }
.examples h3 { font-size:0.8125rem; font-weight:600; margin-bottom:0.375rem; color:#4a5568; }
.example-btn { display:block; width:100%; padding:0.375rem 0.5rem; margin-bottom:0.1875rem; background:#f7fafc; border:1px solid #e2e8f0; border-radius:4px; cursor:pointer; text-align:left; font-size:0.6875rem; color:#4a5568; font-family:inherit; line-height:1.3; }
.example-btn:hover { background:#edf2f7; }

.controls { 
    display: flex;
    gap: 0.6rem;
    margin-top: auto;
    border-top: 2px dotted #c6c4c4;
    padding-top: 24px;
}
.btn { 
    padding: 6px 12px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}
.navbar.navbar-expand-lg{    padding: 1px 0;}
.btn:active { transform: translateY(0); }
.btn-primary { background: #0da1d9; color:white; flex:1; box-shadow: 0 10px 22px rgba(76,81,191,0.22); }
.btn-primary:hover:not(:disabled) { filter: brightness(0.99); box-shadow: 0 14px 28px rgba(76,81,191,0.28); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.7; cursor: not-allowed; box-shadow: none; }
.btn-secondary { background:#eef2ff; color:#1e293b; border:1px solid #d9e2ff; }
.btn-secondary:hover {     background: #3b3b3b; }

.loading { display:none; text-align:center; color:#4c51bf; font-size:0.75rem; margin-top:0.375rem; }
.spinner { width:14px; height:14px; border:2px solid #e2e8f0; border-top:2px solid #4c51bf; border-radius:50%; animation:spin 1s linear infinite; margin:0 auto 0.1875rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Results panel */
.results-panel { background: white; border-radius: 8px; padding: 1.25rem; box-shadow: 0 2px 8px rgba(0,0,0,0.05); border: 1px solid #e2e8f0; display:flex; flex-direction:column; height: 100%; min-height: 0; }
.results-content { display: flex; flex-direction: column; gap: 1rem; min-height: 0; flex: 1 1 auto; }

/* Fancy panel heading */
.panel-heading { font-weight: 700; color:#0f172a; margin: -0.25rem 0 0.5rem; padding: 0.25rem 0; border-bottom: 1px solid #eef2f7; }
.panel-heading i { color:#4c51bf; }

/* Right alert panel */
.alert-panel { background: white; border-radius: 12px; padding: 1rem; box-shadow: 0 6px 18px rgba(17,24,39,0.06); border: 1px solid #e6ecf2; display:flex; flex-direction:column; height: 100%; min-height: 0; }
.alert-panel .panel-title { margin-bottom: 0.75rem; }

/* Data results */
.data-results { flex: 2 1 auto; min-height: 140px; min-width: 0; display: flex; flex-direction: column; background:#ffffff; border:1px solid #e6ecf2; border-radius:12px; box-shadow: 0 6px 18px rgba(17,24,39,0.06); padding: 0.75rem; overflow-y: auto; max-height: calc(100vh - 220px); }
.data-results { overscroll-behavior: contain; }
/* Scrollbar styling for data-results */
.data-results::-webkit-scrollbar { width: 10px; }
.data-results::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 10px; }
.data-results::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #a5b4fc, #818cf8); border-radius: 10px; border: 2px solid #f1f5f9; }
.data-results::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #8ea2ff, #6c7df7); }
/* Firefox */
.data-results { scrollbar-color: #8ea2ff #f1f5f9; scrollbar-width: thin; }

/* Compact alert styling for AI Insights */
.alert-panel .alert { padding: 8px 10px; font-size: 0.85rem; line-height: 1.4; border-radius: 8px; margin-bottom: 0; }
.alert.alert-info { background-color: #e9f5ff; border-color: #b6e0fe; color: #0c4a6e; }
.data-results .section-header { background: linear-gradient(180deg, #f8fbff 0%, #f2f7ff 100%); border:1px solid #e6ecf2; border-radius:10px; padding:0.5rem 0.75rem; margin-bottom:0.5rem; }
.table-container { flex: 1 1 0; display: flex; flex-direction: column; min-height: 0; min-width: 0; max-width: 100%; overflow: hidden; background:#ffffff; border-radius:10px; }
.table-wrapper { overflow-x: auto; overflow-y: visible; -webkit-overflow-scrolling: touch; border: 1px solid #e9eff6; border-radius: 10px; background: white; flex: 1 1 0; width: 100%; box-shadow: 0 1px 3px rgba(0,0,0,0.06); max-width: 100%; }
.data-table { width: 100%; max-width: 100%; border-collapse: collapse; font-size: 0.75rem; table-layout: fixed; min-width: 0; }
.data-table thead { background: linear-gradient(135deg, #4c51bf 0%, #667eea 100%); color: white; position: sticky; top: 0; z-index: 1; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.data-table th { padding: 0.5rem 0.375rem; text-align: left; font-weight: 700; font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.5px; border-right: 1px solid rgba(255,255,255,0.1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-table th:last-child { border-right: none; }
.data-table td { padding: 0.5rem 0.375rem; border-bottom: 1px solid #f1f5f9; font-size: 0.6875rem; vertical-align: middle; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; word-wrap: break-word; max-width: 0; }
.data-table tbody tr:hover { background-color: #f8fafc; }
.data-table tbody tr:nth-child(even) { background-color: #fafbfc; }
.no-data { display:flex; align-items:center; justify-content:center; color:#6b7280; font-size:0.8125rem; min-height:100px; }

.section-header { font-size: 0.875rem; font-weight: 600; color: #2d3748; display: flex; justify-content: space-between; align-items: center; }
.result-count { background: #4c51bf; color: white; padding: 0.125rem 0.5rem; border-radius: 0.75rem; font-size: 0.6875rem; font-weight: 500; }

/* Summary */
.summary-section { flex: 1 1 auto; min-height: 120px; min-width: 0; display:flex; flex-direction:column; overflow: hidden; }
.summary-content { background: #f8fafc; padding: 0.625rem; border-radius: 6px; border: 1px solid #e2e8f0; font-size: 0.75rem; line-height: 1.4; overflow: auto; flex: 1 1 auto; min-height:0; word-wrap: break-word; }

/* API section */
.api-section { flex: 0.5 1 auto; min-height: 80px; min-width: 0; display:flex; flex-direction:column; overflow: hidden; }
.api-content { background: #1a202c; color: #e2e8f0; padding: 0.5rem; border-radius: 6px; font-family: monospace; font-size: 0.75rem; line-height: 1.3; white-space: pre; overflow-x: auto; overflow-y: auto; word-break: break-word; flex: 1 1 auto; min-height: 0; }

/* JSON highlighting */
.json-key { color: #79b8ff; }
.json-string { color: #a5d6ff; }
.json-number { color: #ffab70; }
.json-boolean { color: #ff7b72; }

/* Responsive */
@media (max-height: 700px) {
    .data-results { min-height: 120px; }
    .summary-section, .api-section { min-height: 90px; }
}
@media (max-width: 768px) {
    .main-container { grid-template-columns: 1fr; padding: 0.875rem; gap: 0.875rem; }
    .query-panel, .results-panel, .alert-panel { padding: 1rem; }
    #questionInput { height:60px; font-size:0.8125rem; }
    .example-btn { font-size:0.625rem; padding:0.25rem 0.375rem; }
    .data-table { font-size: 0.6875rem; }
    .data-table th, .data-table td { padding: 0.375rem 0.25rem; }
    .table-wrapper { max-height: 300px; }
}
@media (max-width: 480px) {
    .data-table th, .data-table td { padding: 0.25rem 0.125rem; font-size: 0.625rem; }
    .table-wrapper { max-height: 250px; }
}

/* Desktop: keep query and results inside grid (no fixed positioning) */
@media (min-width: 992px) {
    .query-panel { position: static; overflow: visible; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
    .panel-title { position: static; background: transparent; }
}

/* === Login page specific (index.html) === */
.login-container { background: white; border-radius: 12px; box-shadow: 0 20px 40px rgba(0,0,0,0.1); padding: 2.5rem; width: 100%; max-width: 400px; text-align: center; }
.login-header { margin-bottom: 2rem; }
.login-header h1 { color: #2d3748; font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; }
.login-header p { color: #718096; font-size: 0.875rem; }
.login-form { display: flex; flex-direction: column; gap: 1.25rem; }
.form-group { text-align: left; }
.form-group label { display: block; color: #4a5568; font-weight: 600; margin-bottom: 0.5rem; font-size: 0.875rem; }
.form-group input { width: 100%; padding: 0.75rem 1rem; border: 2px solid #e2e8f0; border-radius: 8px; font-size: 1rem; transition: border-color 0.2s; }
.form-group input:focus { outline: none; border-color: #4c51bf; box-shadow: 0 0 0 3px rgba(76, 81, 191, 0.1); }
.login-btn { background: linear-gradient(135deg, #4c51bf 0%, #667eea 100%); color: white; border: none; padding: 0.875rem 1.5rem; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; margin-top: 0.5rem; }
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 20px rgba(76, 81, 191, 0.3); }
.login-btn:active { transform: translateY(0); }

.toggle-btn:hover:not(.active) { color: #4c51bf; }
.field-help { display: block; color: #718096; font-size: 0.75rem; margin-top: 0.25rem; line-height: 1.2; }
.error-message { background: #fed7d7; color: #c53030; padding: 0.75rem 1rem; border-radius: 6px; font-size: 0.875rem; margin-top: 1rem; display: none; }
.demo-credentials { background: #f7fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 1rem; margin-top: 1.5rem; text-align: left; }
.demo-credentials h3 { color: #2d3748; font-size: 0.875rem; font-weight: 600; margin-bottom: 0.5rem; }
.demo-credentials p { color: #4a5568; font-size: 0.8125rem; margin: 0.25rem 0; }

/* --- Auth page polish (overrides) --- */
.login-container { background: #ffffff; border: 1px solid #eef2f7; border-radius: 16px; box-shadow: 0 20px 50px rgba(2,6,23,0.08); padding: 2.25rem; max-width: 780px; text-align: left; }
.login-header h1 { color:#0f172a; font-size:1.5rem; font-weight:800; margin-bottom:0.25rem; letter-spacing:-0.01em; }
.login-header p { color:#475569; font-size:0.95rem; }
.form-group label { color:#0f172a; font-weight:600; margin-bottom:0.4rem; font-size:0.9rem; }
.form-group input { background:#f8fafc; border:1.5px solid #e5e7eb; border-radius:10px; padding:0.7rem 0.9rem; font-size:0.98rem; transition:border-color .2s, box-shadow .2s; }
.form-group input:focus { border-color:#4c51bf; box-shadow:0 0 0 3px rgba(76,81,191,0.12); }

.field-help { color:#64748b; font-size:0.78rem; }
.login-btn { border-radius:10px; font-weight:700; padding:0.8rem 1.25rem; box-shadow:0 12px 26px rgba(76,81,191,0.28); }
.login-btn:hover { box-shadow:0 14px 30px rgba(76,81,191,0.30); }
.demo-credentials { background:#f8fafc; border:1px solid #e6ecf2; border-radius:10px; }
.demo-credentials h3 { color:#0f172a; font-size:0.9rem; font-weight:700; }
.demo-credentials p { color:#475569; font-size:0.85rem; }

/* Registration grid */
.auth-grid { display:grid; grid-template-columns:1fr; gap:1rem; }
@media (min-width: 768px) { .auth-grid { grid-template-columns:1fr 1fr; } }
@media (min-width: 1200px) { .auth-grid { grid-template-columns:1fr 1fr 1fr; } }

/* === Bootstrap 5 Half-Half Login/Registration Design === */
.login-page {
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow-x: hidden;
}

/* Left Side - Branding & Hero */
.auth-left {
    background: linear-gradient(135deg, rgb(0 0 0 / 80%) 0%, rgb(18 110 151 / 76%) 50%, rgb(24 138 157 / 80%) 100%), url(images/AI-background.jpg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
}

.auth-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.2;
}

/* Hero Content Styles */
.hero-content {
    color: white;
    z-index: 2;
    position: relative;
}

/* Combined Brand Container Styling */
.brand-container {
    backdrop-filter: blur(20px);
    position: relative;
}

.logo-image {
    height: 70px;
    width: auto;
    filter: brightness(1.1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s 
ease;
    background: white;
    border-radius: 5px;
    padding: 5px;
}

.brand-container h1{
    text-transform: uppercase;
    font-size: 30px;
    font-weight: 600;
}
.brand-container p{
    margin: 0;
    font-size: 16px;
    font-weight: 400;
}
/* Inline Features Styling */
.features-inline {
    flex-wrap: wrap;
    gap: 0.75rem;
}

.feature-item-inline {
    background: rgb(0 25 37);
    border-radius: 8px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.3s ease, background 0.3s ease;
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.feature-item-inline:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.feature-item-inline i {
    color: #fbbf24;
    font-size: 1rem;
}

.feature-item-inline span {
    font-size: 0.85rem;
}

.floating-card {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    animation: float 3s ease-in-out infinite;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    padding: 1rem 1.25rem;
}

.floating-card i {
    color: #fbbf24;
    font-size: 1.5rem;
}

.floating-card span {
    font-size: 1rem;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Right Side - Forms */
.auth-right {
    background: #f8fafc;
    position: relative;
}

/* Mode Toggle */
.mode-toggle {
    position: relative;
    overflow: visible;
}

.toggle-btn {
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b !important;
    transition: all 0.3s ease;
    background: #eaf4ff;
    padding: 11px 0;
    border-radius: 10px;
}

.toggle-btn.active {
    color: white !important;
    position: relative;
    background: #0da1d9;
}
.form-header h2{
    font-size: 25px;
    margin-bottom: 0;
}
.form-header p{
    margin: 0;
    color: grey;
    font-size: 15px;
}

/* Registration form header spacing */
.registration-form-card .form-header {
    margin-bottom: 0.75rem !important;
}

.registration-form-card .form-header h2 {
    font-size: 20px !important;
    margin-bottom: 0.125rem !important;
}

.registration-form-card .form-header p {
    font-size: 13px !important;
    margin-bottom: 0 !important;
}

.toggle-btn:hover:not(.active) {
    color: #1e40af;
    background: rgba(30, 64, 175, 0.05);
}

/* Form Styles */
.auth-form {
    transition: all 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    opacity: 1;
    transform: translateX(0);
}

.auth-form:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.input-wrapper {
    transition: transform 0.2s ease;
}

.input-wrapper input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.password-toggle:hover {
    color: #3b82f6;
}

.auth-btn {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #06b6d4 100%);
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.3);
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 64, 175, 0.4);
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #0891b2 100%);
}

.auth-btn i {
    transition: transform 0.3s ease;
}

.auth-btn:hover i {
    transform: translateX(2px);
}

.error-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-top: 1rem;
    display: none;
    border: 1px solid #fecaca;
}

.loading {
    display: none;
    text-align: center;
    color: #4c51bf;
    font-size: 0.9rem;
    margin-top: 1rem;
    padding: 1rem;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #4c51bf;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 0.5rem;
}

/* Compact Demo Credentials */
.demo-credentials-compact {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(147, 197, 253, 0.1) 100%);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 1rem;
    font-size: 0.85rem;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.15);
    position: relative;
    overflow: hidden;
}

.demo-credentials-compact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa, #3b82f6);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.demo-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: #1e40af;
}

.demo-header i {
    color: #3b82f6;
    font-size: 1rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.demo-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.demo-info span {
    color: #6b7280;
    font-size: 0.8rem;
}

.demo-btn-compact {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    position: relative;
    overflow: hidden;
}

.demo-btn-compact::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.demo-btn-compact:hover::before {
    left: 100%;
}

.demo-btn-compact:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* === Material Design Components === */

/* Material Form */
.material-form {
    transition: all 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    opacity: 1;
    transform: translateX(0);
}

.material-form:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Registration Form Card - Wider Layout */
.registration-form-card {
    max-width: 900px !important;
    width: 100%;
}

.registration-form-card .card-body {
    padding: 0.75rem !important;
}

.registration-form-card .row {
    margin: 0 -0.125rem;
}

.registration-form-card .col-md-6,
.registration-form-card .col-12 {
    padding: 0 0.125rem;
    margin-bottom: 0.25rem;
}

.registration-form-card .material-input-group {
    margin-bottom: 0.25rem;
}

.registration-form-card .material-help-text {
    font-size: 0.6rem;
    margin-top: 0.05rem;
    color: #6b7280;
    line-height: 1.1;
}

/* Registration form button spacing */
.registration-form-card .material-btn {
    margin-top: 0.75rem !important;
    margin-bottom: 0.25rem !important;
}

/* Responsive adjustments for registration form */
@media (max-width: 768px) {
    .registration-form-card {
        max-width: 100% !important;
        margin: 0 0.25rem;
    }
    
    .registration-form-card .card-body {
        padding: 0.5rem !important;
    }
    
    .registration-form-card .col-md-6,
    .registration-form-card .col-12 {
        margin-bottom: 0.125rem;
    }
    
    .registration-form-card .material-input-group {
        margin-bottom: 0.125rem;
    }
    
    .registration-form-card .material-help-text {
        font-size: 0.55rem;
    }
    
    .registration-form-card .material-btn {
        margin-top: 0.25rem !important;
    }
}

@media (max-width: 576px) {
    .registration-form-card .form-header {
        margin-bottom: 0.5rem !important;
    }
    
    .registration-form-card .form-header h2 {
        font-size: 16px !important;
    }
    
    .registration-form-card .form-header p {
        font-size: 11px !important;
    }
    
    .registration-form-card .card-body {
        padding: 0.25rem !important;
    }
    
    .registration-form-card .col-md-6,
    .registration-form-card .col-12 {
        margin-bottom: 0.1rem;
    }
    
    .registration-form-card .material-input-group {
        margin-bottom: 0.1rem;
    }
}

/* Hide title and subtitle in mobile view for dashboard */
@media (max-width: 991.98px) {
    .navbar-brand .d-flex.flex-column {
        display: none !important;
    }
    
    .navbar-brand {
        gap: 0 !important;
    }
}

/* Material Input Groups */
.material-input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.material-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* Material Input */
.material-input {
    width: 100%;
    padding: 0.75rem 0.75rem;
    border: none;
    border-bottom: 2px solid #e5e7eb;
    background: transparent;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.material-input:focus {
    border-bottom-color: #3b82f6;
}

/* Labels move up only on focus or when there's a value */
.material-input:focus + .material-label,
.material-input.focused + .material-label,
.material-input:-webkit-autofill + .material-label,
.material-input:-webkit-autofill:focus + .material-label,
.material-input.has-value + .material-label {
    transform: translateY(-1.5rem) scale(0.8);
    color: #3b82f6;
}

/* Handle autofill styling */
.material-input:-webkit-autofill,
.material-input:-webkit-autofill:hover,
.material-input:-webkit-autofill:focus,
.material-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px transparent inset !important;
    -webkit-text-fill-color: #1f2937 !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Material Label - Placeholder Style */
.material-label {
    position: absolute;
    left: 0.75rem;
    top: 0.75rem;
    color: #9ca3af;
    font-size: 1rem;
    font-weight: 400;
    transition: all 0.3s ease;
    pointer-events: none;
    transform-origin: left top;
    display: flex;
    align-items: center;
}

/* Material Underline */
.material-underline {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #3b82f6;
    transition: width 0.3s ease;
}

.material-input:focus ~ .material-underline {
    width: 100%;
}

/* Material Password Toggle */
.material-password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 0.3s ease;
}

.material-password-toggle:hover {
    color: #085d7d;
}

/* Material Button */
.material-btn {
    position: relative;
    background: #0da1d9;
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.material-btn .btn-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.material-btn .btn-text i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.material-btn:hover {
    background: #085d7d;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

.material-btn:hover .btn-text i {
    transform: translateX(2px);
}

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

/* Material Button Ripple Effect */
.btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Material Error Message */
.material-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-top: 1rem;
    border-left: 4px solid #dc2626;
}

/* Material Loading */
.material-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #3b82f6;
    font-size: 0.9rem;
    margin-top: 1rem;
    padding: 1rem;
}

.material-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 0.5rem;
}

/* Material Help Text */
.material-help-text {
    color: #6b7280;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    line-height: 1.3;
}

/* Registration Grid */
.auth-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .auth-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Responsive Design - Bootstrap 5 Compatible */
@media (max-width: 991.98px) {
    .auth-left {
        min-height: 35vh;
    }
    
    .hero-content {
        padding: 2rem 1rem;
    }
    
    .brand-container {
        padding: 1.25rem 1.5rem;
        max-width: 350px;
    }
    
    .logo-image {
        height: 50px;
    }
    
    .features-inline {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .feature-item-inline {
        justify-content: center;
        padding: 0.4rem 0.6rem;
    }
    
    .feature-item-inline span {
        font-size: 0.8rem;
    }
}

@media (max-width: 767.98px) {
    .auth-left {
        min-height: 30vh;
    }
    
    .hero-content {
        padding: 1.5rem 1rem;
    }
    
    .brand-container {
        padding: 1rem 1.25rem;
        max-width: 320px;
    }
    
    .logo-image {
        height: 45px;
    }
    
    .brand-container h1 {
        font-size: 1.25rem;
    }
    
    .features-inline {
        flex-direction: column;
        gap: 0.4rem;
    }
    
    .feature-item-inline {
        padding: 0.35rem 0.5rem;
    }
    
    .feature-item-inline span {
        font-size: 0.75rem;
    }
    
    .floating-card {
        padding: 0.75rem 1rem;
    }
    
    .form-container {
        padding: 1.5rem;
    }
    
    .auth-form .card-body {
        padding: 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .form-container {
        padding: 1rem;
    }
    
    .auth-form .card-body {
        padding: 1rem;
    }
    
    .toggle-btn {
        font-size: 0.85rem;
        padding: 0.75rem 0.5rem;
    }
    
    .auth-left {
        min-height: 25vh;
    }
    
    .hero-content {
        padding: 1rem 0.75rem;
    }
    
    .brand-container {
        padding: 0.75rem 1rem;
        max-width: 280px;
    }
    
    .logo-image {
        height: 40px;
    }
    
    .brand-container h1 {
        font-size: 1.1rem;
    }
    
    .feature-item-inline {
        padding: 0.3rem 0.4rem;
    }
    
    .feature-item-inline span {
        font-size: 0.7rem;
    }
    
    .floating-card {
        padding: 0.6rem 0.8rem;
    }
}

/* --- Navbar dropdown: open on hover with smooth animation --- */
.navbar .dropdown .dropdown-menu {
    display: block;               /* allow transition */
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
    margin-top: 0.5rem;
    padding: 0px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.08);
    z-index: 1050;
    margin: 0;
}
.navbar .dropdown:hover .dropdown-menu,
.navbar .dropdown:focus-within .dropdown-menu,
.navbar .dropdown.show .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.navbar .dropdown.show .dropdown-menu {
    /* On click: lift slightly closer to the toggle */
    transform: translateY(-2px);
}
.navbar .dropdown:not(:hover):not(.show) .dropdown-menu {
    pointer-events: none;          /* prevent accidental hover traps */
}

/* Dropdown items polish */
.dropdown-menu .dropdown-item {
    border-radius: 6px;
    padding: 4px 8px;
}
.dropdown-menu .dropdown-item:hover {
    background: linear-gradient(90deg, #eef2ff, #e0e7ff);
}

/* Download section styling - static and prominent */
.download-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-top: 15px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.download-buttons {
    padding: 0;
    background: transparent;
    border: none;
    margin-top: 0;
}

.download-buttons h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 15px;
}

.download-buttons .btn {
    min-width: 110px;
    font-size: 0.875rem;
    margin: 3px;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
}

.download-buttons .btn i {
    margin-right: 6px;
}

.download-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.download-buttons .btn:active {
    transform: translateY(0);
}


