/* ============================================
   RPN Design System
   Based on guide/design.md
   ============================================ */

:root {
    /* Colors */
    --color-primary: #00A63E;
    --color-primary-dark: #008F35;
    --color-primary-light: #E6F7ED;
    --color-accent: #FFD700;
    --color-accent-dark: #E6C200;

    --color-bg-dark: #111111;
    --color-bg-white: #FFFFFF;
    --color-bg-light: #F7F7F7;
    --color-bg-beige: #F9F6F1;

    --color-text-heading: #111827;
    --color-text-body: #374151;
    --color-text-muted: #6B7280;
    --color-text-white: #FFFFFF;
    --color-text-white-muted: rgba(255, 255, 255, 0.7);

    --color-border: #E5E7EB;
    --color-border-input: #D1D5DB;

    /* Typography */
    --font-sans: 'Inter', 'Helvetica Neue', Arial, sans-serif;

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;

    /* Layout */
    --container-max: 1200px;
    --container-padding: 24px;
}

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

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text-body);
    background: var(--color-bg-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

main {
    flex: 1;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--color-primary-dark);
    line-height: 1.2;
}

/* ---- Navbar ---- */
.navbar {
    background: var(--color-bg-dark);
    height: 64px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

.nav-container {
    max-width: var(--container-max);
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--container-padding);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 20px;
    font-weight: 800;
    color: var(--color-text-white);
    letter-spacing: 0.03em;
}

.nav-brand:hover {
    text-decoration: none;
    color: var(--color-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links a {
    color: var(--color-text-white-muted);
    font-size: 14px;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.nav-links a:hover {
    color: var(--color-text-white);
    text-decoration: none;
}

.nav-user {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    font-weight: 400;
}

/* ---- Container ---- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* ---- Hero ---- */
.hero {
    background-color: #111111;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 360px;
}

/* ---- About Section ---- */
.about-section {
    background: var(--color-bg-white);
    padding: 56px 0 64px;
    border-bottom: 1px solid var(--color-border);
}

.about-section h2 {
    margin-top: 0;
    margin-bottom: 12px;
    text-align: center;
}

.about-lead {
    font-size: 18px;
    color: var(--color-text-body);
    text-align: center;
    max-width: 640px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.about-pillars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.pillar {
    padding: 24px;
    background: var(--color-bg-light);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.pillar h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-primary-dark);
}

.pillar p {
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* ---- Section headings ---- */
h2 {
    font-size: 32px;
    font-weight: 700;
    margin-top: 48px;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.no-events {
    color: var(--color-text-muted);
    font-size: 16px;
    margin-top: 16px;
}

/* ---- Event Grid ---- */
.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.event-card {
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--transition-base), transform var(--transition-base);
    display: flex;
    flex-direction: column;
}

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

.event-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.event-card h3 {
    font-size: 20px;
    font-weight: 600;
}

.event-badge {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
}

.badge-upcoming {
    background: var(--color-primary-light);
    color: #065F24;
}

.badge-completed {
    background: #EEF2FF;
    color: #3730a3;
}

.event-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.event-description {
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
}

.event-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.capacity {
    font-size: 13px;
    color: var(--color-text-muted);
}

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: var(--radius-full);
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    border: none;
    text-align: center;
    transition: background-color var(--transition-base), transform var(--transition-fast);
}

.btn-sm {
    padding: 8px 18px;
    font-size: 13px;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-text-white);
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-1px);
    text-decoration: none;
    color: var(--color-text-white);
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-disabled {
    background-color: #9CA3AF;
    color: var(--color-text-white);
    cursor: not-allowed;
}

/* ---- Forms ---- */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
    color: var(--color-text-body);
}

.form-control {
    display: block;
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    font-family: var(--font-sans);
    color: var(--color-text-heading);
    border: 1px solid var(--color-border-input);
    border-radius: var(--radius-md);
    background: var(--color-bg-white);
    transition: border-color var(--transition-base);
}

.form-control::placeholder {
    color: #9CA3AF;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 166, 62, 0.15);
}

/* ---- Login Box ---- */
.login-box {
    max-width: 420px;
    margin: 64px auto;
    background: var(--color-bg-white);
    padding: 32px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
}

.login-box h2 {
    margin-top: 0;
    margin-bottom: 24px;
    text-align: center;
    font-size: 24px;
}

/* ---- Registration Box ---- */
.register-box {
    max-width: 520px;
    margin: 48px auto;
    background: var(--color-bg-white);
    padding: 32px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
}

.register-box h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 24px;
}

.event-summary {
    background: var(--color-bg-light);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    border-left: 3px solid var(--color-primary);
}

.event-summary h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.event-summary p {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

/* ---- Ticket Box ---- */
.ticket-box {
    max-width: 560px;
    margin: 48px auto;
    background: var(--color-bg-white);
    padding: 32px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}

.ticket-header h2 {
    margin: 0;
    font-size: 24px;
}

.ticket-status {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-pending {
    background: #FFF8E1;
    color: #854d0e;
}

.status-active {
    background: var(--color-primary-light);
    color: #065F24;
}

.status-used {
    background: #EEF2FF;
    color: #3730a3;
}

.status-cancelled {
    background: #FEF2F2;
    color: #991b1b;
}

.ticket-details {
    text-align: center;
}

.ticket-info {
    text-align: left;
    margin-bottom: 24px;
}

.ticket-info h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.ticket-info p {
    font-size: 15px;
    margin-bottom: 4px;
    color: var(--color-text-muted);
}

.ticket-info p strong {
    color: var(--color-text-body);
}

.ticket-info hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 12px 0;
}

.ticket-info code {
    background: var(--color-bg-light);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-heading);
}

.ticket-qr {
    margin-top: 16px;
}

.ticket-qr img {
    max-width: 200px;
    border-radius: var(--radius-md);
}

/* ---- Alerts ---- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-top: 16px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}

.alert-success {
    background: var(--color-primary-light);
    color: #065F24;
}

.alert-danger {
    background: #FEF2F2;
    color: #991b1b;
}

.alert-warning {
    background: #FFF8E1;
    color: #854d0e;
}

.alert-info {
    background: #EFF6FF;
    color: #1E40AF;
}

/* ---- Section Header ---- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.section-link {
    font-size: 14px;
    font-weight: 500;
}

/* ---- Blog ---- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.blog-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.blog-card {
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--transition-base), transform var(--transition-base);
}

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

.blog-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.blog-card h3 a {
    color: var(--color-text-heading);
}

.blog-card h3 a:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.blog-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.tag {
    display: inline-block;
    padding: 2px 10px;
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: 12px;
    color: var(--color-text-muted);
    transition: background-color var(--transition-fast);
}

.tag:hover {
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
    text-decoration: none;
}

.blog-excerpt {
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: 12px;
}

.blog-read-more {
    font-size: 14px;
    font-weight: 500;
}

/* Blog Hero */
.blog-hero {
    background: linear-gradient(135deg, #111111 0%, #1A2E1A 100%);
    padding: 40px 0 48px;
}

.blog-back {
    display: inline-block;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 20px;
    transition: color var(--transition-fast);
}

.blog-back:hover {
    color: var(--color-text-white);
    text-decoration: none;
}

.blog-hero h1 {
    font-size: 40px;
    font-weight: 800;
    color: var(--color-text-white);
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 16px;
    max-width: 720px;
}

.blog-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

.blog-hero-divider {
    color: rgba(255, 255, 255, 0.3);
}

.tag-light {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
}

.tag-light:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--color-text-white);
}

/* Blog Article */
.blog-article {
    max-width: 720px;
    margin: -16px auto 0;
    padding: 40px 40px 48px;
    background: var(--color-bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    position: relative;
}

.blog-body {
    font-size: 17px;
    line-height: 1.8;
    color: var(--color-text-body);
}

.blog-body > *:first-child {
    margin-top: 0;
}

.blog-body h1 {
    font-size: 28px;
    margin-top: 32px;
    margin-bottom: 12px;
}

.blog-body h2 {
    font-size: 24px;
    margin-top: 32px;
    margin-bottom: 12px;
}

.blog-body h3 {
    font-size: 20px;
    margin-top: 24px;
    margin-bottom: 8px;
}

.blog-body p {
    margin-bottom: 16px;
}

.blog-body ul, .blog-body ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.blog-body li {
    margin-bottom: 4px;
}

.blog-body code {
    background: var(--color-bg-light);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.blog-body pre {
    background: var(--color-bg-dark);
    color: var(--color-text-white);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: 16px;
}

.blog-body pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: 14px;
}

.blog-body blockquote {
    border-left: 3px solid var(--color-primary);
    padding-left: 16px;
    margin: 16px 0;
    color: var(--color-text-muted);
    font-style: italic;
}

.blog-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
}

/* ---- Footer ---- */
.footer {
    background: var(--color-bg-dark);
    color: var(--color-text-white-muted);
    text-align: center;
    padding: 32px 0;
    margin-top: 80px;
    font-size: 14px;
}

.footer p {
    color: rgba(255, 255, 255, 0.5);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .hero {
        min-height: 240px;
    }

    h2 {
        font-size: 24px;
    }

    .about-pillars {
        grid-template-columns: repeat(2, 1fr);
    }

    .event-grid, .blog-grid, .blog-grid-3 {
        grid-template-columns: 1fr;
    }

    .event-footer {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .blog-hero h1 {
        font-size: 28px;
    }

    .blog-article {
        padding: 24px 20px 32px;
        margin-top: -8px;
    }
}

@media (max-width: 640px) {
    :root {
        --container-padding: 16px;
    }

    .ticket-box,
    .register-box,
    .login-box {
        margin-left: 16px;
        margin-right: 16px;
    }

    .ticket-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .about-pillars {
        grid-template-columns: 1fr;
    }

    .nav-links {
        gap: 12px;
    }
}
