/* General Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #202124; /* Dark background */
    color: #e8eaed; /* Light text */
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align to top */
    min-height: 100vh;
}

.app-container {
    background-color: #282c34; /* Slightly lighter container background */
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    width: 90%;
    max-width: 1200px;
    border: 1px solid #3a3f4a;
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3a3f4a;
    margin-bottom: 1rem;
    border-bottom: 1px solid #3a3f4a;
    padding-bottom: 15px;
}

header .title {
    display: flex;
    align-items: center;
}

.header-icon {
    font-size: 1.8em;
    color: #8ab4f8; /* Light blue icon */
    margin-right: 15px;
}

header h1 {
    color: #e8eaed;
    margin: 0;
    font-size: 1.6em;
    font-weight: 500;
}

.clear-btn {
    background-color: #5f6368; /* Darker grey button */
    color: #e8eaed;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s ease;
}

.clear-btn:hover {
    background-color: #70757a;
}

/* Content Area Layout (2 columns) */   
.results-column {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Editor Styles */
#editor {
    border: 1px solid #3a3f4a;
    border-radius: 8px;
    /* Height is set inline in HTML or dynamically via JS if needed */
    overflow: hidden; /* Ensures border-radius clips the editor */
}

/* Placeholder text for editor (optional, Monaco might have its own) */
.editor-placeholder {
    position: absolute;
    top: 20px;
    left: 15px;
    color: #9aa0a6;
    font-style: italic;
    pointer-events: none;
    z-index: 1;
    display: none; /* Initially hidden, shown by JS if editor is empty */
}

/* Card Styles for Results/Explanation */
.card {
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #3a3f4a;
}

/* Prediction Section Styles */
.prediction-section h3,
.explanation-section h3,
.models-section h3,
.faq-section h3 {
    color: #8ab4f8;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: 500;
    border-bottom: 1px solid #3a3f4a;
    padding-bottom: 8px;
}

.result-item {
    margin-bottom: 12px;
    font-size: 1em;
    display: flex;
    justify-content: space-between;
}

.result-item .label {
    color: #bdc1c6; /* Lighter grey label */
    margin-right: 10px;
}

.result-item .value {
    color: #e8eaed;
    font-weight: 600;
}

.result-item .winner {
    color: #21df57;
    font-weight: 600;
}

/* Explanation Section Styles */
.explanation-section p {
    color: #bdc1c6;
    line-height: 1.6;
    margin: 0;
    padding: 10px 0;
    font-weight: 400;
}

/* Error Message */
.error:empty {
    display: none;
}

.error {
    text-align: center;
    color: #f28b82;
    padding: 2rem;
    background: #2d3136;
    border-radius: 8px;
    border: 1px solid #3a3f4a;
    font-size: 1.1em;
    line-height: 1.6;
    margin: 1rem 0;
    animation: bounceIn 0.5s ease;
    font-weight: 400;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.error i {
    font-size: 1.5em;
    margin-bottom: 0.5rem;
    display: block;
    color: #8ab4f8;
}

.header-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-button {
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Try Other Tool Section */
.try-other-tool {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100;
}

.try-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px;
    background-color: #8ab4f8;
    color: #202124;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    margin: 20px auto 0;
    width: fit-content;
    justify-content: center;
}

.try-button:hover {
    background-color: #93bbf9;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(138, 180, 248, 0.3);
}

.try-button i {
    transition: transform 0.3s ease;
}

.try-button:hover i {
    transform: translateX(4px);
}

/* Writing Style Matcher Styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background-color: #282c34;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    border: 1px solid #3a3f4a;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-icon {
    font-size: 2rem;
    color: #8ab4f8;
}

h1 {
    margin: 0;
    color: #e8eaed;
    font-size: 2rem;
}

.content-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    display: flex;
    gap: 25px; /* Space between columns */
}

/* Editor Column */
.editor-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 3; /* Takes up more space */
    position: relative; /* For placeholder positioning */
    margin-top: 10px;
}

.prompt-box {
    background: #2d3136;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #3a3f4a;
}

.prompt-box h2 {
    margin: 0 0 0.5rem 0;
    color: #8ab4f8;
    font-size: 1.25rem;
}

.prompt-box p {
    margin: 0;
    color: #bdc1c6;
    font-size: 1rem;
    line-height: 1.5;
}

#editor {
    border: 1px solid #3a3f4a;
    border-radius: 8px;
    overflow: hidden;
}

.editor-controls {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.char-count {
    color: #bdc1c6;
    font-size: 0.9em;
    font-weight: 400;
}

.char-count .char-count-error {
    color: #f28b82;
}

.button-group {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.submit-btn {
    background-color: #8ab4f8;
    color: #202124;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.submit-btn:disabled {
    background-color: #5f6368;
    color: #9aa0a6;
    cursor: not-allowed;
}

.submit-btn:not(:disabled):hover {
    background-color: #93bbf9;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.clear-btn {
    background-color: #5f6368;
    color: #e8eaed;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.clear-btn:hover {
    background-color: #70757a;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

/* Results Column */

.results-container {
    padding: 1.5rem;
    height: 100%;
}

.initial-state {
    text-align: center;
    color: #bdc1c6;
}

.initial-state i {
    font-size: 3rem;
    color: #8ab4f8;
    margin-bottom: 1rem;
}

.initial-state h2 {
    margin: 0 0 1rem 0;
    color: #e8eaed;
}

.initial-state p {
    margin: 0;
    line-height: 1.5;
}

/* Match Results */
.match-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.match-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #282c34;
    border-radius: 8px;
    border: 1px solid #3a3f4a;
}

.model-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
}

.model-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.match-details {
    flex: 1;
}

.match-details h3 {
    margin: 0 0 0.5rem 0;
    color: #e8eaed;
}

.match-score {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.score-bar {
    flex: 1;
    height: 8px;
    background: #3a3f4a;
    border-radius: 4px;
    overflow: hidden;
}

.score-bar div {
    height: 100%;
    background: #8ab4f8;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.match-score span {
    color: #bdc1c6;
    font-weight: 500;
    min-width: 3rem;
    text-align: right;
}

/* Loading State */
.loading {
    text-align: center;
    color: #bdc1c6;
    padding: 2rem;
}

.loading i {
    font-size: 2rem;
    color: #8ab4f8;
    margin-bottom: 1rem;
}

/* Models Section */
.models-section {
    margin-top: 10px;
}

.models-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.model-card {
    background: #282c34;
    border: 1px solid #3a3f4a;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.model-card.winner {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border-color: #8ab4f8;
    background: #2d3136;
    border-color: green;
}

.model-card img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    margin-bottom: 10px;
    border-color: white;
}

.model-card:hover {
    transform: translateY(-2px);
}

.model-card h4 {
    color: #e8eaed;
    margin: 0;
    font-size: 0.9em;
    font-weight: 500;
    transition: color 0.3s ease;
}

.model-card.winner h4 {
    color: #8ab4f8;
}

/* Update existing styles */
.prediction-section {
    margin-bottom: 20px;
}

.prediction-section p {
    color: #bdc1c6;
    line-height: 1.6;
    margin: 0;
    padding: 10px 0;
    font-weight: 400;
}

.initial-state p {
    color: #bdc1c6;
    line-height: 1.6;
    font-size: 0.95em;
    margin: 0;
    font-style: italic;
    font-weight: 400;
}

#results {
    padding-bottom: 10px;
}

.task-description {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    /* margin-top: 1rem; */
    /* text-align: center; */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.task-description p {
    margin: 0;
    font-size: 1.1rem;
    color: #e0e0e0;
    line-height: 1.5;
}

.faq-section {
    margin-top: 1rem;
}

.faq-section ol {
    padding-left: 1.2rem;
    line-height: 1.8;
}

.faq-section li {
    margin-bottom: 0.8rem;
    color: #e0e0e0;
}

.about-section {
    margin-top: 1rem;
    text-align: center;
}

.about-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #4CAF50;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    transition: all 0.3s ease;
}

.about-link:hover {
    background: rgba(76, 175, 80, 0.2);
    transform: translateY(-2px);
}