* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    text-align: center;
    padding: 60px 0;
    background-color: #4a6fa5;
    color: white;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

/* Introduction Section */
.intro {
    margin-bottom: 50px;
}

.intro h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #4a6fa5;
}

.steps {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
}

.step {
    flex: 1;
    min-width: 250px;
    display: flex;
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.step-number {
    width: 40px;
    height: 40px;
    background-color: #4a6fa5;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    margin-right: 15px;
}

.step-content h3 {
    margin-bottom: 10px;
    color: #4a6fa5;
}

/* Research Form */
.research-form {
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 50px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.research-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #4a6fa5;
}

.form-group {
    margin-bottom: 20px;
}

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

textarea,
input,
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.parameters-section {
    margin: 30px 0;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
}

.parameters-section h3 {
    background-color: #f5f5f5;
    padding: 15px;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toggle-button {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #4a6fa5;
    padding: 5px;
}

.parameter-group {
    padding: 20px;
}

.parameter-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.parameter-input input[type="range"] {
    flex: 1;
}

.parameter-description {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

.form-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 30px;
}

button {
    background-color: #4a6fa5;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #3a5a8c;
}

#loading-indicator {
    display: none;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
}

#loading-indicator.active {
    display: flex;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid #4a6fa5;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Results Section */
#results-section {
    margin-bottom: 50px;
}

.results-container {
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.results-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #4a6fa5;
}

.tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.tab-button {
    background: none;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    border-bottom: 3px solid transparent;
}

.tab-button.active {
    color: #4a6fa5;
    border-bottom-color: #4a6fa5;
}

.tab-pane {
    display: none;
    padding: 20px 0;
}

.tab-pane.active {
    display: block;
}

#answer-content {
    line-height: 1.6;
    color: #333;
}

/* Title styling */
#answer-content .title {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #eaeaea;
}

/* Section headings */
#answer-content .section-heading {
    font-size: 1.5rem;
    color: #3a5a8c;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #eaeaea;
}

/* Subsection headings */
#answer-content .subsection-heading {
    font-size: 1.25rem;
    color: #4a6fa5;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

/* Content sections */
#answer-content .content-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Different section types */
#answer-content .content-section[data-type="technology"] {
    border-left: 4px solid #3498db;
}

#answer-content .content-section[data-type="limitation"] {
    border-left: 4px solid #e74c3c;
}

#answer-content .content-section[data-type="benefit"] {
    border-left: 4px solid #2ecc71;
}

#answer-content .content-section[data-type="comparison"] {
    border-left: 4px solid #f39c12;
}

/* Body text */
#answer-content .body-text {
    margin-bottom: 1rem;
    font-size: 1rem;
}

/* Keyword highlighting */
#answer-content .keyword {
    background-color: #f8f9fa;
    color: #2c3e50;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-weight: 500;
    border-bottom: 1px dashed #3498db;
}

/* Bullet lists */
#answer-content .bullet-list {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

#answer-content .bullet-list li {
    margin-bottom: 0.5rem;
}

/* Quotes */
#answer-content .quote {
    font-style: italic;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid #3498db;
    background-color: #f8f9fa;
}

/* Example boxes */
#answer-content .example-box {
    background-color: #f5f9ff;
    border: 1px solid #d1e1fd;
    border-radius: 6px;
    padding: 1rem;
    margin: 1.5rem 0;
}

#answer-content .example-box p {
    margin-bottom: 0.5rem;
}

/* Sources section */
#answer-content .sources {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 2px solid #eaeaea;
}

#answer-content .sources h2 {
    font-size: 1.25rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

#answer-content .sources ol {
    margin-left: 1.5rem;
}

#answer-content .sources li {
    margin-bottom: 0.5rem;
}

#tree-visualization {
    width: 100%;
    height: 90vh;
    min-height: 800px;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: auto;
    background-color: #fafafa;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin: 10px 0;
}

#tree-visualization:hover {
    border-color: #4a6fa5;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

/* Optimize the tree visualization content */
#tree-visualization .node {
    margin: 12px 0;
    padding: 16px;
}

#tree-visualization .children {
    margin-left: 35px;
    padding-left: 20px;
}

#tree-visualization .node-title {
    font-size: 1.05rem;
    line-height: 1.4;
}

/* Add responsive adjustments */
@media (max-width: 768px) {
    #tree-visualization {
        height: 80vh;
        min-height: 600px;
        padding: 20px;
    }

    #tree-visualization .children {
        margin-left: 20px;
        padding-left: 12px;
    }
}

/* Utility Classes */
.hidden {
    display: none;
}

footer {
    text-align: center;
    padding: 30px 0;
    color: #666;
    border-top: 1px solid #ddd;
}

#environment-tag {
    margin-top: 10px;
    font-weight: bold;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .steps {
        flex-direction: column;
    }

    .step {
        width: 100%;
    }

    header {
        padding: 40px 0;
    }

    header h1 {
        font-size: 2rem;
    }

    .tabs {
        flex-direction: column;
        border-bottom: none;
    }

    .tab-button {
        border-bottom: 1px solid #ddd;
        text-align: left;
    }

    .tab-button.active {
        border-left: 3px solid #4a6fa5;
        border-bottom-color: #ddd;
    }
}

/* Error notifications */
.error-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #fff;
    border-left: 4px solid #f5222d;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    border-radius: 4px;
    z-index: 1100;
    max-width: 400px;
    transform: translateX(120%);
    transition: transform 0.3s ease;
}

.error-notification.active {
    transform: translateX(0);
}

.error-icon {
    color: #f5222d;
    font-size: 20px;
    margin-right: 15px;
}

.error-message {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.error-close {
    background: none;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
    transition: color 0.2s;
}

.error-close:hover {
    color: #333;
}

/* Responsive styles for error notifications */
@media (max-width: 768px) {
    .error-notification {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}

/* Share functionality */
.share-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-bottom: 20px;
}

.share-button {
    background-color: #4a6fa5;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.share-button:hover {
    background-color: #3a5a8c;
}

.share-options {
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-top: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
}

.share-link-container {
    display: flex;
    margin-bottom: 15px;
}

.share-link-container input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 0.9rem;
}

.share-link-container button {
    background-color: #4a6fa5;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 0.9rem;
}

.social-share-buttons {
    display: flex;
    gap: 10px;
}

.social-share-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
}

.social-share-button.twitter {
    background-color: #1DA1F2;
}

.social-share-button.facebook {
    background-color: #4267B2;
}

.social-share-button.linkedin {
    background-color: #0077B5;
}

.social-share-button:hover {
    opacity: 0.9;
}

/* Toast notification for copy success */
.toast-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #4CAF50;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.toast-notification.active {
    transform: translateX(-50%) translateY(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .social-share-buttons {
        flex-direction: column;
    }
}

/* Mobile Disclaimer */
.mobile-disclaimer {
    display: none;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 12px 20px;
    text-align: center;
    font-size: 0.9rem;
    margin: 10px 20px;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .mobile-disclaimer {
        display: block;
    }
}

/* Tree Visualization Styles */
.tree-metadata {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.metadata-item {
    display: inline-block;
    font-size: 0.9em;
}

.metadata-label {
    font-weight: 600;
    color: #666;
    margin-right: 5px;
}

.metadata-value {
    font-weight: 400;
    color: #333;
}

.tree-container {
    margin: 20px 0;
}

.node {
    margin: 10px 0;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.question-node {
    background-color: #f5f8ff;
    border-left: 4px solid #4a6fa5;
}

.question-node[data-depth="0"] {
    border-left-color: #2c3e50;
    background-color: #ecf0f1;
    margin-bottom: 20px;
}

.question-node[data-depth="1"] {
    border-left-color: #3498db;
    background-color: #e8f4fc;
    margin-left: 0;
    margin-bottom: 15px;
}

.question-node[data-depth="2"] {
    border-left-color: #9b59b6;
    background-color: #f5eef8;
}

.answer-node {
    background-color: #f5fff8;
    border-left: 4px solid #4caf50;
    padding: 15px;
    display: none;
    margin-top: 5px;
}

.node-header {
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background-color 0.2s;
}

.node-header:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.node-title {
    font-weight: 500;
    flex-grow: 1;
}

.depth-indicator {
    color: #666;
    font-size: 0.8em;
    margin-right: 10px;
    background-color: rgba(0, 0, 0, 0.05);
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.question-node[data-depth="0"] .depth-indicator {
    background-color: #2c3e50;
    color: white;
}

.question-node[data-depth="1"] .depth-indicator {
    background-color: #3498db;
    color: white;
}

.question-node[data-depth="2"] .depth-indicator {
    background-color: #9b59b6;
    color: white;
}

.toggle-icon {
    font-size: 18px;
    width: 24px;
    height: 24px;
    text-align: center;
    line-height: 24px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    margin-left: 10px;
}

.children {
    position: relative;
    display: none;
    padding-left: 30px;
    border-left: 1px dashed rgba(0, 0, 0, 0.1);
    margin-left: 10px;
}

.children::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-left: 1px dashed rgba(0, 0, 0, 0.1);
}

.expanded>.children,
.expanded>.answer-node {
    display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tree-metadata {
        flex-direction: column;
        gap: 10px;
    }

    .children {
        padding-left: 15px;
        margin-left: 5px;
    }

    .node-header {
        padding: 10px;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #answer-content .title {
        font-size: 1.75rem;
    }

    #answer-content .section-heading {
        font-size: 1.35rem;
    }

    #answer-content .subsection-heading {
        font-size: 1.15rem;
    }

    #answer-content .content-section {
        padding: 1rem;
    }
}