/* --- Global Styles & Variables --- */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&family=Roboto+Condensed:wght@700&display=swap');

:root {
    --primary-color: #005191; /* PANTONE 287 */
    --secondary-color: #539ED0; /* PANTONE 659 */
    --accent-red: #FF443B; /* PANTONE 179 */
    --accent-yellow: #FFB351; /* PANTONE 143 */
    --accent-orange: #F57814; /* PANTONE 152 */
    --background-color: #f4f7f9;
    --container-bg: #ffffff;
    --text-color: #333;
    --border-color: #e0e0e0;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    --border-radius: 8px;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
}

/* --- Header & Logo --- */
.header {
    background-color: var(--container-bg);
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between; /* Adjusted for nav */
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo img {
    height: 100px;
}

/* --- Navigation --- */
nav {
    display: flex;
    gap: 20px;
}

nav a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 16px;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--secondary-color);
}


/* --- Main Layout --- */
.main-container {
    display: flex;
    gap: 30px;
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.content-column {
    background-color: var(--container-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 25px;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.column-title {
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 700;
    font-size: 22px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 20px;
}

/* --- Input & Buttons --- */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* margin-top: auto; Pushes inputs to the bottom */
}

.input-group input[type="email"],
.input-group input[type="text"] {
    padding: 12px;
    font-size: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 81, 145, 0.2);
}

button {
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 700;
    color: white;
    background-color: var(--primary-color);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

button:hover:not(:disabled) {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

button:disabled {
    background-color: #a0a0a0;
    cursor: not-allowed;
}

/* --- Story Search & Spotlight Styles --- */
#search-results ul {
    list-style-type: none;
    padding: 0;
}

#search-results li {
    background-color: #f9f9f9;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 15px;
}

#spotlight-story-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.spotlight-story-item {
    background-color: var(--secondary-color);
    color: white;
    padding: 25px;
    border-radius: var(--border-radius);
    text-align: center;
}

.spotlight-story-item h3 {
    margin-top: 0;
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 700;
}

.spotlight-story-item a {
    color: #a9d6ff;
    text-decoration: none;
    font-weight: bold;
}

/* --- Custom Dropdown Styles --- */
.custom-select-container {
    position: relative;
    width: 100%;
    margin-bottom: 0;
    font-family: 'Roboto', sans-serif;
}

.custom-select-trigger {
    padding: 12px;
    font-size: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: #fff;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #333;
    min-height: 47px; /* Match height of other inputs */
    box-sizing: border-box;
}

.custom-select-trigger:after {
    content: '';
    width: 0; 
    height: 0; 
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #666;
    margin-left: 10px;
}

.custom-select-container.open .custom-select-trigger {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 81, 145, 0.2);
}

.custom-options-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 100;
    max-height: 350px;
    overflow-y: auto;
    margin-top: 5px;
    display: block;
}

.custom-options-container.hidden {
    display: none;
}

/* Tree View Styles */
.tree-group {
    margin-left: 0;
}

.tree-group-header {
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 500;
    color: #333;
    background-color: #f9f9f9;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
    border-bottom: 1px solid #f0f0f0;
}
.tree-group-header:hover {
    background-color: #f0f0f0;
}

/* Caret icon for groups */
.tree-caret {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid #666;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transition: transform 0.2s ease;
}
.tree-group.expanded > .tree-group-header .tree-caret {
    transform: rotate(90deg);
}

/* Children container */
.tree-children {
    display: none;
    padding-left: 15px; /* Indentation */
    background-color: #fff;
}
.tree-group.expanded > .tree-children {
    display: block;
}

/* Nested Groups (Level 2+) */
.tree-children .tree-group-header {
    background-color: #fff; /* White background for nested headers */
    font-weight: 500;
    font-size: 0.95em;
    color: #555;
}

/* Leaf Options (Default) */
.tree-option {
    padding: 8px 12px;
    cursor: pointer;
    color: #444;
    transition: background 0.2s;
    display: block;
}
.tree-option:hover {
    background-color: #e6f2ff;
    color: var(--primary-color);
}
.tree-option.selected {
    background-color: var(--primary-color);
    color: #fff;
}

/* Indentation specific classes */
.tree-option.parent {
    font-weight: 700;
    color: #333;
}
.tree-option.child {
    padding-left: 32px; /* Visual indentation without using characters */
    color: #555;
}


/* --- Responsive Design --- */
@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
        padding: 20px;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    .main-container {
        padding: 15px;
    }
    .content-column {
        padding: 20px;
    }
}