/* ==========================================================================
   CSS VARIABLES & GLOBAL STYLES (LIGHT MODE EDITION)
   ========================================================================== */
:root {
    --bg-dark: #f8fafc;        /* Slate 50 - Soft Warm Light Gray */
    --bg-card: rgba(255, 255, 255, 0.85); /* Semi-translucent Clean White */
    --border-light: rgba(15, 23, 42, 0.06); /* Subtle Dark Border */
    --border-hover: rgba(37, 99, 235, 0.3); /* Soft Blue Border */
    --border-active: rgba(16, 185, 129, 0.4); /* Soft Green Border */
    
    --text-primary: #0f172a;    /* Slate 900 - Dark Slate Text */
    --text-secondary: #475569;  /* Slate 600 - Reading Text */
    --text-muted: #94a3b8;      /* Slate 400 - Subdued Text */
    
    --color-primary: #2563eb;   /* Tech Blue - Readable Blue */
    --color-accent: #059669;    /* Aurora Green - Readable Green */
    --color-warning: #dc2626;   /* Alert Red */
    --color-yellow: #d97706;    /* Warning Yellow */
    
    --glow-primary: rgba(37, 99, 235, 0.1);
    --glow-accent: rgba(5, 150, 105, 0.1);
    
    --font-heading: 'Outfit', 'Noto Sans TC', sans-serif;
    --font-body: 'Noto Sans TC', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 var(--bg-dark);
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    padding-bottom: 80px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* ==========================================================================
   BACKGROUND EFFECTS (LIGHT MODE HUES)
   ========================================================================== */
.bg-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.08; /* Soft colored mist on white background */
}

.glow-1 {
    top: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--color-primary) 0%, transparent 70%);
}

.glow-2 {
    bottom: -10%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--color-accent) 0%, transparent 70%);
}

.grid-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(15, 23, 42, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.015) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
}

/* ==========================================================================
   GLASSMORPHISM CARD BASE (LIGHT ELEVATION)
   ========================================================================== */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   FLOATING PROGRESS BAR (LIGHT VERSION)
   ========================================================================== */
.progress-bar-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    width: 90%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 50px;
    padding: 12px 24px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    z-index: 100;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-bar-container.visible {
    transform: translateX(-50%) translateY(0);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.progress-title {
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.progress-number {
    font-family: 'Outfit', sans-serif;
    color: var(--color-accent);
    font-weight: 600;
}

.progress-track {
    width: 100%;
    height: 6px;
    background: rgba(15, 23, 42, 0.06);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    border-radius: 10px;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   HERO / HEADER (LIGHT VERSION)
   ========================================================================== */
.hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    text-align: center;
    padding: 80px 0 40px;
    position: relative;
}

.badge {
    display: inline-block;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(16, 185, 129, 0.08));
    border: 1px solid rgba(37, 99, 235, 0.15);
    color: var(--color-accent);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 24px;
    text-transform: uppercase;
    animation: pulse 3s infinite;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    line-height: 1.15;
    color: var(--text-primary);
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

.hero-title .highlight {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 760px;
    margin: 0 auto 40px;
    font-weight: 300;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.1);
    color: var(--text-secondary);
    margin-left: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.2);
    color: var(--text-primary);
    transform: translateY(-2px);
}

/* ==========================================================================
   VALUE DECLARATION SECTION
   ========================================================================== */
.value-card-container {
    margin-bottom: 80px;
}

.value-card {
    padding: 40px;
    border-left: 4px solid var(--color-primary);
    background: #ffffff;
}

.value-title-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.value-icon {
    font-size: 1.8rem;
    color: var(--color-primary);
}

.value-card h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.value-quote {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    border-left: 2px solid rgba(15, 23, 42, 0.1);
    padding-left: 20px;
    margin-bottom: 30px;
    font-style: italic;
}

.value-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.value-item strong {
    display: block;
    font-size: 1.05rem;
    color: var(--color-primary);
    margin-bottom: 8px;
    font-weight: 700;
}

.value-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ==========================================================================
   RULES SECTION
   ========================================================================== */
.rules-section {
    margin-bottom: 80px;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.section-header .rule-count {
    color: var(--color-primary);
    font-family: 'Outfit', sans-serif;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 650px;
    margin: 0 auto;
    font-weight: 300;
}

.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

/* Rule Card */
.rule-card {
    padding: 30px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.rule-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.02), transparent 60%);
    pointer-events: none;
}

.rule-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-hover);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

/* Card Active (Checked) State */
.rule-card.active {
    border-color: var(--border-active);
    background: rgba(16, 185, 129, 0.01);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.05);
}

.rule-card.active::before {
    background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.03), transparent 60%);
}

.rule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.rule-num {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    color: rgba(15, 23, 42, 0.04);
    transition: color 0.3s ease;
}

.rule-card:hover .rule-num {
    color: rgba(37, 99, 235, 0.08);
}

.rule-card.active .rule-num {
    color: rgba(16, 185, 129, 0.08);
}

.rule-icon {
    width: 44px;
    height: 44px;
    background: rgba(37, 99, 235, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    border: 1px solid rgba(37, 99, 235, 0.1);
    transition: all 0.3s ease;
}

.rule-card:hover .rule-icon {
    color: #fff;
    background: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 0 12px var(--glow-primary);
}

.rule-card.active .rule-icon {
    color: #fff;
    background: var(--color-accent);
    border-color: var(--color-accent);
    box-shadow: 0 0 12px var(--glow-accent);
}

.rule-icon svg {
    width: 20px;
    height: 20px;
}

.rule-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.rule-summary {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 20px;
    flex-grow: 1;
}

/* Collapsible Detailed Content */
.rule-detail-container {
    height: 0;
    overflow: hidden;
    transition: height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.rule-detail-content {
    padding-top: 15px;
    padding-bottom: 15px;
    border-top: 1px dashed rgba(15, 23, 42, 0.08);
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.rule-detail-content p {
    margin-bottom: 10px;
}

.rule-detail-content p:last-child {
    margin-bottom: 0;
}

.rule-detail-content ul {
    list-style: none;
    padding-left: 15px;
}

.rule-detail-content li {
    position: relative;
    margin-bottom: 6px;
}

.rule-detail-content li::before {
    content: "•";
    position: absolute;
    left: -12px;
    color: var(--color-primary);
}

.warning-text {
    color: var(--color-yellow);
    font-weight: 600;
}

.link-wrapper a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.link-wrapper a:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

/* Card Footer Actions */
.rule-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(15, 23, 42, 0.05);
}

.btn-toggle-detail {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
}

.btn-toggle-detail:hover {
    color: var(--color-accent);
}

/* Custom Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 26px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 18px;
    width: 18px;
    background-color: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--border-hover);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid #ffffff; /* White checkmark on green background */
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ span:not(.checkmark) {
    color: var(--color-accent);
}

/* ==========================================================================
   SIGNING SECTION
   ========================================================================== */
.signing-section {
    margin-bottom: 80px;
    position: relative;
}

.signing-card {
    padding: 50px 40px;
    background: #ffffff;
}

/* Lock Overlay (Light Blur) */
.lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(248, 250, 252, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 1;
    visibility: visible;
    transition: all 0.5s ease;
}

.signing-section.unlocked .lock-overlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.lock-content {
    text-align: center;
    max-width: 320px;
}

.lock-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    animation: bounce 2s infinite;
}

.lock-content h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.lock-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Form Styles */
#pledgeForm {
    max-width: 600px;
    margin: 40px auto 0;
}

.form-group {
    margin-bottom: 28px;
}

.form-group label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

#warriorName {
    width: 100%;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    color: var(--text-primary);
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-body);
    transition: all 0.3s ease;
}

#warriorName:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Canvas Box */
.canvas-container {
    position: relative;
    width: 100%;
    background: #f1f5f9; /* Soft light gray background for drawing */
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 12px;
    overflow: hidden;
}

#signatureCanvas {
    display: block;
    width: 100%;
    height: 180px;
    cursor: crosshair;
    touch-action: none;
}

.btn-clear {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.1);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.2s ease;
}

.btn-clear:hover {
    background: rgba(239, 68, 68, 0.08);
    color: var(--color-warning);
    border-color: rgba(239, 68, 68, 0.2);
}

.canvas-tip {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.btn-submit-pledge {
    width: 100%;
    padding: 16px;
    margin-top: 20px;
}

/* ==========================================================================
   CERTIFICATE MODAL & PRINT CONTAINER (LIGHT/ELEGANT CERTIFICATE)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4); /* soft slate overlay blur */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 20px;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    width: 100%;
    max-width: 760px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.open .modal-card {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
    z-index: 10;
}

.modal-close:hover {
    color: var(--color-warning);
}

/* Certificate Layout (Warm Paper Ivory Vibe) */
.certificate-container {
    padding: 40px;
    background: #fdfdfa; /* Warm Creamy White */
    color: #1e293b;
}

.cert-border-outer {
    border: 5px double var(--color-accent);
    padding: 6px;
    position: relative;
}

.cert-border-inner {
    border: 1px solid rgba(5, 150, 105, 0.15);
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cert-bg-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-heading);
    font-size: 12rem;
    font-weight: 800;
    color: rgba(15, 23, 42, 0.015); /* very soft light watermark */
    letter-spacing: 15px;
    pointer-events: none;
    user-select: none;
}

.cert-header {
    margin-bottom: 35px;
}

.cert-org {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--color-accent);
    margin-bottom: 12px;
}

.cert-title {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: #0f172a;
}

.cert-body {
    margin-bottom: 40px;
}

.cert-text-intro {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.cert-warrior-name {
    font-size: 2.4rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 25px;
    border-bottom: 2px solid rgba(15, 23, 42, 0.08);
    display: inline-block;
    padding: 0 24px 8px;
}

.cert-oath {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 540px;
    margin: 0 auto;
    line-height: 1.8;
    text-align: justify;
}

.cert-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    max-width: 540px;
    margin: 40px auto 0;
    border-top: 1px dashed rgba(15, 23, 42, 0.1);
    padding-top: 25px;
}

.cert-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.cert-val {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.cert-signature-img-container {
    height: 50px;
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 4px;
}

.cert-signature-img-container img {
    max-height: 100%;
    max-width: 180px;
    filter: brightness(0.9) contrast(1.4); /* High contrast signature */
}

.modal-footer-actions {
    padding: 24px 40px 40px;
    background: #ffffff;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    text-align: center;
}

#btnPrintCert {
    width: 100%;
    margin-bottom: 16px;
}

.share-tip {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   SCROLL REVEAL ANIMATIONS
   ========================================================================== */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-reveal.reveal-active {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   ANIMATIONS KEYFRAMES
   ========================================================================== */
@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.2); }
    70% { transform: scale(1.02); box-shadow: 0 0 0 10px rgba(5, 150, 105, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */
@media print {
    body * {
        visibility: hidden;
    }
    #certificatePrintArea, #certificatePrintArea * {
        visibility: visible;
    }
    #certificatePrintArea {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        background: #ffffff !important;
        color: #000000 !important;
        padding: 20px !important;
    }
    .cert-border-outer {
        border-color: #000000 !important;
    }
    .cert-border-inner {
        border-color: #e5e7eb !important;
        background: #ffffff !important;
    }
    .cert-title, .cert-warrior-name {
        color: #000000 !important;
    }
    .cert-org {
        color: #374151 !important;
    }
    .cert-oath, .cert-text-intro, .cert-val {
        color: #4b5563 !important;
    }
    .cert-bg-logo {
        color: rgba(0, 0, 0, 0.02) !important;
    }
    .cert-signature-img-container img {
        filter: brightness(0.1) contrast(3) !important; /* Makes signature dark for printing */
    }
}

/* ==========================================================================
   RESPONSIVE DESIGN (RWD)
   ========================================================================== */
@media (max-width: 768px) {
    .hero {
        min-height: 70vh;
        padding-top: 100px;
    }
    .hero-buttons {
        display: flex;
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }
    .btn-secondary {
        margin-left: 0;
        width: 100%;
        max-width: 280px;
    }
    .btn-primary {
        width: 100%;
        max-width: 280px;
    }
    .value-card {
        padding: 24px;
    }
    .rules-grid {
        grid-template-columns: 1fr;
    }
    .signing-card {
        padding: 30px 20px;
    }
    .certificate-container {
        padding: 20px 10px;
    }
    .cert-border-inner {
        padding: 24px 15px;
    }
    .cert-footer {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        text-align: center;
    }
    .cert-signature-area {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

/* ==========================================================================
   AUDIO GUIDE OVERLAY STYLING (LIGHT EDITION)
   ========================================================================== */
.guide-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 20px;
}

.guide-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.guide-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 680px;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.15);
    position: relative;
    transform: translateY(30px);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.guide-overlay.open .guide-card {
    transform: translateY(0);
}

.guide-close-btn {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
    z-index: 10;
}

.guide-close-btn:hover {
    color: var(--color-warning);
}

.guide-badge {
    display: inline-block;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(16, 185, 129, 0.08));
    border: 1px solid rgba(37, 99, 235, 0.15);
    color: var(--color-primary);
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.guide-header h2 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 25px;
}

/* Guide Track (Milestones) */
.guide-track-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

.guide-flag {
    font-size: 1.5rem;
}

.guide-track {
    flex-grow: 1;
    height: 10px;
    background: #e2e8f0;
    border-radius: 10px;
    position: relative;
    overflow: visible;
}

.guide-line {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    border-radius: 10px;
    width: 0%;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.guide-bike {
    position: absolute;
    top: -14px;
    left: 0%;
    transform: translateX(-50%);
    font-size: 1.4rem;
    transition: left 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 5;
}

/* Guide Text Box */
.guide-body {
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.05);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    min-height: 240px;
    display: flex;
    flex-direction: column;
}

.guide-rule-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 12px;
}

.guide-rule-text {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 15px;
    min-height: 60px;
}

.guide-detail-box {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
    border-top: 1px dashed rgba(15, 23, 42, 0.1);
    padding-top: 15px;
    flex-grow: 1;
    text-align: justify;
}

.guide-detail-box p {
    margin-bottom: 8px;
}
.guide-detail-box p:last-child {
    margin-bottom: 0;
}
.guide-detail-box ul {
    list-style: none;
    padding-left: 12px;
}
.guide-detail-box li {
    position: relative;
    margin-bottom: 4px;
}
.guide-detail-box li::before {
    content: "•";
    color: var(--color-primary);
    position: absolute;
    left: -12px;
}

/* Control Buttons */
.guide-footer-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.ctrl-btn {
    background: #f1f5f9;
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: var(--text-secondary);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.ctrl-play-pause {
    width: 130px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.95rem;
}

.ctrl-btn:hover {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.ctrl-play-pause:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

@media (max-width: 600px) {
    .guide-card {
        padding: 24px 20px;
    }
    .guide-header h2 {
        font-size: 1.3rem;
    }
    .guide-body {
        padding: 20px 15px;
        min-height: 280px;
    }
    .guide-rule-title {
        font-size: 1.1rem;
    }
    .guide-rule-text {
        font-size: 1rem;
    }
    .guide-footer-controls {
        gap: 15px;
    }
}

