/* =========================
   MBOMBE JOB PORTAL
   Modern Mobile-First Design
   ========================= */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    /* Sharp/angular UI mandate: zero radius everywhere, no exceptions. */
    --radius: 0;
    --radius-sm: 0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    padding-bottom: 80px;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =========================
   LOADING SCREEN
   ========================= */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.3s, visibility 0.3s;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-logo {
    width: 120px;
    height: 120px;
    max-width: 40vw;
    max-height: 40vw;
    object-fit: contain;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
}

.loading-text {
    color: white;
    margin-top: 20px;
    font-size: 16px;
    font-weight: 500;
}

/* =========================
   HEADER
   ========================= */

header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 16px 20px;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    width: 40px;
    height: 40px;
    max-width: 40px;
    max-height: 40px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.header-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

header h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

header .subtitle {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
}

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

.header-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

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

/* =========================
   SECTIONS
   ========================= */

.section {
    display: none;
    padding: 20px;
    max-width: 100%;
    animation: fadeIn 0.3s ease;
}

.section.active {
    display: block;
}

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

/* =========================
   CARDS
   ========================= */

.card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: box-shadow 0.2s, transform 0.2s;
}

.card:active {
    transform: scale(0.98);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 8px 0;
}

.card-subtitle {
    font-size: 14px;
    color: var(--text-light);
    margin: 0 0 12px 0;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 0;
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-light);
    color: var(--text-dark);
}

.badge-primary {
    background: var(--primary-color);
    color: white;
}

.badge-success {
    background: var(--secondary-color);
    color: white;
}

.badge-danger {
    background: var(--danger-color);
    color: white;
}

/* =========================
   FORMS
   ========================= */

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

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

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    background: var(--bg-white);
    color: var(--text-dark);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* =========================
   BUTTONS
   ========================= */

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border-color);
}

.btn-success {
    background: var(--secondary-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-icon {
    padding: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

/* =========================
   NAVIGATION
   ========================= */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    display: flex;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 100;
}

.nav-item {
    flex: 1;
    padding: 12px 8px;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
    font-family: inherit;
    font-weight: 500;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item:active {
    background: var(--bg-light);
}

.nav-icon {
    font-size: 20px;
}

/* =========================
   JOB LISTING
   ========================= */

.doc-link-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.doc-link-row .form-input {
    flex: 1;
}

.rich-editor {
    background: var(--bg-white);
}

.rich-editor .ql-toolbar,
.rich-editor .ql-container {
    border-color: var(--border-color);
    border-radius: 0;
    font-family: inherit;
}

.rich-editor .ql-container {
    min-height: 140px;
    font-size: 15px;
}

.job-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.job-filters select {
    flex: 1;
    min-width: 120px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 0;
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-white);
    color: var(--text-dark);
}

.job-filters select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.job-card {
    cursor: pointer;
}

.job-card:hover {
    box-shadow: var(--shadow-md);
}

.job-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-light);
}

.job-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* =========================
   PROFILE
   ========================= */

.profile-header {
    text-align: center;
    padding: 20px 0;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 0;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 600;
    margin: 0 auto 12px;
}

/* =========================
   ADMIN
   ========================= */

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 16px;
    border-radius: var(--radius);
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

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

/* =========================
   APPLICATIONS
   ========================= */

.application-card {
    border-left: 4px solid var(--primary-color);
}

.application-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

/* =========================
   LOADING & ALERTS
   ========================= */

.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.spinner {
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 0;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #3b82f6;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* =========================
   MODAL
   ========================= */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================
   ADVERTISEMENTS
   ========================= */

.ad-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
    transition: box-shadow 0.2s, transform 0.2s;
    cursor: pointer;
    display: block;
    text-decoration: none;
    color: inherit;
}

.ad-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.ad-card:active {
    transform: translateY(0);
}

.ad-image {
    width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: cover;
    display: block;
}

.ad-content {
    padding: 16px;
}

.ad-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.ad-text {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.5;
}

/* =========================
   UTILITIES
   ========================= */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.hidden {
    display: none !important;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 480px) {
    .header-logo {
        width: 32px;
        height: 32px;
        max-width: 32px;
        max-height: 32px;
    }
    
    header h1 {
        font-size: 18px;
    }
    
    .loading-logo {
        width: 100px;
        height: 100px;
    }
}

@media (min-width: 768px) {
    .section {
        max-width: 700px;
        margin: 0 auto;
    }
    
    .header-logo {
        width: 48px;
        height: 48px;
        max-width: 48px;
        max-height: 48px;
    }
}

