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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

h1 {
    color: #667eea;
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 1rem;
}

.privacy-warning {
    background: #fff5e6;
    border: 2px solid #f6ad55;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    align-items: start;
}

.privacy-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.privacy-text {
    font-size: 14px;
    color: #744210;
    line-height: 1.6;
}

.privacy-text strong {
    color: #7c2d12;
}

.privacy-text a {
    color: #667eea;
    text-decoration: underline;
}

.char-count {
    float: right;
    font-weight: normal;
    color: #666;
    font-size: 14px;
}

.input-section {
    margin-bottom: 30px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #444;
}

textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #667eea;
    color: white;
    width: 100%;
    margin-top: 15px;
    justify-content: center;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #48bb78;
    color: white;
}

.btn-secondary:hover {
    background: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}

.btn-apply-all {
    background: #667eea;
    color: white;
}

.btn-apply-all:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.suggestion-btn {
    background: #edf2f7;
    color: #2d3748;
    padding: 8px 16px;
    border: 2px solid #cbd5e0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin: 4px;
}

.suggestion-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-1px);
}

.suggestion-btn.applied {
    background: #48bb78;
    color: white;
    border-color: #48bb78;
}

.suggestion-btn.applied:hover {
    background: #38a169;
    border-color: #38a169;
}

.loading {
    text-align: center;
    padding: 30px;
    color: #667eea;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.results-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.issues-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.issues-header h2 {
    color: #444;
    font-size: 1.5rem;
    margin: 0;
}

.did-you-mean-section {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border: 2px solid #667eea;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.did-you-mean-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 12px;
}

.did-you-mean-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2d3748;
    line-height: 1.6;
    padding: 10px 0;
    letter-spacing: 0.3px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-header h2 {
    color: #444;
    font-size: 1.5rem;
    margin: 0;
}

.corrected-text {
    background: #f7fafc;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
    min-height: 100px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.errors-list {
    margin-top: 20px;
}

.error-item {
    background: #fff5f5;
    border-left: 4px solid #fc8181;
    padding: 15px;
    margin-bottom: 12px;
    border-radius: 4px;
    transition: all 0.3s;
}

.error-item.suggestion {
    background: #fffaf0;
    border-left-color: #f6ad55;
}

.error-item.resolved {
    background: #f0fff4;
    border-left-color: #48bb78;
    opacity: 0.7;
}

.error-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    align-items: center;
}

.error-suggestions-label {
    font-weight: 600;
    color: #2d3748;
    margin-right: 8px;
}

.error-context {
    font-family: 'Courier New', monospace;
    background: white;
    padding: 8px;
    border-radius: 4px;
    margin: 8px 0;
}

.error-word {
    background: #fc8181;
    color: white;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
}

.error-message {
    color: #c53030;
    font-weight: 600;
    margin-bottom: 5px;
}

.error-suggestion {
    color: #2d3748;
    margin-top: 5px;
}

.error-suggestion strong {
    color: #48bb78;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 2rem;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}
