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

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

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

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

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

.title-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1.2;
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.title-main {
    color: white;
    font-weight: 800;
}

.title-domain {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
    font-size: 0.75em;
    letter-spacing: 0.5px;
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 500;
    margin-top: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Upload Section */
.upload-section {
    animation: fadeIn 0.5s ease-in;
}

.upload-card {
    background: white;
    border-radius: 24px;
    padding: 60px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    text-align: center;
    transition: transform 0.3s ease;
}

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

.upload-icon {
    margin-bottom: 30px;
}

.upload-card h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #1f2937;
}

.upload-description {
    color: #6b7280;
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.upload-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

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

/* File Info */
.file-info {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f3f4f6;
    padding: 20px;
    border-radius: 12px;
    margin: 30px 0;
    text-align: left;
}

.file-icon {
    font-size: 2rem;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 5px;
}

.file-size {
    color: #6b7280;
    font-size: 0.9rem;
}

.remove-btn {
    background: #ef4444;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.remove-btn:hover {
    background: #dc2626;
    transform: rotate(90deg);
}


/* Analyze Button */
.analyze-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 18px 50px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    margin-top: 20px;
}

.analyze-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.analyze-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
}

/* Loading Section */
.loading-section {
    animation: fadeIn 0.5s ease-in;
}

.loading-card {
    background: white;
    border-radius: 24px;
    padding: 60px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.spinner-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
}

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

.spinner-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent, rgba(102, 126, 234, 0.3));
    animation: spin 2s linear infinite;
}

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

.loading-card h3 {
    font-size: 1.8rem;
    color: #1f2937;
    margin-bottom: 10px;
}

.loading-text {
    color: #6b7280;
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.progress-steps {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 40px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.step.active {
    opacity: 1;
}

.step-icon {
    font-size: 2rem;
    animation: bounce 1s ease-in-out infinite;
}

.step.active .step-icon {
    animation: bounce 1s ease-in-out infinite;
}

.step-label {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Results Section */
.results-section {
    animation: fadeIn 0.5s ease-in;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.results-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.results-title h2 {
    font-size: 1.8rem;
    color: #1f2937;
}

.new-analysis-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.new-analysis-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

/* Summary Cards */
.results-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: white;
    padding: 25px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

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

.summary-icon {
    font-size: 2.5rem;
}

.summary-content {
    flex: 1;
}

.summary-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 5px;
}

.summary-label {
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Results List */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.result-item {
    background: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.result-item:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

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

.page-number {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1f2937;
}

.result-badge {
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-badge.passato {
    background: #d1fae5;
    color: #065f46;
}

.result-badge.fallito {
    background: #fee2e2;
    color: #991b1b;
}

.result-badge.unknown {
    background: #e5e7eb;
    color: #6b7280;
}

.confidence-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 8px;
}

.confidence-badge.high {
    background: #d1fae5;
    color: #065f46;
}

.confidence-badge.medium {
    background: #fef3c7;
    color: #92400e;
}

.confidence-badge.low {
    background: #fee2e2;
    color: #991b1b;
}

.result-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.detail-item {
    background: #f9fafb;
    padding: 15px;
    border-radius: 10px;
}

.detail-label {
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 5px;
}

.detail-value {
    color: #1f2937;
    font-weight: 600;
}

/* Export Actions */
.export-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.export-btn {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.export-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* Error Section */
.error-section {
    animation: fadeIn 0.5s ease-in;
}

.error-card {
    background: white;
    border-radius: 24px;
    padding: 60px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.error-card h3 {
    font-size: 1.8rem;
    color: #dc2626;
    margin-bottom: 15px;
}

.error-message {
    color: #6b7280;
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.retry-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

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

/* Responsive */
@media (max-width: 768px) {
    .logo h1 {
        font-size: 2rem;
    }
    
    .title-domain {
        font-size: 0.7em;
    }
    
    .subtitle {
        font-size: 0.8rem;
    }
    
    .upload-card {
        padding: 40px 20px;
    }
    
    .results-summary {
        grid-template-columns: 1fr;
    }
    
    .result-details {
        grid-template-columns: 1fr;
    }
    
    .export-actions {
        flex-direction: column;
    }
    
    .progress-steps {
        flex-direction: column;
        gap: 20px;
    }
}
