/* ==============================================================
   THE GRAND PRESTIGE - V14 (MATRIX CIPHER EDITION)
   FIXED: Overlay structure, matrix rain, status text, particles
============================================================== */

/* --- 1. GLASSMORPHISM & SEAMLESS INTEGRATION --- */
.cert-page-glass {
    min-height: 100vh;
    width: 100%;
    background: transparent; 
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 120px 20px 80px 20px;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
}

.glass-container {
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
}

/* --- 2. HEADER & INPUT --- */
.cert-header { text-align: center; margin-bottom: 40px; }
.cert-title { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 900; color: #fff; letter-spacing: 2px; margin: 0; }
.text-glow-purple { color: #e0aaff; text-shadow: 0 0 20px rgba(160,32,240,0.8); }
.cert-subtitle { color: #bbb; font-size: 1.1rem; margin-top: 10px; }

.claim-interface { width: 100%; max-width: 800px; margin-bottom: 40px; }

.input-glass-box {
    display: flex; gap: 15px; 
    background: rgba(20, 10, 30, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 15px; border-radius: 20px; 
    border: 1px solid rgba(160, 32, 240, 0.3);
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
}

#input-credential {
    flex: 1; background: transparent; border: none; color: #fff;
    padding: 0 20px; font-size: 1.1rem; outline: none; min-width: 0;
    font-family: inherit;
}
#input-credential::placeholder { color: rgba(255,255,255,0.4); }

/* --- 3. BUTTONS --- */
.btn-invoke, .btn-portal {
    all: unset;
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important; 
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.btn-invoke {
    background: #150523; border: 2px solid #a020f0; color: #e0aaff;
    height: 55px; padding: 0 30px; border-radius: 14px; 
    font-weight: 800; font-family: inherit; font-size: 1rem;
}
.btn-invoke:hover { background: #a020f0; color: #fff; box-shadow: 0 0 20px #a020f0; transform: translateY(-2px); }

.btn-portal {
    background: rgba(160, 32, 240, 0.15); border: 1px solid #a020f0; color: #fff;
    height: 50px; padding: 0 25px; border-radius: 10px; 
    font-weight: 700; font-family: inherit; font-size: 0.95rem;
    backdrop-filter: blur(5px);
}
.btn-portal:hover { background: #a020f0; box-shadow: 0 0 15px rgba(160,32,240,0.6); }

.btn-invoke i, .btn-portal i, .error-spell i, .material-icons {
    font-family: 'Material Icons' !important;
    font-weight: normal; font-style: normal;
    font-size: 24px; line-height: 1;
    letter-spacing: normal; text-transform: none; display: block;
    -webkit-font-feature-settings: 'liga';
}

.btn-invoke span, .btn-portal span { display: block; line-height: 1; padding-top: 2px; }

/* --- 4. PREMIUM CERTIFICATE CANVAS 16:9 --- */
.cert-display-container { width: 100%; display: flex; flex-direction: column; align-items: center; }
.canvas-shrine { width: 100%; max-width: 1000px; overflow-x: auto; padding-bottom: 20px; }

.premium-cert-16-9 {
    width: 1000px; min-width: 1000px; 
    aspect-ratio: 16 / 9; 
    background-color: #fdfbf7; 
    background-image: radial-gradient(#e5dfd3 1px, transparent 1px); 
    background-size: 20px 20px;
    position: relative; box-shadow: 0 25px 60px rgba(0,0,0,0.8); 
    margin: 0 auto; padding: 20px; box-sizing: border-box;
    overflow: hidden;
}

.cert-watermark {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 350px; opacity: 0.04; pointer-events: none;
}

.premium-outer-border {
    border: 3px solid #1a1a1a;
    height: 100%; padding: 6px; box-sizing: border-box;
}

.premium-inner-border {
    border: 1px solid #1a1a1a;
    height: 100%; 
    display: flex; flex-direction: column; align-items: center; justify-content: space-between;
    padding: 25px 40px; box-sizing: border-box; position: relative;
    background: rgba(253, 251, 247, 0.85); 
}

.cert-top-section { text-align: center; margin-bottom: 5px; }
.cert-logo-official { width: 45px; margin-bottom: 5px; }
.cert-org-name { font-family: 'Arial', sans-serif; font-size: 0.8rem; letter-spacing: 4px; color: #555; margin: 0; font-weight: bold; }

.cert-title-serif { 
    font-family: 'Times New Roman', Times, serif; 
    font-size: 2.3rem; font-weight: 900; letter-spacing: 5px; 
    color: #111; margin: 0; text-align: center;
    border-bottom: 2px solid #a020f0; padding-bottom: 8px;
}

.cert-body-section { 
    text-align: center; flex-grow: 1; display: flex; 
    flex-direction: column; justify-content: center; align-items: center; 
}

.award-text { font-family: 'Arial', sans-serif; font-size: 0.95rem; color: #555; letter-spacing: 1px; margin-bottom: 5px; }

.participant-name-elegant {
    font-family: 'Georgia', serif; font-size: 2.5rem; font-style: italic; font-weight: bold;
    color: #000; margin: 5px 0; text-transform: uppercase; line-height: 1.1; padding: 0 20px;
}

.reason-text { font-family: 'Arial', sans-serif; font-size: 0.9rem; color: #555; margin: 5px 0; }
.ev-name-bold { font-family: 'Times New Roman', serif; font-size: 1.4rem; font-weight: bold; color: #000; margin: 0; }
.ev-theme-elegant { font-family: 'Georgia', serif; font-style: italic; font-size: 1rem; color: #a020f0; margin: 4px 0 8px 0; }
.ev-date-place { font-family: 'Arial', sans-serif; font-size: 0.85rem; color: #666; font-weight: 600; margin: 0; }

.signature-grid {
    width: 100%; display: flex; justify-content: space-between; 
    padding: 0 40px; margin-top: auto; margin-bottom: 10px; box-sizing: border-box;
}

.sig-column { width: 220px; display: flex; flex-direction: column; align-items: center; }
.sig-img-wrapper { height: 55px; display: flex; align-items: flex-end; justify-content: center; margin-bottom: 5px; }
.sig-image { max-height: 100%; max-width: 100%; object-fit: contain; }
.sig-divider { width: 100%; border-top: 1px solid #000; margin-bottom: 5px; }
.sig-name-bold { font-family: 'Arial', sans-serif; font-size: 0.9rem; font-weight: bold; color: #000; margin: 0; }
.sig-title-sub { font-family: 'Arial', sans-serif; font-size: 0.75rem; color: #666; margin: 2px 0 0 0; }

.cert-verify-id {
    position: absolute; bottom: 10px; left: 15px;
    font-family: 'Courier New', Courier, monospace; font-size: 0.7rem; color: #888; font-weight: bold;
}

/* --- 5. UTILITIES --- */
.action-portal { display: flex; gap: 20px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }
.hidden { display: none !important; }
.error-spell { 
    color: #ff3366; margin-top: 15px; font-weight: bold; 
    display: flex; align-items: center; gap: 8px; justify-content: center; 
    background: rgba(255, 51, 102, 0.1); padding: 10px 20px; border-radius: 10px; 
}

/* --- 6. GLITCH OVERLAY — MATRIX CIPHER EDITION --- */
.glitch-wrapper {
    position: fixed;
    inset: 0;
    background: rgba(2, 0, 10, 0.97);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Matrix rain canvas — diinject JS */
#matrix-rain-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0.2;
    pointer-events: none;
    z-index: 1;
}

/* Glitch content — teks utama di tengah */
.glitch-content {
    position: relative;
    z-index: 5;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.glitch-text {
    color: #fff;
    font-size: clamp(1.5rem, 5vw, 3.5rem);
    font-weight: 900;
    position: relative;
    letter-spacing: 10px;
    font-family: monospace;
    animation: g-skew 0.8s infinite linear alternate-reverse;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

.glitch-text::before {
    left: 3px;
    text-shadow: -2px 0 #ff00c1;
    clip: rect(44px, 9999px, 56px, 0);
    animation: g-anim 2s infinite linear;
}

.glitch-text::after {
    left: -3px;
    text-shadow: -2px 0 #00fff9;
    clip: rect(10px, 9999px, 30px, 0);
    animation: g-anim2 1.5s infinite linear;
}

.glitch-sub {
    color: #a020f0;
    font-family: monospace;
    margin-top: 20px;
    letter-spacing: 5px;
    font-weight: bold;
    font-size: clamp(0.7rem, 2vw, 1rem);
}

/* Floating rune particles — fullscreen */
.glitch-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    overflow: hidden;
}

/* Status text cycling */
.matrix-status {
    position: absolute;
    bottom: 12%;
    left: 50%;
    transform: translateX(-50%);
    color: #c084fc;
    font-family: 'Courier New', monospace;
    font-size: clamp(0.7rem, 1.5vw, 0.9rem);
    font-weight: bold;
    letter-spacing: 3px;
    text-shadow: 0 0 10px #a020f0, 0 0 20px rgba(160,32,240,0.4);
    transition: opacity 0.15s ease;
    z-index: 10;
    white-space: nowrap;
}

/* Scanlines overlay */
.glitch-scanlines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 6;
    background: 
        linear-gradient(rgba(18,16,16,0) 50%, rgba(0,0,0,0.15) 50%),
        linear-gradient(90deg, rgba(255,0,0,0.03), rgba(0,255,0,0.01), rgba(0,0,255,0.03));
    background-size: 100% 4px, 3px 100%;
}

/* --- 7. KEYFRAMES --- */
@keyframes g-anim {
    0%   { clip: rect(10px, 999px, 40px, 0); }
    100% { clip: rect(80px, 999px, 20px, 0); }
}

@keyframes g-anim2 {
    0%   { clip: rect(70px, 999px, 30px, 0); }
    100% { clip: rect(10px, 999px, 60px, 0); }
}

@keyframes g-skew {
    0%   { transform: skew(3deg); }
    100% { transform: skew(-3deg); }
}