/* ============================================================
   WeLance – Main Stylesheet
   ============================================================ */

/* === Variables === */
:root {
    --primary:        #1d4ed8;
    --primary-dark:   #1e3a8a;
    --primary-light:  #eff6ff;
    --accent:         #059669;
    --accent-dark:    #047857;
    --accent-light:   #ecfdf5;
    --danger:         #dc2626;
    --warning:        #d97706;
    --text:           #0f172a;
    --text-muted:     #64748b;
    --border:         #e2e8f0;
    --bg:             #f8fafc;
    --card-bg:        #ffffff;
    --radius:         12px;
    --radius-sm:      8px;
    --shadow-sm:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow:         0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
    --shadow-lg:      0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
    --transition:     all .2s ease;
}

/* === Base === */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
}

a { text-decoration: none; color: var(--primary); }
a:hover { color: var(--primary-dark); }

h1, h2, h3, h4, h5, h6 { font-weight: 700; color: var(--text); }

img { max-width: 100%; }

/* === Scrollbar === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================================
   Navigation
   ============================================================ */
#mainNav {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    padding: 12px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    z-index: 1030;
    border-bottom: 1px solid rgba(255,255,255,.2);
    /* background-color: #0f1329; */
}

#mainNav .navbar-brand {
    font-size: 1.4rem;
    letter-spacing: -.3px;
}

#mainNav .nav-link {
    color: rgba(255,255,255,.85) !important;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

#mainNav .nav-link:hover {
    color: #fff !important;
    background: rgba(255,255,255,.15);
}

.nav-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.5);
    object-fit: cover;
}

.badge-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* === Buttons === */
.btn-primary  { background: var(--primary); border-color: var(--primary); font-weight: 600; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
    transition: var(--transition);
}
.btn-accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }

.btn-outline-primary { color: var(--primary); border-color: var(--primary); font-weight: 500; }
.btn-outline-primary:hover { background: var(--primary); }

/* ============================================================
   Hero Section
   ============================================================ */
.hero-section {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #2563eb 50%, #0d9488 100%);
    padding: 90px 0 70px;
    color: #fff;
    position: relative;
    overflow: hidden;
    /* background: #0f1329; */
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    /* background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); */
    
    pointer-events: none;
}

.hero-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 30%, rgba(255,255,255,.15), transparent 80%);
    pointer-events: none;
    mix-blend-mode: overlay;
}

.hero-section h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.15;
    color: #fff;
}

.hero-section p.lead {
    font-size: 1.15rem;
    opacity: .9;
    max-width: 560px;
}

.hero-search-box {
    background: rgba(255,255,255,.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: var(--radius);
    padding: 8px;
}

.hero-search-box .form-control {
    background: #fff;
    border: none;
    border-radius: calc(var(--radius) - 4px);
    font-size: 1rem;
    padding: 12px 16px;
}

.hero-search-box .btn-accent {
    padding: 12px 24px;
    border-radius: calc(var(--radius) - 4px);
    font-size: 1rem;
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-top: 32px;
}

.hero-stat { color: rgba(255,255,255,.9); }
.hero-stat strong { font-size: 1.6rem; font-weight: 800; display: block; color: #fff; }
.hero-stat span { font-size: .875rem; opacity: .8; }

/* ============================================================
   Cards
   ============================================================ */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    background: var(--card-bg);
}

.card:hover { box-shadow: var(--shadow); transform: translateY(-0px); }

.card-hover-lift:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

/* === Job Card === */
.job-card {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--card-bg);
    padding: 20px;
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.job-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(29,78,216,.08), var(--shadow);
    transform: translateY(-2px);
}

.job-card .company-logo {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    border: 1px solid var(--border);
    object-fit: cover;
    background: var(--primary-light);
}

.job-card .job-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.job-card .job-title:hover { color: var(--primary); }

.job-card .company-name { font-size: .875rem; color: var(--text-muted); }
.job-card .job-meta { font-size: .8125rem; color: var(--text-muted); }
.job-card .budget { font-size: .9375rem; font-weight: 700; color: var(--accent); }

/* === Freelancer Card === */
.freelancer-card {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--card-bg);
    padding: 24px;
    text-align: center;
    transition: var(--transition);
}

.freelancer-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.freelancer-card .fl-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-light);
    margin-bottom: 12px;
}

.freelancer-card .fl-name { font-size: 1rem; font-weight: 700; }
.freelancer-card .fl-title { font-size: .8125rem; color: var(--text-muted); margin-bottom: 8px; }
.freelancer-card .fl-rate { font-size: 1.1rem; font-weight: 700; color: var(--primary); }

/* ============================================================
   Badges & Tags
   ============================================================ */
.skill-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    font-size: .75rem;
    font-weight: 600;
    padding: 3px 10px;
    margin: 2px;
    white-space: nowrap;
}

.status-badge, .type-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 6px;
    font-size: .75rem;
    font-weight: 700;
    padding: 3px 10px;
    letter-spacing: .3px;
    text-transform: uppercase;
}

.badge-open     { background: #dcfce7; color: #166534; }
.badge-closed   { background: #fee2e2; color: #991b1b; }
.badge-progress { background: #fef9c3; color: #92400e; }
.badge-pending  { background: #e0e7ff; color: #3730a3; }
.badge-reviewed { background: #fef3c7; color: #92400e; }
.badge-accepted { background: #dcfce7; color: #166534; }
.badge-rejected { background: #fee2e2; color: #991b1b; }

.badge-remote  { background: #dbeafe; color: #1e40af; }
.badge-onsite  { background: #f3e8ff; color: #6b21a8; }
.badge-hybrid  { background: #fef9c3; color: #854d0e; }

/* ============================================================
   Forms
   ============================================================ */
.form-control, .form-select {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: .9375rem;
    transition: var(--transition);
    background: var(--card-bg);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(29,78,216,.1);
    background: #fff;
}

.form-label { font-weight: 600; font-size: .875rem; color: #374151; margin-bottom: 6px; }

.input-group .form-control:focus { z-index: 3; }

/* Auth forms */
.auth-card {
    max-width: 500px;
    margin: 0 auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    background: var(--card-bg);
    border: 1px solid var(--border);
}

@media (max-width: 576px) {
    .auth-card { padding: 28px 20px; }
}

/* Type selector cards */
.type-card {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.type-card:hover, .type-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.type-card.selected .type-icon { color: var(--primary); }
.type-icon { font-size: 2rem; margin-bottom: 8px; color: var(--text-muted); }

/* ============================================================
   Sidebar Filters
   ============================================================ */
.filter-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    position: sticky;
    top: 80px;
}

.filter-card .form-check-label { font-size: .875rem; cursor: pointer; }
.filter-card .form-check-input { cursor: pointer; }

/* ============================================================
   Dashboard
   ============================================================ */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow); }

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-icon.blue   { background: var(--primary-light); color: var(--primary); }
.stat-icon.green  { background: var(--accent-light);  color: var(--accent); }
.stat-icon.purple { background: #f3e8ff; color: #7c3aed; }
.stat-icon.orange { background: #fff7ed; color: #c2410c; }

.stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: .8125rem; color: var(--text-muted); margin-top: 4px; }

/* ============================================================
   Profile Page
   ============================================================ */
.profile-cover {
    background: linear-gradient(135deg, var(--primary-dark), #2563eb);
    height: 160px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.profile-avatar-wrap {
    margin-top: -48px;
    position: relative;
    display: inline-block;
}

.profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 4px solid #fff;
    object-fit: cover;
    box-shadow: var(--shadow);
}

.avatar-upload-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    opacity: 0;
    cursor: pointer;
    transition: var(--transition);
    border: 4px solid #fff;
}

.profile-avatar-wrap:hover .avatar-upload-overlay { opacity: 1; }

/* ============================================================
   Category Pills
   ============================================================ */
.category-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 50px;
    padding: 8px 18px;
    font-size: .875rem;
    font-weight: 600;
    color: var(--text);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
}

.category-pill:hover, .category-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* ============================================================
   Messages
   ============================================================ */
.message-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.message-item:hover { background: var(--primary-light); }
.message-item.unread { background: #f0f9ff; border-left: 3px solid var(--primary); }
.message-item .msg-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.message-item .msg-subject { font-weight: 600; font-size: .9rem; color: var(--text); }
.message-item .msg-preview { font-size: .8125rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.message-item .msg-time { font-size: .75rem; color: var(--text-muted); white-space: nowrap; }

/* ============================================================
   Section Titles
   ============================================================ */
.section-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 500px;
    margin: 0 auto;
}

/* === Divider === */
.section-divider {
    width: 56px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 2px;
    margin: 12px auto;
}

/* ============================================================
   Page header strips
   ============================================================ */
.page-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    padding: 40px 0;
    margin-bottom: 32px;
}

.page-header h1 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.4rem); }
.page-header p  { opacity: .85; margin-bottom: 0; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
    background: #0f172a;
    color: rgba(255,255,255,.7);
    padding-top: 48px;
}

.site-footer h5, .site-footer h6 { color: #fff; }

.footer-link { color: rgba(255,255,255,.6); font-size: .875rem; display: block; margin-bottom: 6px; transition: var(--transition); }
.footer-link:hover { color: #fff; padding-left: 4px; }

.footer-social {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,.7);
    transition: var(--transition);
}
.footer-social:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }

/* ============================================================
   Pagination
   ============================================================ */
.pagination .page-link {
    border-radius: var(--radius-sm) !important;
    margin: 0 2px;
    color: var(--primary);
    border-color: var(--border);
    font-weight: 500;
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}

.fw-bold {
    color: var(--primary-light) !important;
}

.drk { color: #000 !important; };

/* ============================================================
   Utilities
   ============================================================ */
.text-primary   { color: var(--primary) !important; }
.text-accent    { color: var(--accent) !important; }
.text-muted     { color: var(--text-muted) !important; }

.bg-primary-light { background: var(--primary-light) !important; }
.bg-accent-light  { background: var(--accent-light) !important; }

.rounded-xl { border-radius: var(--radius) !important; }

/* Application status table */
.table > :not(caption) > * > * {
    padding: 12px 16px;
    vertical-align: middle;
}

.table th { font-size: .8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); background: var(--bg); }

/* Responsive helpers */
@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
    .filter-card { position: relative; top: 0; }
    .hero-section { padding: 60px 0 50px; }
    .auth-card { padding: 24px 16px; }
}

@media (max-width: 576px) {
    .hero-stats { gap: 16px; }
    .hero-stat strong { font-size: 1.3rem; }
}

/* Loading skeleton */
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 4px;
}

/* Smooth fade-in */
.fade-in { animation: fadeIn .4s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
