﻿/* Modern UI overrides for MAGDEL JOBS (non-breaking, CSS-only) */

/* Root tokens */
:root {
    --md-color-primary: #0d6efd;
    --md-color-primary-dark: #0a58ca;
    --md-color-bg: #f7f8fb;
    --md-color-surface: #ffffff;
    --md-color-text: #1b2032;
    --md-color-text-muted: #5b6178;
    --md-color-border: #e6e8f0;
    --md-radius-sm: 6px;
    --md-radius-md: 10px;
    --md-radius-lg: 16px;
    --md-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --md-shadow-md: 0 4px 16px rgba(16, 24, 40, 0.08);
    --md-shadow-lg: 0 10px 30px rgba(16, 24, 40, 0.12);
}

/* Base typography and layout */
html, body {
    color: var(--md-color-text);
    background: var(--md-color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--md-color-text);
    letter-spacing: -0.02em;
}

/* Accessible skip link */
.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

    .skip-link:focus {
        left: 16px;
        top: 16px;
        width: auto;
        height: auto;
        padding: 10px 14px;
        border-radius: var(--md-radius-sm);
        background: var(--md-color-primary);
        color: #fff;
        box-shadow: var(--md-shadow-md);
        z-index: 2000;
    }

/* Header */
.main-header {
    background: var(--md-color-surface);
    box-shadow: 0 1px 0 var(--md-color-border);
}

    .main-header .main-box {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .main-header .logo img {
        height: 35px;
        object-fit: contain;
    }

/* Navigation */
.main-menu .navigation {
    display: flex;
    align-items: center;
    gap: 20px;
}

    .main-menu .navigation > li > a {
        color: var(--md-color-text);
        font-weight: 600;
        padding: 10px 8px;
        border-radius: var(--md-radius-sm);
        transition: color .2s ease, background-color .2s ease;
    }

        .main-menu .navigation > li > a:hover,
        .main-menu .navigation > li > a:focus {
            color: var(--md-color-primary);
            background: rgba(13, 110, 253, 0.08);
            outline: none;
        }

/* Dropdown (account) */
.dashboard-option .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 2px;
}

.dashboard-option .thumb {
    border-radius: 50%;
    border: 2px solid var(--md-color-border);
}

.dashboard-option .name {
    font-weight: 600;
    color: var(--md-color-text);
}

.dashboard-option .dropdown-menu {
    border: 1px solid var(--md-color-border);
    border-radius: var(--md-radius-md);
    box-shadow: var(--md-shadow-lg);
    padding: 8px;
}

    .dashboard-option .dropdown-menu li a {
        border-radius: var(--md-radius-sm);
        padding: 10px 12px;
    }

        .dashboard-option .dropdown-menu li a:hover {
            background: rgba(13,110,253,0.08);
        }

/* Buttons */
/*.theme-btn,
.btn,
button,
input[type=button],
input[type=submit] {
	border-radius: var(--md-radius-sm);
	font-weight: 600;
	transition: transform .04s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
}
.btn-style-one,
.btn-primary,
.theme-btn.btn-style-one {
	background: var(--md-color-primary) !important;
	border-color: var(--md-color-primary) !important;
	color: #fff !important;
	box-shadow: 0 1px 2px rgba(13,110,253,.2);
}
.btn-style-one:hover,
.btn-primary:hover,
.theme-btn.btn-style-one:hover { background: var(--md-color-primary-dark) !important; }

.btn-style-three,
.btn-outline-primary,
.theme-btn.btn-style-three {
	background: transparent !important;
	border: 1px solid var(--md-color-primary) !important;
	color: var(--md-color-primary) !important;
}
.btn-style-three:hover,
.btn-outline-primary:hover,
.theme-btn.btn-style-three:hover { background: rgba(13,110,253,0.08) !important; }

button:active, .btn:active, .theme-btn:active { transform: translateY(1px); }*/

/* Forms */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="search"],
select,
textarea {
    background: #fff;
    border: 1px solid var(--md-color-border);
    border-radius: var(--md-radius-sm);
    box-shadow: var(--md-shadow-sm);
    padding: 12px 14px;
    color: var(--md-color-text);
    transition: border-color .2s ease, box-shadow .2s ease;
}

    input:focus, select:focus, textarea:focus {
        border-color: var(--md-color-primary);
        box-shadow: 0 0 0 4px rgba(13,110,253,0.12);
        outline: none;
    }

label {
    font-weight: 600;
    color: var(--md-color-text);
}

.form-text, .help-text {
    color: var(--md-color-text-muted);
}

/* Cards, widgets */
.ls-widget, .card, .widget, .job-block .inner-box, .job-detail, .sidebar .widget, .dashboard .dashboard-outer .ls-widget {
    background: var(--md-color-surface);
    border: 1px solid var(--md-color-border);
    border-radius: var(--md-radius-md);
    box-shadow: var(--md-shadow-md);
}

    .ls-widget .widget-title {
        border-bottom: 1px solid var(--md-color-border);
    }

/* Footer */
.main-footer {
    background: #0f172a;
    color: #cbd5e1;
}

    .main-footer .widget-title, .main-footer h4, .main-footer h5 {
        color: #ffffff;
    }

    .main-footer a {
        color: #cbd5e1;
    }

        .main-footer a:hover {
            color: #ffffff;
        }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
}

/* Page wrapper spacing */
.page-wrapper {
    background: var(--md-color-bg);
}

.dashboard .dashboard-outer {
    padding-bottom: 40px;
}

/* Tables */
table {
    border-collapse: separate;
    border-spacing: 0;
}

    table thead th {
        background: #f3f5fa;
        color: var(--md-color-text);
        font-weight: 700;
    }

    table th, table td {
        border-bottom: 1px solid var(--md-color-border);
    }

/* Badges */
.badge.bg-danger {
    background-color: #dc3545 !important;
}

/* Alerts / Snackbar harmony */
.swal2-popup {
    border-radius: var(--md-radius-md) !important;
}

.swal2-confirm {
    border-radius: var(--md-radius-sm) !important;
}

/* Accessibility focus outlines */
a:focus-visible, button:focus-visible, [role="button"]:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--md-color-primary);
    outline-offset: 2px;
}

/* Utility spacing */
.section {
    padding: 48px 0;
}

.space-y-2 > * + * {
    margin-top: 8px;
}

.space-y-3 > * + * {
    margin-top: 12px;
}

.space-y-4 > * + * {
    margin-top: 16px;
}

.space-y-6 > * + * {
    margin-top: 24px;
}

/* Responsive adjustments */
@media (max-width: 1199px) {
    .main-header .main-box {
        padding: 0 16px;
    }
}

@media (max-width: 767px) {
    .main-menu .navigation {
        gap: 12px;
    }

    .dashboard-option .name {
        display: none;
    }
}

/* Chat UI (Candidate chat-with-employer) */
.chat-container.chat-ui {
    padding: 0;
    background: var(--md-color-surface);
    border: 1px solid var(--md-color-border);
    border-radius: var(--md-radius-lg);
    box-shadow: var(--md-shadow-lg);
}

.chat-sidebar-header {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 5;
}

.chat-input {
    position: sticky;
    bottom: 0;
    background: #fff;
    z-index: 5;
}

.chat-container .border-bottom {
    border-color: var(--md-color-border) !important;
}

.chat-container .border-end {
    border-color: var(--md-color-border) !important;
}

/* Sidebar */
/*#messageListContainer {
    background: #fff;
    height: calc(100vh - 220px);
    min-height: 400px;
    overflow-y: auto;
}

    #messageListContainer.list-group .list-group-item {
        border: 0;
        border-bottom: 1px solid var(--md-color-border);
    }*/
/*
.message-list-item {
    border-left: none !important;
    border-right: none !important;
    transition: background-color .2s ease, border-color .2s ease;
}

    .message-list-item:hover {
        background-color: #f7f9fc;
    }

    .message-list-item.active {
        background-color: #eef5ff;
        border-left: 3px solid var(--md-color-primary) !important;
    }

.unread-message {
    background-color: #f9fbff;
    font-weight: 600;
}*/

 
/* Chat header */
#chatHeader {
    background: #fff;
}

    #chatHeader #employerAvatar {
        border: 2px solid var(--md-color-border);
        box-shadow: var(--md-shadow-sm);
    }

/* Messages area */
#chatMessagesContainer {
    background: #f8fafc !important;
    height: calc(100vh - 200px) !important;
    min-height: 400px;
    overflow-y: auto;
}

    #chatMessagesContainer .bg-primary {
        background: var(--md-color-primary) !important;
    }

    #chatMessagesContainer .bg-light {
        background: #ffffff !important;
        border: 1px solid var(--md-color-border);
    }

    #chatMessagesContainer .rounded-3 {
        border-radius: 16px !important;
    }

/* Input area */
.chat-container .input-group .form-control {
    border-color: var(--md-color-border);
    border-radius: 10px 0 0 10px;
    box-shadow: var(--md-shadow-sm);
}

.chat-container .input-group .btn {
    border-radius: 0 10px 10px 0;
}

/* Scrollbars */
#messageListContainer::-webkit-scrollbar,
#chatMessagesContainer::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#messageListContainer::-webkit-scrollbar-thumb,
#chatMessagesContainer::-webkit-scrollbar-thumb {
    background: #c1c7d0;
    border-radius: 8px;
}

    #messageListContainer::-webkit-scrollbar-thumb:hover,
    #chatMessagesContainer::-webkit-scrollbar-thumb:hover {
        background: #9aa5b1;
    }

/* Utilities */
.chat-title {
    font-weight: 700;
    letter-spacing: -0.01em;
}

.chat-muted {
    color: var(--md-color-text-muted);
}

/* ======================= */
/* Global animations/util  */
/* ======================= */
@keyframes md-fade-in {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes md-slide-up {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes md-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(13,110,253,0.4);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(13,110,253,0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(13,110,253,0);
    }
}

@keyframes md-shimmer {
    0% {
        background-position: -450px 0;
    }

    100% {
        background-position: 450px 0;
    }
}

.animate-fade-in {
    animation: md-fade-in .5s ease both;
}

.animate-slide-up {
    animation: md-slide-up .5s ease both;
}

.animate-delay-1 {
    animation-delay: .1s;
}

.animate-delay-2 {
    animation-delay: .2s;
}

.animate-delay-3 {
    animation-delay: .3s;
}

/* Buttons subtle pulse on hover */
.theme-btn:hover, .btn:hover {
    transition: transform .12s ease;
    transform: translateY(-1px);
}

.btn-primary:focus-visible {
    animation: md-pulse 1.2s ease-out;
}

/* Skeletons */
.skeleton {
    position: relative;
    overflow: hidden;
    background: #eef1f6;
    border-radius: var(--md-radius-sm);
}

    .skeleton::after {
        content: "";
        position: absolute;
        inset: 0;
        background-image: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.6) 50%, rgba(255,255,255,0) 100%);
        background-size: 450px 100%;
        animation: md-shimmer 1.3s infinite;
        opacity: .6;
    }

.skeleton-text {
    height: 12px;
    margin: 8px 0;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* Loading overlay utility */
.loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.loading-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(1px);
}

.loading-overlay .spinner-border {
    position: relative;
    width: 2.8rem;
    height: 2.8rem;
    border-width: .25rem;
}

/* Make common containers relative for overlays */
.dashboard-outer, .ls-widget, .chat-container, #joblists, .sidebar, .widget-content {
    position: relative;
}
