/* assets/css/v2.css - Modern Redesign */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@500;700;800&display=swap');

:root {
    /* Colors */
    --primary: #0f172a;
    --primary-light: #1e293b;
    --accent: #ef4444;
    /* Red accent as requested/implied by previous context */
    --accent-hover: #dc2626;
    --blue-accent: #3b82f6;

    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.8);

    --text-main: #0f172a;
    --text-body: #475569;
    --text-muted: #94a3b8;

    --border: #e2e8f0;
    --border-light: #f1f5f9;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;

    --container: 1280px;
    --header-height: 80px;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-body);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    line-height: 1.2;
    font-weight: 700;
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.5rem;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
header {
    height: var(--header-height);
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 48px;
    width: auto;
}

nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

nav a {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
    position: relative;
    padding: 0.5rem 0;
}

nav a:hover,
nav a.active {
    color: var(--accent);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.2s ease;
}

nav a:hover::after,
nav a.active::after {
    width: 100%;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white !important;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background: white;
    color: var(--text-main) !important;
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--text-muted);
    background: var(--bg-body);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-login {
    background-color: #0ea5e9;
    /* Sky blue */
    color: white !important;
    border: 1px solid #0ea5e9;
}

.btn-login:hover {
    background-color: #0284c7;
    border-color: #0284c7;
}

.btn-register {
    background-color: #f97316;
    /* Orange */
    color: white !important;
    border: 1px solid #f97316;
}

.btn-register:hover {
    background-color: #ea580c;
    border-color: #ea580c;
}

/* Cards & Grid */
.grid {
    display: grid;
    gap: 2rem;
}

.grid-4 {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--border-light);
}

.card-image-wrapper {
    position: relative;
    padding-top: 60%;
    /* Aspect Ratio */
    overflow: hidden;
    background: var(--bg-body);
}

.card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    line-height: 1.35;
}

.card-title a {
    color: var(--text-main);
}

.card-title a:hover {
    color: var(--accent);
}

.card-excerpt {
    font-size: 0.95rem;
    color: var(--text-body);
    margin-bottom: 1.5rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Play Overlay */
.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.play-overlay:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Share Section */
.share-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.share-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--text-muted);
    border: 1px solid transparent;
    transition: all 0.2s;
}

.share-icon:hover {
    background: var(--bg-body);
    color: var(--primary);
    border-color: var(--border);
}

/* Forms */
input,
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
    margin-bottom: 1rem;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
}

/* Page Content */
.page-content {
    padding: 4rem 1.5rem;
    min-height: 80vh;
}

/* Live Badge Animation (Preserved) */
@keyframes livePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Admin Styles Enhancements */
/* These will override or complement the inline styles in admin_header.php */
.admin-sidebar {
    background: white !important;
    border-right: 1px solid var(--border) !important;
}

.admin-sidebar .logo {
    color: var(--primary);
}

.sidebar-menu a {
    color: var(--text-body);
    font-weight: 500;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: var(--bg-body) !important;
    color: var(--accent) !important;
}

.admin-content {
    background: var(--bg-body);
}

/* Alert */
.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-weight: 500;
}

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

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .grid-4 {
        grid-template-columns: 1fr;
    }

    header {
        height: auto;
        padding: 1rem 0;
    }

    header .container {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 2rem;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg-body);
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--bg-body);
}

/* Code Blocks */
pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    overflow-x: auto;
    margin: 1.5rem 0;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
}

code {
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
    padding: 0.2em 0.4em;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 4px;
}

pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
}

/* ========================================= */
/* NEW SECTIONS REDESIGN */
/* ========================================= */

/* Profile Hero - Fix for "Gap" Issue */
.profile-hero {
    background-color: #fff;
    padding: 2rem 0 2rem;
    /* Decreased padding */
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    /* Subtle premium background pattern */
    background-image:
        radial-gradient(at 0% 0%, rgba(239, 68, 68, 0.03) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(59, 130, 246, 0.03) 0px, transparent 50%);
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.profile-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1.5rem auto;
    border: 4px solid #fff;
    box-shadow: var(--shadow-xl);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.profile-avatar:hover {
    transform: scale(1.05) rotate(2deg);
}

.profile-name {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, #475569 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
}

.profile-titles {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    color: var(--text-body);
    margin-bottom: 1rem;
    font-weight: 500;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.social-icon {
    width: auto;
    height: auto;
    background: transparent;
    box-shadow: none;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-icon:hover {
    transform: scale(1.1);
    box-shadow: none;
}

/* Auth / Login Page Redesign */
.auth-wrapper {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    padding: 2rem;
}

.auth-card {
    background: #fff;
    width: 100%;
    max-width: 440px;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    display: inline-block;
    margin-bottom: 1.5rem;
    transition: transform 0.2s;
}

.auth-logo:hover {
    transform: scale(1.05);
}

.auth-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    font-size: 1.1rem;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 10;
}

.input-icon-wrapper input {
    padding-left: 3rem;
    /* Make space for icon */
    margin-bottom: 0;
}

.btn-full {
    width: 100%;
}

.btn-lg {
    padding: 1rem;
    font-size: 1rem;
}

/* Footer Redesign */
footer {
    background: #111827;
    /* Dark footer */
    color: #9ca3af;
    padding: 4rem 0 2rem;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

.footer-logo {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.footer-desc {
    line-height: 1.6;
    font-size: 0.95rem;
    max-width: 300px;
}

.footer-col h4 {
    color: #fff;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.75rem;
}

.footer-col ul li a {
    transition: color 0.2s;
}

.footer-col ul li a:hover {
    color: var(--accent);
}

.footer-social-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-social-links a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-social-links a:hover {
    color: #fff;
}

.copyright {
    margin-top: 2rem;
    font-size: 0.85rem;
    opacity: 0.6;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer-desc {
        margin: 0 auto;
    }

    .footer-social-links {
        align-items: center;
    }

    .profile-name {
        font-size: 2rem;
    }
}

/* Chat Styles */
.chat-message {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
}

.chat-input-area form {
    margin-bottom: 0;
}