/* ESEC Verification Portal - Final Version - Developed by Recilens Corporation */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-blue: #0A4D68;
    --secondary-blue: #088395;
    --accent-orange: #F57C00;
    --background-gray: #F8F9FA;
    --component-white: #FFFFFF;
    --success-green: #28a745;
    --error-red: #dc3545;
    --text-dark: #212529;
    --text-light: #6c757d;
    --border-color: #dee2e6;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Poppins', sans-serif; background-color: var(--background-gray); color: var(--text-dark); line-height: 1.6; display: flex; flex-direction: column; min-height: 100vh; }
.page-wrapper { flex: 1; }
.container { width: 90%; max-width: 1200px; margin: 30px auto; padding: 0 20px; }

/* --- HEADER & NAVIGATION --- */
.main-header { background: var(--component-white); padding: 0 40px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); display: flex; justify-content: space-between; align-items: center; height: 70px; position: sticky; top: 0; z-index: 1000; }
.logo { font-size: 24px; font-weight: 700; color: var(--primary-blue); text-decoration: none; }
.logo span { color: var(--accent-orange); }
.main-nav ul { list-style: none; display: flex; gap: 25px; margin:0; padding:0; }
.main-nav a { text-decoration: none; color: var(--text-dark); font-weight: 500; padding: 10px 5px; position: relative; transition: color 0.3s ease; cursor: pointer; }
.main-nav a::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 3px; background-color: var(--accent-orange); transition: width 0.3s ease; }
.main-nav a:hover, .main-nav a.active { color: var(--primary-blue); }
.main-nav a:hover::after, .main-nav a.active::after { width: 100%; }
.nav-buttons { display: flex; align-items: center; gap: 25px; }

/* --- NOTIFICATIONS --- */
.notification-bell { position: relative; cursor: pointer; color: #333; }
.notification-dot { position: absolute; top: -5px; right: -8px; width: 12px; height: 12px; background-color: var(--error-red); border-radius: 50%; border: 2px solid var(--component-white); }
.read { display: none !important; }
.notifications-dropdown { visibility: hidden; position: absolute; top: 65px; right: 20px; width: 350px; background: var(--component-white); border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.15); z-index: 1001; overflow: hidden; transform-origin: top right; }
.notification-list { max-height: 300px; overflow-y: auto; }
.notification-item { padding: 15px; border-bottom: 1px solid var(--border-color); font-size: 14px; }
.notification-item:last-child { border-bottom: none; }
.notification-item small { color: var(--text-light); display: block; margin-top: 5px; font-size: 12px; }

/* --- REAL-TIME CHAT (Used on Track & Admin pages) --- */
.chat-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 15px; border-bottom: 1px solid var(--border-color); background: var(--primary-blue); color: white; border-radius: 10px 10px 0 0;}
.chat-header h4 { margin: 0; font-size: 16px; }
#notification-close-btn { background: none; border: none; font-size: 24px; color: white; cursor: pointer; line-height: 1; }
.chat-messages { flex: 1; padding: 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.chat-message { max-width: 85%; padding: 8px 12px; border-radius: 15px; line-height: 1.4; position: relative; }
.chat-message { max-width: 85%; padding: 8px 12px; border-radius: 15px; line-height: 1.4; position: relative; }
.chat-message small { display: block; font-size: 10px; opacity: 0.7; margin-top: 4px; }
.user-message { background-color: var(--primary-blue); color: white; align-self: flex-end; }
.admin-message { background-color: #e0e0e0; color: var(--text-dark); align-self: flex-start; }
.no-messages { color: var(--text-light); text-align: center; margin: auto; }
.chat-input-area { display: flex; padding: 10px; border-top: 1px solid var(--border-color); background-color: #f8f9fa;}
#chat-message-input { flex: 1; border: 1px solid var(--border-color); border-radius: 20px; padding: 10px 15px; outline: none; transition: border-color 0.2s; }
#chat-message-input:focus { border-color: var(--accent-orange); }
#send-chat-message-btn { background: var(--accent-orange); color: white; border: none; border-radius: 5px; width: auto; padding: 0 20px; margin-left: 10px; cursor: pointer; font-size: 14px; transition: background-color 0.2s; font-weight: 500; }
#send-chat-message-btn:hover { background-color: #e67e22; }


/* --- FORMS & AUTH PAGES --- */
.auth-container { display: flex; justify-content: center; align-items: center; min-height: calc(100vh - 70px); padding: 20px; }
.auth-box { background: var(--component-white); padding: 40px; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); width: 100%; max-width: 450px; overflow: hidden; }
.auth-box h2 { color: var(--primary-blue); text-align: center; margin-bottom: 25px; }
.form-group { margin-bottom: 20px; position: relative; }
.form-group label { display: block; font-weight: 500; margin-bottom: 8px; color: var(--text-dark); font-size: 15px; }
.form-control { width: 100%; padding: 12px 15px; border: 1px solid var(--border-color); border-radius: 5px; font-size: 16px; transition: border-color 0.3s ease; }
.form-control:focus { outline: none; border-color: var(--accent-orange); box-shadow: 0 0 0 2px rgba(245, 124, 0, 0.2); }
.password-wrapper { position: relative; }
.password-toggle { position: absolute; top: 50%; right: 15px; transform: translateY(-50%); cursor: pointer; color: var(--text-light); }
#password-strength { margin-top: 10px; font-size: 13px; }
.validation-rule { transition: color 0.3s ease; color: var(--text-light); }
.validation-rule.valid { color: var(--success-green); }
.validation-rule.invalid { color: var(--error-red); }
.validation-rule::before { content: '● '; margin-right: 5px; }
.auth-toggle-link { text-align: center; margin-top: 20px; }
.auth-toggle-link a { color: var(--primary-blue); font-weight: 500; text-decoration: none; }
.form-group .error-text { color: var(--error-red); font-size: 14px; padding-top: 5px; min-height: 1.2em; }
.btn { display: inline-block; width: 100%; padding: 12px; border: none; border-radius: 5px; font-size: 16px; font-weight: 600; cursor: pointer; text-align: center; transition: all 0.3s ease; }
.btn-primary { background-color: var(--accent-orange); color: var(--component-white); }
.btn-primary:hover { background-color: #e67e22; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(245, 124, 0, 0.3); }
.btn:disabled { background-color: #ccc; cursor: not-allowed; box-shadow: none; transform: none; }
.request-form-container { background: var(--component-white); padding: 30px 40px; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.file-upload-wrapper {
    border: 2px dashed #ccc;
    padding: 20px;
    text-align: center;
    cursor: pointer;
}
.file-upload-wrapper.dragover {
    border-color: #0A4D68;
    background: #e6f3f7;
}
.file-upload-wrapper:hover { border-color: var(--accent-orange); }
.file-upload-wrapper input[type="file"] { display: none; }
#file-name-display { margin-top: 10px; font-style: italic; color: var(--text-light); }
.price-display { font-size: 20px; font-weight: 600; color: var(--primary-blue); background: #e3f2fd; padding: 15px; border-radius: 5px; text-align: center; margin-bottom: 20px; }
.price-display strong { color: var(--accent-orange); }

/* --- DASHBOARD & REQUEST CARDS --- */
.dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; flex-wrap: wrap; gap: 15px; }
.btn-new-request { background: var(--accent-orange); color: white; padding: 10px 20px; border-radius: 5px; text-decoration: none; font-weight: 500; transition: all 0.2s ease-in-out; }
.btn-new-request:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(245, 124, 0, 0.3); }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card { background-color: var(--component-white); padding: 25px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.07); }
.stat-card .value { font-size: 36px; font-weight: 700; color: var(--primary-blue); }
.stat-card .label { font-size: 16px; color: var(--text-light); font-weight: 500; }
.requests-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 25px; }
.no-requests-card { background: white; border-radius: 8px; text-align: center; padding: 40px; box-shadow: 0 2px 10px rgba(0,0,0,0.07); grid-column: 1 / -1; }
.request-card { background: var(--component-white); border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.07); overflow: hidden; display: flex; flex-direction: column; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.request-card:hover { transform: translateY(-5px); box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.card-content { padding: 20px; flex-grow: 1; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px; }
.card-header h3 { font-size: 18px; color: var(--primary-blue); }
.status-badge { padding: 4px 10px; border-radius: 15px; font-size: 12px; font-weight: 600; color: white; white-space: nowrap; }
.status-pending-payment { background-color: #ffc107; color: var(--text-dark); }
.status-awaiting-verification { background-color: #17a2b8; }
.status-in-progress { background-color: #007bff; }
.status-completed { background-color: var(--success-green); }
.status-rejected { background-color: var(--error-red); }
.card-body p { margin-bottom: 5px; font-size: 14px; color: var(--text-light); }
.card-body p strong { color: var(--text-dark); }
.card-footer { background: #f8f9fa; padding: 15px; border-top: 1px solid var(--border-color); }
.action-buttons { display: flex; gap: 10px; }
.btn-repay, .btn-edit, .btn-delete, .btn-track { flex: 1; padding: 10px; border-radius: 5px; font-weight: 600; cursor: pointer; transition: all 0.2s; border: none; font-size: 14px; text-decoration: none; text-align: center; color: white; }
.btn-track { background: var(--primary-blue); }
.btn-repay { background: var(--accent-orange); }
.btn-edit { background: var(--secondary-blue); }
.btn-delete { background: var(--text-light); }
.download-link { display: inline-block; margin-top: 10px; background-color: var(--success-green); color: white; text-align: center; padding: 10px 15px; border-radius: 5px; text-decoration: none; font-weight: 500; }

/* --- TRACKING PAGE --- */
.track-header { padding: 20px; background: white; border-radius: 8px; margin-bottom: 30px; box-shadow: 0 2px 10px rgba(0,0,0,0.07); }
.timeline { display: flex; justify-content: space-between; margin: 50px 0; }
.timeline-item { flex: 1; text-align: center; position: relative; }
.timeline-item::before { content: ''; position: absolute; top: 12px; left: -50%; width: 100%; height: 4px; background: var(--border-color); z-index: -1; }
.timeline-item:first-child::before { content: none; }
.timeline-dot { width: 28px; height: 28px; background: var(--component-white); border: 4px solid var(--border-color); border-radius: 50%; margin: 0 auto 10px auto; transition: all 0.3s ease; }
.timeline-content h4 { font-weight: 500; color: var(--text-light); transition: color 0.3s ease; }
.timeline-item.completed .timeline-dot { border-color: var(--success-green); background: var(--success-green); }
.timeline-item.completed::before { background: var(--success-green); }
.timeline-item.completed .timeline-content h4 { color: var(--text-dark); }
.status-box { padding: 20px; border-radius: 8px; margin: 30px 0; border-left: 5px solid; display: flex; flex-direction: column; gap: 10px; }
.status-box h4 { display: flex; align-items: center; gap: 10px; }
.status-box.rejected { background: #ffebee; border-color: var(--error-red); }
.status-box.completed { background: #e8f5e9; border-color: var(--success-green); }
.chat-container { background: var(--component-white); border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.07); overflow: hidden; margin-top: 30px; }
#chat-notification-dot { display: none; }

/* --- FAQ PAGE --- */
.faq-container { max-width: 800px; margin: 40px auto; padding: 40px; background: var(--component-white); border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.faq-item { margin-bottom: 25px; border-bottom: 1px solid var(--border-color); padding-bottom: 25px; }
.faq-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.faq-question { font-size: 18px; font-weight: 600; color: var(--primary-blue); margin-bottom: 10px; }
.faq-answer { color: var(--text-dark); line-height: 1.7; }

/* --- ADMIN PANEL --- */
.admin-table-container { background: white; border-radius: 8px; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.07); overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 800px; }
.admin-table th, .admin-table td { padding: 12px 15px; border-bottom: 1px solid var(--border-color); text-align: left; }
.admin-table th { background-color: #f8f9fa; font-weight: 600; }
.admin-table tr:hover { background-color: #f1f1f1; }
.admin-view-container { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 30px; }
.panel { background: white; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.07); display: flex; flex-direction: column; }
.panel-header { padding: 15px 20px; border-bottom: 1px solid var(--border-color); }
.panel-header h3 { margin:0; font-size: 18px; color: var(--primary-blue); }
.panel-body { padding: 20px; flex-grow: 1; }
.details-table { width: 100%; }
.details-table td { padding: 10px; border-bottom: 1px solid var(--border-color); }
.details-table tr:last-child td { border-bottom: none; }
.details-table td:first-child { font-weight: 600; color: var(--text-light); width: 40%; }
.action-panel .form-group { margin-bottom: 15px; }
.action-panel .btn { width: 100%; margin-top: 5px; }
.action-choice-group { display: flex; gap: 20px; margin-bottom: 15px; }
.action-choice-group label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.panel embed { width: 100%; height: 100%; border: none; min-height: 80vh; }

/* --- FOOTER --- */
footer { background: var(--primary-blue); color: var(--component-white); text-align: center; padding: 20px; margin-top: auto; }

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 992px) { .main-nav { display: none; } .main-header { padding: 0 20px; } }
@media (max-width: 768px) {
    .stat-cards { grid-template-columns: repeat(2, 1fr); }
    .requests-grid, .admin-view-container { grid-template-columns: 1fr; }
    .timeline { flex-direction: column; gap: 10px; align-items: flex-start; }
    .timeline-item::before { left: 12px; top: 0; width: 4px; height: 120%; }
    .timeline-item { text-align: left; padding-left: 50px; min-height: 60px; }
    .timeline-dot { position: absolute; left: 0; }
}
@media (max-width: 480px) {
    .stat-cards { grid-template-columns: 1fr; }
    .nav-buttons { gap: 15px; }
    .notifications-dropdown { width: calc(100vw - 40px); }
    .dashboard-controls { flex-direction: column; }
    .action-buttons { flex-direction: column; }
    .auth-box { padding: 25px; }
}