/* JobWala24 - Custom Styles */

/* ---- Base ---- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; }

/* ---- Navigation ---- */
.nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}
.nav-link:hover { color: #2563eb; background-color: #eff6ff; }
.nav-active { color: #2563eb; background-color: #eff6ff; }

/* Glass header on scroll */
.header-scrolled {
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* ---- Mobile Nav ---- */
.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    transition: color 0.2s;
}
.safe-bottom { padding-bottom: env(safe-area-inset-bottom); }

/* ---- Job Cards ---- */
.job-card {
    background: white;
    border-radius: 0.75rem;
    border: 1px solid #f3f4f6;
    padding: 1.25rem;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}
.job-card:hover {
    border-color: #dbeafe;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.08);
    transform: translateY(-2px);
}
.job-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    opacity: 0;
    transition: opacity 0.25s;
}
.job-card:hover::before { opacity: 1; }

/* ---- Blog Cards ---- */
.blog-card {
    background: white;
    border-radius: 0.75rem;
    border: 1px solid #f3f4f6;
    overflow: hidden;
    transition: all 0.25s ease;
}
.blog-card:hover {
    border-color: #dbeafe;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.08);
    transform: translateY(-2px);
}
.blog-card-img {
    aspect-ratio: 16/9;
    object-fit: cover;
    width: 100%;
    background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
}

/* ---- Category Cards ---- */
.category-card {
    background: white;
    border-radius: 0.75rem;
    border: 1px solid #f3f4f6;
    padding: 1.5rem;
    transition: all 0.25s ease;
    text-align: center;
}
.category-card:hover {
    border-color: #bfdbfe;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.5;
}

/* ---- Prose (Article Content) ---- */
.prose { line-height: 1.8; color: #374151; }
.prose h2 { font-size: 1.5rem; font-weight: 700; margin-top: 2rem; margin-bottom: 0.75rem; color: #111827; }
.prose h3 { font-size: 1.25rem; font-weight: 600; margin-top: 1.5rem; margin-bottom: 0.5rem; color: #1f2937; }
.prose h4 { font-size: 1.125rem; font-weight: 600; margin-top: 1.25rem; margin-bottom: 0.5rem; color: #1f2937; }
.prose p { margin-bottom: 1rem; }
.prose ul, .prose ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.prose li { margin-bottom: 0.375rem; }
.prose ul li { list-style-type: disc; }
.prose ol li { list-style-type: decimal; }
.prose a { color: #2563eb; text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: #1d4ed8; }
.prose strong { font-weight: 600; color: #111827; }
.prose blockquote {
    border-left: 4px solid #3b82f6;
    padding: 0.75rem 1rem;
    margin: 1.25rem 0;
    background: #f8fafc;
    border-radius: 0 0.5rem 0.5rem 0;
    color: #4b5563;
}
.prose table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.prose th, .prose td { padding: 0.625rem 0.75rem; border: 1px solid #e5e7eb; text-align: left; }
.prose th { background: #f9fafb; font-weight: 600; color: #111827; }
.prose img { border-radius: 0.5rem; margin: 1rem 0; max-width: 100%; height: auto; }
.prose pre { background: #1f2937; color: #e5e7eb; padding: 1rem; border-radius: 0.5rem; overflow-x: auto; margin: 1rem 0; }
.prose code { font-size: 0.875em; }

/* ---- Skeleton Loading ---- */
.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 0.375rem;
}
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---- Hero Section ---- */
.hero-gradient {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
    position: relative;
    overflow: hidden;
}
.hero-gradient::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    pointer-events: none;
}
.hero-gradient::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 40%;
    height: 150%;
    background: radial-gradient(circle, rgba(96,165,250,0.15) 0%, transparent 70%);
    pointer-events: none;
}

/* ---- Search Input ---- */
.search-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ---- Form Elements ---- */
.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    background: white;
}
.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}
textarea.form-input { resize: vertical; min-height: 120px; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}
.btn-primary { background: #2563eb; color: white; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }
.btn-secondary:hover { background: #e5e7eb; }
.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }

/* ---- Ad Container ---- */
.ad-container {
    text-align: center;
    min-height: 1px;
    overflow: hidden;
}

/* ---- Page transition ---- */
.page-enter {
    animation: pageEnter 0.3s ease-out;
}
@keyframes pageEnter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Admin Sidebar ---- */
.admin-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    color: #9ca3af;
    border-radius: 0.5rem;
    transition: all 0.2s;
}
.admin-sidebar-link:hover { color: white; background: rgba(255,255,255,0.08); }
.admin-sidebar-link.active { color: white; background: rgba(59,130,246,0.2); }

/* ---- Flash Messages ---- */
.flash-message {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: flashIn 0.3s ease;
}
.flash-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
@keyframes flashIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Table ---- */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}
.admin-table td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
}
.admin-table tr:hover td { background: #f9fafb; }

/* ---- Stat Cards ---- */
.stat-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.25rem;
    border: 1px solid #f3f4f6;
    transition: all 0.2s;
}
.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* ---- Tooltip ---- */
[data-tooltip] {
    position: relative;
}
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.375rem 0.625rem;
    background: #1f2937;
    color: white;
    font-size: 0.75rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 0.375rem;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ---- Print ---- */
@media print {
    header, footer, nav, .ad-container, .mobile-nav-item { display: none !important; }
    main { padding: 0 !important; }
}

/* ---- Accessibility ---- */
:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
