/* ============================================================
   CERTIFICATE GENERATOR - ENTERPRISE GOKUL STYLE
   Theme: Maroon, Orange & Gold
   ============================================================ */

/* Import Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@700&family=Montserrat:wght@400;600;700&family=Great+Vibes&family=Roboto+Slab:wght@400;700&display=swap');

:root {
    /* Theme Colors (Gokul Style) */
    --primary-color: #8B0000;   /* Maroon/Deep Red */
    --accent-color: #E65100;    /* Orange Ribbon */
    --navy-blue: #002b49;       /* Official Blue */
    --gold-light: #fceeb5;
    --gold-dark: #b88a4d;
    
    /* UI Colors */
    --bg-light: #f4f7f6;
    --white: #ffffff;
    --border-color: #ddd;
}

body {
    background-color: var(--bg-light);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    color: #333;
}

/* --- Layout Containers --- */
.erp-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 20px;
    background: var(--white);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-radius: 10px;
}

.erp-header {
    background: linear-gradient(135deg, var(--navy-blue) 0%, #004d99 100%);
    color: var(--white);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 0 10px 10px;
    margin-bottom: 30px;
    border-bottom: 4px solid var(--primary-color);
}

.erp-header h1 { 
    margin: 0; font-family: 'Cinzel', serif; letter-spacing: 1px; 
}

/* --- Form Sections --- */
.form-section {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
}

.form-section h2 {
    margin-top: 0;
    color: var(--primary-color);
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    text-transform: uppercase;
}

/* Responsive Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    align-items: end;
}

.full-width { grid-column: 1 / -1; }

/* --- Inputs --- */
label { display: block; font-weight: 600; color: #555; margin-bottom: 8px; font-size: 0.9rem; }

input[type="text"], input[type="date"], select, textarea, input[type="file"] {
    width: 100%; padding: 10px;
    border: 1px solid #ccc; border-radius: 4px;
    font-size: 14px; font-family: 'Montserrat', sans-serif;
    box-sizing: border-box; transition: border 0.3s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary-color); outline: none;
    box-shadow: 0 0 0 2px rgba(139, 0, 0, 0.1);
}

/* --- PREVIEW BOX (The Certificate) --- */
.preview-box {
    width: 100%; min-height: 700px;
    background-color: #fff;
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; color: #333; margin: 0 auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    
    /* Gokul Style Double Border */
    border: 8px solid var(--primary-color);
    outline: 2px solid var(--accent-color);
    outline-offset: -12px;
}

.preview-box.landscape { width: 100%; max-width: 1050px; height: 700px; }
.preview-box.portrait { width: 700px; height: 950px; }

/* Background Pattern */
.preview-box::before {
    content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: radial-gradient(circle at center, transparent 30%, rgba(255, 240, 230, 0.5) 100%);
    pointer-events: none; z-index: 0;
}

/* --- TYPOGRAPHY (Preview) --- */

/* Title */
.preview-box h1 { 
    font-family: 'Cinzel', serif; 
    font-size: 4rem; 
    font-weight: 700;
    margin: 40px 0 10px 0; 
    text-transform: uppercase;
    color: var(--primary-color); /* Maroon */
    letter-spacing: 2px;
    z-index: 1;
}

/* Ribbon Subtitle */
.prev-subtitle { 
    background-color: var(--accent-color); /* Orange */
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem; 
    font-weight: bold;
    letter-spacing: 3px; 
    text-transform: uppercase; 
    padding: 8px 40px;
    display: inline-block;
    margin-bottom: 30px;
    z-index: 1;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Student Name */
.student-script { 
    font-family: 'Roboto Slab', serif; /* Matching PDF Times Bold look */
    font-size: 3.5rem; 
    font-weight: 700;
    margin: 15px 0 25px 0; 
    color: var(--primary-color);
    text-transform: uppercase;
    z-index: 1;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.1);
}

/* Body Text */
.preview-box p#prev-body {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    line-height: 1.6;
    max-width: 80%;
    margin: 0 auto;
    color: #333;
    z-index: 1;
}

/* --- FOOTER ELEMENTS --- */
.signatures { 
    width: 85%; display: flex; justify-content: space-between; align-items: flex-end; 
    margin-top: 50px; z-index: 1; 
}

.sig-block { text-align: center; width: 220px; }
.sig-line { border-top: 2px solid #333; margin: 5px 0; }
.sig-block span { 
    font-family: 'Cinzel', serif; 
    font-weight: 700; 
    color: var(--primary-color); 
    font-size: 0.9rem; 
}

/* Gold Seal */
.gold-seal {
    width: 120px; height: 120px;
    background: radial-gradient(circle, var(--gold-light) 0%, var(--gold-dark) 100%);
    border-radius: 50%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: white; font-family: 'Cinzel', serif; font-size: 10px; font-weight: bold;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3); border: 3px double #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    margin-bottom: 15px;
}

/* QR Placeholder */
.qr-placeholder { font-size: 40px; color: #555; }

/* --- BUTTONS --- */
.action-buttons {
    display: flex; gap: 15px; justify-content: flex-end;
    margin-top: 20px; padding: 20px;
    background: #fff; border-top: 1px solid #eee;
}

.primary-btn { 
    background-color: var(--primary-color); 
    color: white; border: none; padding: 12px 30px; 
    border-radius: 5px; font-weight: bold; cursor: pointer;
    font-size: 1rem;
}
.primary-btn:hover { background-color: #600000; }

.secondary-btn { 
    background-color: white; color: #333; 
    border: 1px solid #ccc; padding: 12px 25px; 
    border-radius: 5px; font-weight: bold; cursor: pointer;
}
.secondary-btn:hover { background-color: #f0f0f0; }

/* --- MODAL --- */
.modal-overlay { 
    display: none; position: fixed; z-index: 2000; 
    left: 0; top: 0; width: 100%; height: 100%; 
    background-color: rgba(0,0,0,0.9); backdrop-filter: blur(5px); 
    overflow: auto; 
}
.modal-content-wrapper { 
    position: relative; margin: 2% auto; padding: 0; 
    width: 95%; max-width: 1100px; 
    animation: zoomIn 0.3s; 
}
.close-modal-btn { 
    position: absolute; right: 20px; top: 10px; 
    color: #fff; font-size: 40px; font-weight: bold; 
    cursor: pointer; 
}

@keyframes zoomIn { from {transform: scale(0.9); opacity: 0;} to {transform: scale(1); opacity: 1;} }