/* --- Global Styles & Variables --- */
:root {
    --cf-orange: #F38020;
    --dark-bg: #1d1d1d;
    --medium-bg: #2d2d2d;
    --light-text: #e0e0e0;
    --dark-text: #a0a0a0;
    --border-color: #444;
}

body {
    box-sizing: border-box;
    margin: 0;
    padding: 2rem 1rem;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--dark-bg);
    color: var(--light-text);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

/* --- Layout --- */
main {
    width: 100%;
    max-width: 800px;
}

header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

footer {
    text-align: center;
    margin-top: 3rem;
    color: var(--dark-text);
    font-size: 0.9rem;
}

/* --- Typography --- */
h1 {
    font-size: 2rem;
    color: #fff;
    margin: 0;
}

h2 {
    color: var(--light-text);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-top: 2rem;
}

p {
    color: var(--dark-text);
    line-height: 1.6;
}

/* --- Controls & Inputs --- */
.controls {
    margin-bottom: 1rem;
}

.controls label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--light-text);
}

select, textarea {
    width: 100%;
    padding: 0.8rem;
    background-color: var(--medium-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--light-text);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

select:focus, textarea:focus {
    outline: none;
    border-color: var(--cf-orange);
    box-shadow: 0 0 0 3px rgba(243, 128, 32, 0.2);
}

textarea {
    font-family: 'SF Mono', 'Consolas', 'Menlo', monospace;
    resize: vertical;
}

/* --- Cloudflare-style Button --- */
#analyze-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.9rem 1.5rem;
    background-color: var(--cf-orange);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

#analyze-btn:hover {
    background-color: #ff9d4d;
}

#analyze-btn:active {
    transform: scale(0.99);
}

#analyze-btn:disabled {
    background-color: #555;
    cursor: not-allowed;
}

#result-container {
    margin-top: 2rem;
}

#review-output {
    background-color: var(--medium-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    color: var(--light-text);
    white-space: pre-wrap; 
    word-wrap: break-word;
    font-family: 'SF Mono', 'Consolas', 'Menlo', monospace;
    min-height: 100px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    display: none; 
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#analyze-btn:disabled .btn-text {
    display: none;
}

#analyze-btn:disabled .spinner {
    display: block;
}
#review-output ul {
    padding-left: 20px;
}

#review-output li {
    margin-bottom: 0.8rem;
    line-height: 1.6;
}

#review-output strong {
    color: var(--cf-orange);
}

#review-output code {
    background-color: #111;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'SF Mono', 'Consolas', 'Menlo', monospace;
    font-size: 0.9rem;
}

#review-output pre code {
    display: block;
    padding: 1rem;
    background-color: #111;
    border-radius: 8px;
    white-space: pre-wrap;
    word-wrap: break-word;
}