/* General Styling */
:root {
    --primary-blue: #00407A;
    --secondary-blue: #002B52;
    --light-grey: #f4f4f9;
    --medium-grey: #e0e0e0;
    --dark-grey: #333;
    --text-color: #444;
    --border-color: #ddd;
    --accent-green: #228B22;
    --accent-red: #b22222;
}

body {
    font-family: 'Open Sans', sans-serif;
    background-color: var(--light-grey);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 20px;
}

h1, h2, h3 {
    font-family: 'Merriweather', serif;
    color: var(--dark-grey);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background-color: #fff;
    padding: 30px 40px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.hidden {
    display: none;
}

/* Header */
header {
    text-align: center;
    border-bottom: 2px solid var(--primary-blue);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.main-logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.logo-icon {
    width: 60px;
    height: 60px;
    background-color: var(--primary-blue);
    border-radius: 50%;
    position: relative;
    margin-right: 15px;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.2);
    border: 2px solid var(--secondary-blue);
}

.logo-icon::before {
    content: 'C';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Merriweather', serif;
    font-weight: bold;
    font-size: 2.2rem;
    color: #fff;
}

.logo-text h1 {
    margin: 0;
    font-size: 1.9rem;
    color: var(--secondary-blue);
    line-height: 1.2;
}

.logo-text .tagline {
    margin: 5px 0 0;
    color: #777;
    font-style: italic;
    font-size: 0.95rem;
}

header nav {
    margin-top: 20px;
    font-size: 0.95rem;
}

header nav a {
    color: var(--primary-blue);
    text-decoration: none;
    margin: 0 12px;
    cursor: pointer;
    transition: color 0.3s ease;
}

header nav a:hover {
    text-decoration: underline;
}

/* Content & Test Box */
.content-box {
    background-color: #fcfcfc;
    border: 1px solid var(--border-color);
    padding: 25px;
    margin-bottom: 35px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.mission-statement h2 {
    color: var(--primary-blue);
    text-align: center;
    margin-bottom: 15px;
}

.test-box {
    border: 1px solid var(--medium-grey);
    padding: 30px;
    border-radius: 6px;
    background-color: #f9f9f9;
}

.test-box h3 {
    margin-top: 0;
    color: var(--secondary-blue);
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.6rem;
}

.test-box label {
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
    color: var(--dark-grey);
}

.test-box input[type="text"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 25px;
    border: 1px solid #b2b2b2;
    box-sizing: border-box;
    font-size: 1.05rem;
    border-radius: 5px;
    background-color: #fff;
}

.test-box fieldset {
    border: 1px dashed var(--primary-blue);
    padding: 20px;
    margin: 30px 0;
    border-radius: 5px;
    background-color: #eef5fb;
}

.test-box fieldset legend {
    font-weight: 600;
    color: var(--dark-grey);
    padding: 0 10px;
    background-color: #eef5fb; /* Match fieldset background */
}

.test-box .options label {
    display: block;
    margin-bottom: 12px;
    font-weight: normal;
    cursor: pointer;
    font-size: 1.05rem;
    color: var(--text-color);
}

.test-box input[type="radio"] {
    margin-right: 8px;
}

.test-box button {
    display: block;
    width: 100%;
    padding: 15px;
    background-color: var(--primary-blue);
    color: #fff;
    border: none;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    border-radius: 5px;
    letter-spacing: 1px;
}

.test-box button:hover {
    background-color: var(--secondary-blue);
}


/* Analysis Section */
.analysis-box {
    text-align: center;
    padding: 60px 20px;
    background-color: #fdfdfd;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.analysis-box h2 {
    color: var(--primary-blue);
    margin-bottom: 30px;
    font-size: 1.8rem;
}

.progress-bar {
    width: 80%;
    height: 35px;
    background-color: var(--medium-grey);
    border: 1px solid #ccc;
    margin: 0 auto 25px;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background-color: var(--primary-blue);
    transition: width 4.5s ease-in-out;
    background-image: linear-gradient(45deg, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
    background-size: 20px 20px;
    animation: progress-bar-stripes 2s linear infinite;
}

@keyframes progress-bar-stripes {
  from { background-position: 20px 0;}
  to { background-position: 0 0;}
}

#analysis-text {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--dark-grey);
    animation: pulse 1.5s infinite alternate;
}

@keyframes pulse {
    0% { opacity: 0.8; }
    100% { opacity: 1; }
}

/* Certificate Section */
.certificate {
    border: 1px solid var(--secondary-blue);
    padding: 4%; /* Use percentage for padding */
    background-color: #fdfdfd;
    text-align: center;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    background-image: linear-gradient(rgba(255,255,255,0.95), rgba(255,255,255,0.95)), url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><text x="0" y="50" font-family="Merriweather" font-size="16" fill="rgba(0,64,122,0.05)" transform="rotate(-30, 25, 75)">C.U.N.T.</text></svg>');
    background-size: 200px 200px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
    aspect-ratio: 210 / 297; /* A4 Portrait Aspect Ratio */
}

/* This class is added temporarily by JS for PDF generation */
body > .certificate.print-quality {
    position: absolute !important;
    top: -9999px !important;
    left: 0 !important;
    width: 1240px !important; /* High-res width for A4 */
    height: 1754px !important; /* High-res height for A4 */
    font-size: 24px; /* Base font size for high-res version */
}

.certificate-header {
    border-bottom: 4px double var(--secondary-blue);
    padding-bottom: 2%;
    margin-bottom: 2%;
}

.cert-logo {
    margin: 0 auto 15px auto;
    width: clamp(40px, 10vw, 70px); /* Responsive logo size */
    height: clamp(40px, 10vw, 70px);
}
.cert-logo::before {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
}

.certificate-header h2 {
    margin: 0;
    font-size: clamp(1rem, 5vw, 2.2rem); /* Responsive font */
}

.cert-issued {
    font-size: clamp(0.6rem, 2.5vw, 1rem);
    color: #555;
    margin-top: 10px;
}

.certificate-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.certificate-body h3 {
    color: var(--primary-blue);
    margin: 2% 0;
    font-size: clamp(0.8rem, 4vw, 1.5rem);
}

.certificate-body p {
    font-size: clamp(0.7rem, 3.5vw, 1.2rem);
    margin: 1.5% 0;
    line-height: 1.5;
}

.certificate-name {
    font-family: 'Merriweather', serif;
    font-size: clamp(1.2rem, 8vw, 2.8rem);
    font-weight: 700;
    color: #333;
    border-bottom: 3px double var(--dark-grey);
    display: inline-block;
    padding: 0 5% 1%;
    margin: 2% auto;
    line-height: 1.2;
}

h2.classification-title { /* Make selector more specific */
    font-family: 'Great Vibes', cursive;
    font-size: clamp(3rem, 20vw, 6rem);
    color: var(--secondary-blue);
    margin: 2% 0;
    line-height: 1;
}

.certificate-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 5%;
    padding: 2% 0;
    border-top: 4px double var(--secondary-blue);
}

.seal {
    width: clamp(70px, 18vw, 120px);
    height: clamp(70px, 18vw, 120px);
    border: 5px double var(--accent-red);
    border-radius: 50%;
    color: var(--accent-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.4rem, 2vw, 0.75rem);
    font-weight: bold;
    text-align: center;
    line-height: 1.3;
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(178,34,34,0.4);
}

.signature-block {
    text-align: center;
    width: clamp(150px, 40vw, 300px);
}

.signature {
    font-family: 'Great Vibes', cursive;
    font-size: clamp(1.5rem, 7vw, 3rem);
    border-bottom: 1px solid var(--dark-grey);
    padding-bottom: 5px;
    margin: 0;
}

.signature-title {
    font-size: clamp(0.6rem, 2.5vw, 1rem);
    margin-top: 8px;
    line-height: 1.4;
    color: #555;
}

.certificate-subsidiary {
    font-size: clamp(0.5rem, 2vw, 0.85rem);
    color: #888;
    text-align: center;
    margin-top: 2%;
    font-style: italic;
}

.action-buttons {
    text-align: center;
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.action-buttons button {
    padding: 15px 30px;
    font-size: 1.15rem;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.action-buttons button:hover {
    transform: translateY(-2px);
}

#share-button {
    background-color: var(--accent-green);
}
#share-button:hover {
    background-color: #1a681a;
}
#download-button {
    background-color: var(--accent-red);
}
#download-button:hover {
    background-color: #8f1b1b;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: #777;
}
footer strong {
    color: var(--dark-grey);
}

/* === STYLES FOR INTERNAL PAGES === */
.page-container {
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.page-container h2 {
    color: var(--primary-blue);
    border-bottom: 2px solid var(--medium-grey);
    padding-bottom: 10px;
    margin-bottom: 25px;
}

.page-container p, .page-container li {
    font-size: 1.05rem;
    color: var(--text-color);
    margin-bottom: 15px;
}

.founders-image {
    width: 100%;
    max-width: 500px;
    display: block;
    margin: 20px auto;
    border: 5px solid #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    filter: grayscale(100%);
}

.research-item {
    margin-bottom: 25px;
    padding-left: 20px;
    border-left: 3px solid var(--primary-blue);
}

.research-item h4 {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
}

.research-item .authors {
    font-style: italic;
    color: #666;
    margin-bottom: 5px;
}

.research-item .journal {
    font-weight: 600;
    color: var(--secondary-blue);
}

.contact-form {
    margin-top: 30px;
}

.contact-form label {
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #b2b2b2;
    box-sizing: border-box;
    font-size: 1rem;
    border-radius: 5px;
    font-family: 'Open Sans', sans-serif;
}

.contact-form textarea {
    min-height: 150px;
    resize: vertical;
}

.contact-form button {
    padding: 15px 30px;
    background-color: var(--primary-blue);
    color: #fff;
    border: none;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.contact-form button:hover {
    background-color: var(--secondary-blue);
}

.disclaimer {
    font-style: italic;
    color: #888;
    font-size: 0.9rem;
    text-align: center;
    margin-top: 30px;
}

/* === STYLES FOR HTML FLOWCHART === */
.flowchart {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 40px auto;
    font-family: 'Open Sans', sans-serif;
}

.flowchart-box {
    background-color: #fff;
    border: 2px solid var(--primary-blue);
    padding: 15px 25px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    color: var(--secondary-blue);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    width: 80%;
    max-width: 400px;
}

.flowchart-box.start-end {
    border-radius: 30px; /* Pill shape for start/end */
    background-color: var(--secondary-blue);
    color: #fff;
    border-color: #001a33;
}

.flowchart-arrow {
    font-size: 2.5rem;
    color: var(--primary-blue);
    margin: 10px 0;
    font-weight: bold;
}


/* Mobile Responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    .main-logo-area {
        flex-direction: column;
        text-align: center;
    }
    .logo-icon {
        margin-right: 0;
        margin-bottom: 10px;
    }
    .logo-text h1 {
        font-size: 1.5rem;
    }
    .logo-text .tagline {
        font-size: 0.85rem;
    }
    .certificate-footer {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }
    .signature-block {
        width: 100%;
        margin-top: 20px;
    }
    
    .certificate-name {
        font-size: 1.8rem;
        padding: 0 15px 5px 15px;
    }
    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }
    .action-buttons button {
        width: 100%;
    }
    .test-box h3 {
        font-size: 1.4rem;
    }
}