/* Global Styles */
:root {
    --primary-color: #2563eb;
    --secondary-color: #ec4899;
    --accent-color: #f59e0b;
    --bg-color: #f3f4f6;
    --text-color: #1f2937;
    --card-bg: rgba(255, 255, 255, 0.85);
    --glass-border: 1px solid rgba(255, 255, 255, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Glassmorphism Utilities */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border);
    box-shadow: var(--shadow-md);
    border-radius: 12px;
}

/* Header & Navigation */
header {
    background: #000000;
    color: white;
    padding: 1rem 0;
    position: relative;
    z-index: 10;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    text-decoration: none;
    color: white;
}

nav a {
    color: white;
    text-decoration: none;
    margin-left: 1.5rem;
    font-weight: 500;
    transition: opacity 0.2s;
    opacity: 0.9;
}

nav a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Hero Section */
.hero {
    height: 300px;
    /* Default height */
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    /* Overlay for readability */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 2rem;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.running-text-container {
    background: #111827;
    color: #e5e7eb;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    z-index: 5;
}

.running-text-content {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 20s linear infinite;
}

@keyframes marquee {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-100%, 0);
    }
}

@keyframes marquee {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-100%, 0);
    }
}

.sticky-top-wrapper {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

/* Main Content Layout */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 3fr 1fr;
    /* Content vs Sidebar */
    gap: 2rem;
}

/* Lists & Cards */
.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    padding-left: 1rem;
    border-left: 5px solid var(--accent-color);
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.post-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: white;
    /* Fallback */
}

/* Specific styling for Opini to look different */
.opini-list .post-card {
    flex-direction: row;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.opini-list .post-image {
    width: 120px;
    /* Fixed width for list view images */
    height: 100%;
    object-fit: cover;
    border-radius: 8px 0 0 8px;
    /* Assuming card has radius */
}

/* But actually, maybe grid is better for all for simplicity unless specified otherwise. Let's stick to Grid for consistency but vary details. */

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.post-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #e5e7eb;
}

.post-content {
    padding: 1.5rem;
    flex-grow: 1;
    cursor: default;
}

.post-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.post-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    color: var(--text-color);
}

.post-excerpt {
    font-size: 0.95rem;
    color: #4b5563;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.read-more:hover {
    text-decoration: underline;
}

/* Sidebar & Ads */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.widget {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.ad-space {
    background: #f1f5f9;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    color: #94a3b8;
    font-weight: 500;
    text-align: center;
    overflow: hidden;
}

.ad-space img {
    max-width: 100%;
    height: auto;
}

/* Vertical ad space - 2x height */
.ad-space-vertical {
    min-height: 500px;
}

/* Pengetahuan Specifics */
.pengetahuan-item {
    background: #fff;
    border-radius: 8px;
    padding: 1rem;
    border-left: 4px solid var(--secondary-color);
    margin-bottom: 1rem;
    box-shadow: var(--shadow-md);
}

.file-attachment {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #f3f4f6;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--text-color);
    margin-top: 0.5rem;
    transition: background 0.2s;
}

.file-attachment:hover {
    background: #e5e7eb;
}

/* Mega Footer */
footer {
    background-color: #111827;
    color: #9ca3af;
    padding-top: 4rem;
    margin-top: 4rem;
    border-top: 4px solid var(--accent-color);
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
    border-bottom: 1px solid #374151;
    padding-bottom: 3rem;
}

.footer-col h3 {
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 40px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 2px;
}

.footer-about {
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s, padding-left 0.3s;
    display: inline-block;
}

.footer-links a:hover {
    color: white;
    padding-left: 5px;
    color: var(--primary-color);
}

.contact-list {
    list-style: none;
    padding: 0;
}

.contact-list li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.contact-list i {
    color: var(--accent-color);
    margin-top: 4px;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-links a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-links a:hover {
    transform: translateY(-3px);
}

.social-links a.fb:hover {
    background: #2563eb;
}

.social-links a.ig:hover {
    background: #ec4899;
}

.social-links a.wa:hover {
    background: #22c55e;
}

.social-links a.mail:hover {
    background: #ea580c;
}

/* Sponsor Area in Footer */
.footer-sponsors {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-bottom {
    background: #0f172a;
    text-align: center;
    padding: 1.5rem 0;
    font-size: 0.9rem;
    color: #6b7280;
}

/* Login/Admin Forms */
.login-container {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 2rem;
    }
}

/* Event Popup Styles */
/* Event Popup Styles */
#event-popup {
    display: none;
    /* JS toggles this to flex */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    /* Handle small screens */
    padding: 20px;
    box-sizing: border-box;
}

#event-popup.active {
    opacity: 1;
    display: flex !important;
    /* Force flex for centering */
}

.event-popup-wrapper {
    position: relative;
    width: 100%;
    max-width: 450px;
    margin: auto;
    /* Centering fallback */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    transform: translateY(0);
}

.event-popup-close-btn {
    background: black;
    color: white;
    border: none;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    margin-bottom: 0;
    /* Attach to top of card */
    letter-spacing: 0.05em;
    z-index: 10002;
    transition: background 0.2s;
}

.event-popup-close-btn:hover {
    background: #333;
}

.event-popup-content {
    background: white;
    width: 100%;
    border-radius: 0 0 12px 12px;
    /* Top corners sharp if button attached, or just rounded */
    border-radius: 8px;
    /* Standard rounded */
    border-top-right-radius: 0;
    /* Connect to close button if desired, or keep separate */
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10001;
}

#event-popup.active .event-popup-content {
    transform: scale(1);
}

.event-popup-link-wrapper {
    text-decoration: none;
    color: inherit;
    display: block;
}

.event-popup-image {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    /* changing to contain to show full graphic if aspect ratio mismatch */
    object-fit: cover;
    /* Back to cover for Card feel, user can upload correct ratio */
    display: block;
    background: #f3f4f6;
}

.event-popup-body {
    padding: 1.5rem;
    text-align: center;
    background: linear-gradient(to bottom, #ffffff, #f9fafb);
}

.event-popup-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #111827;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.event-popup-desc {
    color: #4b5563;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.event-countdown {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.countdown-box {
    background: #064e3b;
    /* Dark Green like reference */
    padding: 0.5rem;
    border-radius: 6px;
    min-width: 60px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.countdown-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fcd34d;
    /* Gold/Yellow */
    line-height: 1;
    font-family: monospace;
    /* Monospace for numbers looks techy/modern */
}

.countdown-label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    color: white;
    /* White label */
    margin-top: 4px;
    font-weight: 600;
}

.event-popup-btn {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 99px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, background 0.2s;
    width: 100%;
    margin-top: 1rem;
}

.event-popup-btn:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}