/* Professional Say - Notion-like UI */

:root {
    --font-sans: "Inter", sans-serif;
    --text-color: rgb(25, 25, 24);
    --bg-color: #fafafa;
    --border-color: rgba(55, 53, 47, 0.12);
    --space-16: 16px;
    --space-24: 24px;
    --space-32: 32px;
}

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

body {
    font-family: var(--font-sans);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-32) var(--space-24);
}

/* ========== APP HEADER ========== */
.app-header {
    text-align: center;
    margin-bottom: var(--space-24);
    padding: var(--space-16) var(--space-24);
    margin: calc(-1 * var(--space-32)) calc(-1 * var(--space-24)) var(--space-24);
}

.app-header__title {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: var(--text-color);
    margin: 0;
    padding-bottom: var(--space-16);
}

.app-header__title::after {
    content: '';
    display: block;
    width: 40%;
    height: 1px;
    background: var(--border-color);
    margin: var(--space-16) auto 0;
}

/* Input Section */
.input-section {
    margin-bottom: 32px;
}

.input-card {
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.input-wrapper {
    margin-bottom: 24px;
}

.input-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: rgba(25, 25, 24, 0.6);
    margin-bottom: 8px;
}

textarea {
    width: 100%;
    min-height: 140px;
    padding: 16px;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.55;
    color: rgb(25, 25, 24);
    background: rgba(55, 53, 47, 0.04);
    border: 0.5px solid rgba(55, 53, 47, 0.16);
    border-radius: 8px;
    outline: none;
    resize: vertical;
    transition: border-color 0.2s ease, background 0.2s ease;
}

textarea:focus {
    border-color: #2383E2;
    background: white;
}

textarea::placeholder {
    color: rgba(25, 25, 24, 0.4);
}

/* Options Row */
.options-row {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.option-group {
    flex: 0 0 auto;
    min-width: 200px;
}

.option-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: rgba(25, 25, 24, 0.5);
    margin-bottom: 6px;
}

select {
    width: 100%;
    padding: 10px 12px;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 15px;
    color: rgb(25, 25, 24);
    background: white;
    border: 0.5px solid rgba(55, 53, 47, 0.16);
    border-radius: 8px;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

select:focus {
    border-color: #2383E2;
}

.button-row {
    display: flex;
    justify-content: flex-end;
}

/* Primary Button */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 16px;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 50px;
    background: #000000;
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.btn-primary:hover:not(:disabled) {
    background: #1a1a1a;
}

.btn-primary:active:not(:disabled) {
    background: #333333;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary svg {
    width: 18px;
    height: 18px;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 48px 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-top: 24px;
}

.spinner-container {
    margin-bottom: 24px;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 3px solid rgba(35, 131, 226, 0.2);
    border-top-color: #2383E2;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    font-size: 18px;
    font-weight: 500;
    color: rgb(25, 25, 24);
}

/* Error State */
.error-state {
    text-align: center;
    padding: 32px 24px;
    background: #fef2f2;
    border: 0.5px solid #fecaca;
    border-radius: 12px;
    margin-top: 24px;
}

.error-icon {
    color: #dc2626;
    margin-bottom: 12px;
}

.error-icon svg {
    width: 40px;
    height: 40px;
}

.error-text {
    font-size: 16px;
    color: #991b1b;
    margin-bottom: 16px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    font-size: 16px;
    font-weight: 500;
    color: #2383E2;
    background: white;
    border: 0.5px solid #2383E2;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background: rgba(35, 131, 226, 0.08);
}

/* Result Section */
.result-section {
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Analysis Card */
.analysis-card {
    background: rgba(35, 131, 226, 0.08);
    border: 0.5px solid rgba(35, 131, 226, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.analysis-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #2383E2;
    margin-bottom: 12px;
}

.analysis-header svg {
    width: 18px;
    height: 18px;
}

.analysis-content p {
    font-size: 14px;
    line-height: 1.5;
    color: rgba(25, 25, 24, 0.8);
    margin-bottom: 6px;
}

.analysis-content p:last-child {
    margin-bottom: 0;
}

.analysis-content strong {
    color: rgb(25, 25, 24);
}

/* Rewrites Container */
.rewrites-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

/* Rewrite Card */
.rewrite-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rewrite-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.rewrite-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.rewrite-version {
    font-size: 14px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
}

.rewrite-version.friendly {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
}

.rewrite-version.neutral {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
}

.rewrite-version.firm {
    background: rgba(234, 88, 12, 0.12);
    color: #c2410c;
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(25, 25, 24, 0.6);
    background: transparent;
    border: 0.5px solid rgba(55, 53, 47, 0.16);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: rgba(55, 53, 47, 0.08);
    color: rgb(25, 25, 24);
}

.copy-btn.copied {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.3);
    color: #16a34a;
}

.copy-btn svg {
    width: 14px;
    height: 14px;
}

.rewrite-text {
    font-size: 18px;
    font-weight: 400;
    line-height: 1.55;
    color: rgb(25, 25, 24);
    margin-bottom: 16px;
    padding: 16px;
    background: rgba(55, 53, 47, 0.04);
    border-radius: 8px;
}

.rewrite-labels {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.label-tag {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 4px;
    background: rgba(55, 53, 47, 0.08);
    color: rgba(25, 25, 24, 0.7);
}

.rewrite-rationale {
    font-size: 14px;
    font-style: italic;
    color: rgba(25, 25, 24, 0.6);
    line-height: 1.5;
    padding-left: 12px;
    border-left: 1px solid rgba(55, 53, 47, 0.12);
}

/* Result Actions */
.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 16px;
    font-weight: 500;
    color: rgba(25, 25, 24, 0.8);
    background: white;
    border: 0.5px solid rgba(55, 53, 47, 0.16);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(55, 53, 47, 0.08);
    border-color: rgba(55, 53, 47, 0.24);
}

.btn-secondary svg {
    width: 18px;
    height: 18px;
}

.btn-secondary.primary {
    background: #2383E2;
    border-color: #2383E2;
    color: white;
}

.btn-secondary.primary:hover {
    background: #1B6DC1;
    border-color: #1B6DC1;
}

/* Examples Section */
.examples-section {
    margin-top: 48px;
    text-align: center;
}

.examples-title {
    font-size: 14px;
    font-weight: 500;
    color: rgba(25, 25, 24, 0.5);
    margin-bottom: 16px;
}

.examples-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.example-btn {
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 400;
    color: rgba(25, 25, 24, 0.7);
    background: white;
    border: 0.5px solid rgba(55, 53, 47, 0.12);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.example-btn:hover {
    background: rgba(35, 131, 226, 0.08);
    border-color: rgba(35, 131, 226, 0.3);
    color: #2383E2;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: var(--space-24) var(--space-16);
    }
    
    .app-header {
        padding: var(--space-12) var(--space-16);
        margin: calc(-1 * var(--space-24)) calc(-1 * var(--space-16)) var(--space-20);
    }
    
    .app-header__title {
        font-size: 28px;
    }
    
    .input-card {
        padding: 24px;
    }
    
    textarea {
        font-size: 16px;
    }
    
    .options-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .rewrite-card {
        padding: 20px;
    }
    
    .rewrite-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .rewrite-text {
        font-size: 16px;
        padding: 12px;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 32px;
    }
    
    .examples-grid {
        flex-direction: column;
    }
    
    .example-btn {
        width: 100%;
    }
}
