/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 2.5rem;
    color: #ffd700;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Main Content */
.main-content {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Input Section */
.input-section {
    padding: 40px;
    border-bottom: 1px solid #e5e7eb;
}

.input-container {
    max-width: 800px;
    margin: 0 auto;
}

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

.input-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
}

.word-count {
    background: #f3f4f6;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
}

#textInput {
    width: 100%;
    padding: 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
    background: #fafafa;
}

#textInput:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: inherit;
}

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

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(240, 147, 251, 0.3);
}

.btn-outline {
    background: #ffffff;
    color: #111827; /* darker for contrast */
    border: 2px solid #ffffff; /* white border on gradient */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.btn-outline:hover, .btn-outline:focus-visible {
    background: #f9fafb;
    border-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Results Section */
.results-section {
    padding: 40px;
    background: #f9fafb;
}

.results-container {
    max-width: 800px;
    margin: 0 auto;
}

.results-container h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 30px;
    text-align: center;
}

/* Score Card */
.score-card {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

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

.score-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1f2937;
}

.score-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1.2rem;
    font-weight: 700;
}

.score-bar {
    width: 100%;
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 15px;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #f59e0b 50%, #ef4444 100%);
    border-radius: 6px;
    transition: width 0.8s ease;
    width: 0%;
}

.score-description {
    text-align: center;
    color: #6b7280;
    font-size: 1rem;
    margin: 0;
}

/* Analysis Details */
.analysis-details {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.analysis-details h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 20px;
    text-align: center;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.detail-item {
    text-align: center;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
}

.detail-label {
    display: block;
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 500;
}

.detail-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    color: #1f2937;
}

/* Humanized Section */
.humanized-section {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

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

.humanized-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1f2937;
}

.humanized-text {
    background: #f9fafb;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #10b981;
    font-size: 1rem;
    line-height: 1.7;
    color: #374151;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
}

/* Features Section */
.features-section {
    padding: 60px 40px;
    background: white;
}

.features-section h2 {
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 40px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    text-align: center;
    padding: 30px 20px;
    border-radius: 16px;
    background: #f9fafb;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.feature-icon i {
    font-size: 1.5rem;
    color: white;
}

.feature-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 15px;
}

.feature-card p {
    color: #6b7280;
    line-height: 1.6;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px;
    color: white;
    opacity: 0.8;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    background: white;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.loading-spinner i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 15px;
}

.loading-spinner p {
    color: #6b7280;
    font-size: 1.1rem;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        margin-bottom: 30px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .input-section,
    .results-section,
    .features-section {
        padding: 30px 20px;
    }
    
    .input-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .score-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .humanized-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .logo {
        flex-direction: column;
        gap: 10px;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
}
