/* assets/css/ui-updates.css
 * Comprehensive UI refresh for ShantiGyan.
 * Applies across public site and admin panel.
 */

/* ================================
   Brand-aligned color overrides
   ================================ */
:root {
    --primary-color: #0F172A;
    --primary-hover: #1E293B;
    --secondary-color: #0EA5E9;
    --brand-pink: #38BDF8;
    --brand-green: #22C55E;
    --brand-blue: #3B82F6;
    --brand-orange: #F97316;
    --background-color: #F8FAFC;
    --surface: #FFFFFF;
    --text-color: #1E293B;
    --text-light: #64748B;
    --border-color: #E2E8F0;
    --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --border-radius: 0.75rem;
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme="dark"] {
    --background-color: #0F172A;
    --surface: #1E293B;
    --text-color: #F1F5F9;
    --text-light: #94A3B8;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.65;
}

/* ================================
   Header & Navbar
   ================================ */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-color);
}

html[data-theme="dark"] header {
    background: rgba(15, 23, 42, 0.95);
}

.navbar {
    padding: 0.75rem 5%;
    gap: 1.5rem;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    gap: 0.75rem;
    letter-spacing: -0.02em;
}

.logo img {
    height: 46px !important;
    max-width: 170px !important;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.05));
    transition: var(--transition);
}

.logo:hover img {
    transform: scale(1.03);
}

.nav-links {
    gap: 0.5rem;
}

.nav-links li a {
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-color);
    transition: var(--transition);
}

.nav-links li a:hover {
    color: var(--primary-color);
    background: rgba(79, 70, 229, 0.08);
}

.nav-links li a.btn {
    padding: 0.5rem 1rem;
}

.nav-links li a.btn-primary:hover,
.nav-links li a.btn-secondary:hover,
.nav-links li a.btn-danger:hover {
    background: inherit;
    filter: brightness(1.05);
}

/* Active nav indicator */
.nav-links li a[href]:active,
.nav-links li a.active {
    color: var(--primary-color);
    background: rgba(79, 70, 229, 0.1);
    font-weight: 600;
}

/* ================================
   Buttons
   ================================ */
.btn {
    border-radius: var(--radius-md);
    padding: 0.6rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: none;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--brand-blue) 100%);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #2563EB 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #059669 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: #fff;
}

/* ================================
   Cards
   ================================ */
.card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(79, 70, 229, 0.15);
}

.filter-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* ================================
   Page Banners
   ================================ */
.page-banner {
    background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 50%, #3B82F6 100%);
    color: #fff;
    padding: 3rem 5%;
    margin-bottom: 2.5rem;
    text-align: center;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.page-banner::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.05'%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");
    opacity: 0.6;
}

.page-banner h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    position: relative;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.page-banner p {
    font-size: 1.1rem;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

/* ================================
   Forms & Inputs
   ================================ */
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="date"],
input[type="number"],
select,
textarea {
    background: var(--surface);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    color: var(--text-color);
    transition: var(--transition);
    width: 100%;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

/* ================================
   Tables
   ================================ */
table {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--brand-blue) 100%);
    color: #fff;
}

table th {
    font-weight: 600;
    padding: 1rem;
    text-align: left;
}

table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

table tbody tr:hover {
    background: rgba(79, 70, 229, 0.03);
}

/* ================================
   Badges
   ================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(79, 70, 229, 0.15);
}

.badge[style*="background-color: #D1FAE5"] {
    background: rgba(34, 197, 94, 0.12) !important;
    color: #059669 !important;
    border-color: rgba(34, 197, 94, 0.2) !important;
}

.badge[style*="background-color: #FEE2E2"] {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #DC2626 !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
}

/* ================================
   Footer
   ================================ */
footer {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    color: #CBD5E1;
    padding: 3rem 5% 1.5rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
}

.footer-grid {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

footer h3,
footer h4 {
    color: #fff;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

footer a {
    color: #94A3B8;
    transition: var(--transition);
}

footer a:hover {
    color: var(--brand-green);
    padding-left: 4px;
}

.footer-social {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.footer-social a {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: #94A3B8;
    padding-left: 0;
}

.footer-social a:hover {
    background: var(--brand-pink);
    color: #fff;
    transform: translateY(-3px);
    padding-left: 0;
}

.footer-social svg {
    width: 20px;
    height: 20px;
}

.footer-social a[aria-label="WhatsApp"]:hover {
    background: #25D366;
}

.footer-social a[aria-label="YouTube"]:hover {
    background: #FF0000;
}

.footer-social a[aria-label="Instagram"]:hover {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    font-size: 0.9rem;
    color: #94A3B8;
}

/* ================================
   Floating WhatsApp Button
   ================================ */
.floating-whatsapp {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    right: auto;
    z-index: 95;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: #25D366;
    color: #fff;
    padding: 0.75rem 1rem 0.75rem 0.85rem;
    border-radius: 9999px;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    animation: whatsapp-pulse 2s infinite;
}

.floating-whatsapp:hover {
    background: #128C7E;
    color: #fff;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.45);
}

.floating-whatsapp svg {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

@keyframes whatsapp-pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
    70% { box-shadow: 0 0 0 12px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

@media (max-width: 768px) {
    .floating-whatsapp {
        bottom: 1rem;
        left: 1rem;
        right: auto;
        padding: 0.65rem 0.85rem 0.65rem 0.75rem;
        font-size: 0.85rem;
    }

    .floating-whatsapp svg {
        width: 22px;
        height: 22px;
    }

    .floating-whatsapp-text {
        display: none;
    }
}

/* ================================
   Quiz cards
   ================================ */
.quiz-list-card {
    align-items: center;
    padding: 1.25rem;
    gap: 1.25rem;
}

.quiz-icon {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.1) 0%, rgba(56, 189, 248, 0.1) 100%);
    border: 1px solid rgba(79, 70, 229, 0.1);
}

.quiz-icon img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

/* ================================
   Back to top
   ================================ */
.back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--brand-blue) 100%);
    color: #fff;
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* ================================
   Alerts
   ================================ */
.alert {
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    font-weight: 500;
    border-left: 4px solid;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: #047857;
    border-color: var(--brand-green);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #B91C1C;
    border-color: #EF4444;
}

/* ================================
   Admin panel refresh
   ================================ */
.sidebar {
    background: linear-gradient(180deg, #111827 0%, #0F172A 100%);
    border-right: 1px solid rgba(255,255,255,0.06);
}

.sidebar-header {
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.02);
}

.sidebar-nav a {
    margin: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(79, 70, 229, 0.2);
    color: #fff;
    border-left: none;
    box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.3);
}

.sidebar-nav a[style*="margin-top: 2rem"] {
    margin-top: 2rem !important;
}

.admin-topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
}

.admin-main {
    background: var(--background-color);
}

/* Admin tables */
.admin-main table {
    border-radius: var(--radius-lg);
}

.admin-main table thead {
    background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
}

/* ================================
   Mobile improvements
   ================================ */
@media (max-width: 768px) {
    .navbar {
        padding: 0.65rem 4%;
    }

    .logo img {
        height: 38px !important;
        max-width: 140px !important;
    }

    .page-banner {
        padding: 2rem 4%;
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    }

    .page-banner h1 {
        font-size: 1.65rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .nav-links {
        top: 64px;
        background: var(--surface);
        border-top: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
        padding: 1rem;
    }

    .nav-links li a {
        padding: 0.75rem 1rem;
        border-radius: var(--radius-md);
    }

    .card:hover {
        transform: translateY(-3px);
    }

    .quiz-list-card {
        flex-direction: column;
        text-align: center;
    }

    .floating-whatsapp {
        bottom: 1rem;
    }
}

/* ================================
   Utility / polish
   ================================ */
.container {
    max-width: 1280px;
}

a {
    transition: var(--transition);
}

/* Smooth focus rings */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.25);
}

/* Fade-in animation reused */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

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

/* Detail cards */
.detail-card {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.detail-label {
    background: rgba(79, 70, 229, 0.06);
    border-radius: var(--radius-sm);
    font-weight: 600;
    color: var(--primary-color);
}

/* Section filters */
.section-filter {
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: var(--transition);
}

.section-filter.active,
.section-filter:hover {
    background: var(--primary-color);
    color: #fff;
    box-shadow: var(--shadow-md);
}

/* State badge link inside tables */
.badge-link {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary-color);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.badge-link:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Current Affairs page enhanced UI */
.video-thumb:hover {
    background: var(--bg-secondary);
}

.ca-card {
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ca-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.ca-image-wrap {
    height: 170px;
    overflow: hidden;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    margin: -1.5rem -1.5rem 1rem -1.5rem;
}

.ca-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ca-card:hover .ca-image-wrap img {
    transform: scale(1.05);
}

.ca-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ca-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ca-category {
    background-color: #E0E7FF;
    color: #3730A3;
}

.ca-date {
    font-size: 0.8rem;
    color: var(--text-light);
}

.ca-title {
    font-size: 1rem;
    margin-bottom: 1rem;
    line-height: 1.45;
    color: var(--text-color);
}

.ca-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.archive-link {
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.archive-link:hover {
    color: var(--primary-color);
}

.archive-active {
    display: inline-block;
    background-color: #DBEAFE;
    color: #1E40AF;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

/* Light button for colored backgrounds */
.btn-light {
    background: #fff;
    color: var(--primary-color);
    border: 1px solid #fff;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.btn-light:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

/* Job alert card responsive */
@media (max-width: 768px) {
    .job-alert-card > div {
        grid-template-columns: 1fr !important;
    }
}

/* Success button (WhatsApp green) */
.btn-success {
    background: #25D366;
    color: #fff;
    border: 1px solid #25D366;
}

.btn-success:hover {
    background: #128C7E;
    border-color: #128C7E;
    color: #fff;
}

/* ================================
   Highlighted social section
   ================================ */
.social-highlight {
    background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 100%);
    color: #fff;
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.social-highlight::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.12) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,0.08) 0%, transparent 35%);
    pointer-events: none;
}

.social-highlight h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    position: relative;
}

.social-highlight p {
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto 1.75rem;
    position: relative;
}

.social-highlight-grid {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    position: relative;
}

.social-highlight-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.5rem;
    border-radius: 9999px;
    background: #fff;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.social-highlight-btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: var(--shadow-xl);
    color: var(--primary-color);
}

.social-highlight-btn svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.social-highlight-btn.whatsapp {
    color: #25D366;
}

.social-highlight-btn.whatsapp:hover {
    background: #25D366;
    color: #fff;
}

.social-highlight-btn.instagram {
    color: #E1306C;
}

.social-highlight-btn.instagram:hover {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: #fff;
}

.social-highlight-btn.youtube {
    color: #FF0000;
}

.social-highlight-btn.youtube:hover {
    background: #FF0000;
    color: #fff;
}

@media (max-width: 768px) {
    .social-highlight {
        padding: 2rem 1.25rem;
    }

    .social-highlight h2 {
        font-size: 1.4rem;
    }

    .social-highlight-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
}
