:root {
    /* --- THEME COLORS (Light/Blue Theme) --- */
    --primary-color: #007bff;      
    --accent-color: #00ffcc;       /* Cyan Text & Buttons */
    --container-bg: #ffffff;       /* White Card */
    --text-color: #2d3436;         /* Dark Text */
    --text-muted: #636e72;
    --border-color: #dfe6e9;
    --input-bg: #f8f9fa;           /* Light Gray Input */
    --error-color: #ff5555;
    
    /* --- TREE NODES --- */
    --node-fill: #ffffff;
    --node-border: #007bff;
    --node-text: #2d3436;
    --link-stroke: #b2bec3;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    /* Blue Gradient Background */
    background: linear-gradient(135deg, #007bff 0%, #00c6ff 100%);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden; 
}

/* =========================================
   HEADER STYLES
   ========================================= */
header {
    width: 100%;
    background: transparent; 
    padding: 20px 4%;
    
    /* CSS Grid for Perfect Centering */
    display: grid;
    /* 1fr (Left) - Auto (Center) - 1fr (Right) */
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    z-index: 10;
}

.header-col {
    display: flex;
    align-items: center;
}

.logo-left { justify-content: flex-start; }
.logo-right { justify-content: flex-end; }

.header-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    white-space: nowrap; 
}

.header-title h1 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    margin-bottom: 5px;
    font-weight: 800;
    color: var(--accent-color); 
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.1;
}

.header-title p {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
}

/* --- LOGO IMAGES --- */
.logo-img {
    height: auto;
    width: auto;
    object-fit: contain;
    /* 'Screen' blend mode removes black backgrounds from logos */
    mix-blend-mode: screen; 
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
}

/* Specific Sizes to match the reference image */
.logo-left .logo-img {
    max-height: 150px; /* Sili Logo Size */
    min-width: 100px;
}

.logo-right .logo-img {
    max-height: 60px; /* CIT Logo Size */
}

/* =========================================
   MAIN CARD CONTAINER
   ========================================= */
.main-container {
    background: var(--container-bg);
    width: 90%;
    max-width: 1000px;
    margin: 20px auto 40px auto;
    border-radius: 20px;
    /* Cyan Glow Shadow around the white card */
    box-shadow: 0 10px 40px rgba(0, 255, 204, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.controls-section {
    padding: 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 25px;
    align-items: center;
}

/* --- INPUT --- */
.input-group {
    width: 100%;
    max-width: 600px;
    position: relative;
}

input[type="text"] {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.1rem;
    background-color: var(--input-bg);
    color: var(--text-color);
    border: 2px solid transparent;
    border-radius: 12px;
    outline: none;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

input[type="text"]:focus {
    background-color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.15);
}

/* --- RADIO OPTIONS --- */
.options-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    background: transparent;
    padding: 8px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1rem;
    color: #555;
    font-weight: 600;
    padding: 8px 16px;
    transition: background 0.2s;
}

.radio-label input {
    margin-right: 8px;
    cursor: pointer;
    accent-color: var(--primary-color);
    width: 18px;
    height: 18px;
}

/* --- BUTTONS --- */
.action-buttons {
    display: flex;
    gap: 15px;
    width: 100%;
    max-width: 400px;
    justify-content: center;
}

.btn {
    padding: 14px 30px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    flex: 1;
    white-space: nowrap;
}

.btn.primary {
    background-color: var(--accent-color); /* Cyan */
    color: #004d40; /* Dark Greenish Text */
}

.btn.primary:hover {
    background-color: #00e6b8;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 255, 204, 0.4);
}

.btn.primary:active {
    transform: translateY(0);
}

.btn.secondary {
    background-color: white;
    border: 1px solid #dfe6e9;
    color: #636e72;
}

.btn.secondary:hover {
    background-color: #f8f9fa;
    border-color: #b2bec3;
    color: #2d3436;
}

.error-msg {
    color: var(--error-color);
    font-weight: 600;
    margin-top: -10px;
    text-align: center;
    background: rgba(255, 85, 85, 0.1);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.hidden { display: none; }

/* --- CANVAS AREA --- */
.canvas-wrapper {
    flex: 1;
    overflow: auto;
    background-color: #ffffff;
    padding: 20px;
    display: flex;
    justify-content: center;
    min-height: 500px;
    /* Dotted Pattern */
    background-image: radial-gradient(#dee2e6 1.5px, transparent 1.5px);
    background-size: 25px 25px;
    -webkit-overflow-scrolling: touch; 
}

/* SVG Elements */
svg { 
    display: block; 
    min-width: 100%;
}

.link {
    fill: none;
    stroke: var(--link-stroke);
    stroke-width: 2px;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.link.visible { opacity: 1; }

.node {
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
    transform: scale(0);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.node.visible { opacity: 1; transform: scale(1); }

.node circle {
    fill: var(--node-fill);
    stroke: var(--node-border);
    stroke-width: 2.5px;
    cursor: default;
    transition: 0.3s;
}
.node:hover circle {
    fill: var(--accent-color);
    stroke: #004d40;
}
.node text {
    font-size: 14px;
    font-weight: 700;
    fill: var(--node-text);
    user-select: none;
    text-anchor: middle;
    dominant-baseline: middle;
}

/* =========================================
   PARTNERS SECTION
   ========================================= */
.partners-section {
    background: #ffffff; /* White background matching main card */
    color: #000;
    padding: 60px 40px;
    border-radius: 20px;
    margin: 40px auto;
    width: 90%;
    max-width: 1000px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.partners-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 30px;
}

.logos {
    flex: 1 1 50%;
    text-align: center;
}

.logos img {
    width: 100%;
    max-width: 450px;
    height: auto;
    border-radius: 10px;
}

.text {
    flex: 1 1 40%;
}

.text h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #2d3436;
}

.text p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #636e72;
}

section {
    display: block;
    unicode-bidi: isolate;
}

/* =========================================
   RESPONSIVE MEDIA QUERIES
   ========================================= */

/* Mobile Devices (Portrait) */
@media (max-width: 768px) {
    header {
        /* Switch to Flex Column for stacking on mobile */
        display: flex;
        flex-direction: column;
        padding: 20px 10px;
        gap: 15px;
    }

    /* Reset grid logic for mobile */
    .header-col { width: 100%; justify-content: center !important; }
    
    .header-title { 
        order: 2; 
        margin: 5px 0; 
        white-space: normal; /* Allow title to wrap on mobile */
    }
    .logo-left { order: 1; }
    .logo-right { order: 3; }

    /* Adjust logo sizes for mobile */
    .logo-left .logo-img { max-height: 90px; }
    .logo-right .logo-img { max-height: 60px; }

    .controls-section { padding: 20px 15px; }

    .action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .partners-container {
        flex-direction: column;
        text-align: center;
    }
    
    .text { text-align: center; }
}
.footer {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #007bff 0%, #00c6ff 100%);
    color: var(--text-color);
    margin-top: 50px;
}
div {
    display: block;
    unicode-bidi: isolate;
}