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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15);
    padding: 48px;
    animation: fadeIn 0.5s ease-in;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
}

.upload-section {
    margin-bottom: 40px;
}

.upload-box {
    max-width: 600px;
    margin: 0 auto;
}

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8f9fa;
}

.upload-area:hover {
    background: #e9ecef;
    border-color: #764ba2;
    transform: translateY(-2px);
}

.upload-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.upload-text {
    font-size: 1.2em;
    color: #333;
    margin-bottom: 10px;
    font-weight: bold;
}

.upload-hint {
    font-size: 0.9em;
    color: #666;
}

.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #e3f2fd;
    padding: 15px 20px;
    border-radius: 10px;
    margin-top: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.clear-btn {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 1.2em;
    transition: transform 0.2s;
}

.clear-btn:hover {
    transform: scale(1.1);
}

.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.results-section {
    margin-top: 40px;
}

.basic-analysis {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
    border: 1px solid #e9ecef;
}

.basic-analysis h2 {
    color: #212529;
    margin-bottom: 24px;
    font-size: 1.6em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.stat-item {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.stat-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

.stat-label {
    color: #6c757d;
    font-size: 0.85em;
    margin-bottom: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    color: #667eea;
    font-size: 2.2em;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ai-review {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 16px;
    padding: 32px;
    border: 1px solid #e9ecef;
}

.ai-review h2 {
    color: #212529;
    margin-bottom: 24px;
    font-size: 1.6em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.review-section {
    background: white;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    border-left: 5px solid #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.review-section:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.review-section h3 {
    color: #667eea;
    margin-bottom: 16px;
    font-size: 1.3em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.review-section p {
    color: #555;
    line-height: 1.9;
    white-space: pre-wrap;
    font-size: 0.95em;
}

.review-section code,
.review-section pre {
    background: #f6f8fa;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 2px 6px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Courier New', monospace;
    font-size: 0.9em;
}

.review-section pre {
    padding: 16px;
    overflow-x: auto;
    margin: 12px 0;
    line-height: 1.6;
}

.code-block {
    background: #282c34;
    color: #abb2bf;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.6;
    border: 1px solid #3e4451;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.code-block code {
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
}

.suggestions-content {
    line-height: 1.8;
}

.suggestions-content p {
    margin-bottom: 16px;
}

.suggestions-content strong {
    color: #667eea;
    font-weight: 600;
}

.suggestions-content code {
    background: #f1f3f5;
    color: #e83e8c;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Courier New', monospace;
}

.error-message {
    background: linear-gradient(135deg, #ffebee 0%, #ffffff 100%);
    color: #c62828;
    padding: 16px 20px;
    border-radius: 12px;
    margin-top: 20px;
    text-align: center;
    border: 1px solid #ffcdd2;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(198, 40, 40, 0.1);
}

.full-review-content {
    max-height: 600px;
    overflow-y: auto;
    padding: 4px;
}

.full-review-content::-webkit-scrollbar {
    width: 8px;
}

.full-review-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.full-review-content::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.full-review-content::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

.full-review-text {
    line-height: 1.8;
    color: #495057;
}

.full-review-text h2,
.full-review-text h3,
.full-review-text h4 {
    margin-top: 24px;
    margin-bottom: 12px;
}

.full-review-text ul {
    margin: 12px 0;
    padding-left: 24px;
}

.full-review-text li {
    margin: 6px 0;
}

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

    header h1 {
        font-size: 1.8em;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}
