* {
    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: #333;
}

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

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
}

main {
    padding: 40px;
}

/* Upload Section */
.upload-section {
    margin-bottom: 40px;
}

.upload-box {
    border: 3px dashed #667eea;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f8f9ff;
}

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

.upload-box.dragover {
    background: #e8ebff;
    border-color: #764ba2;
    transform: scale(1.02);
}

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

.upload-text {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 20px;
}

.browse-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.browse-btn:hover {
    transform: scale(1.05);
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px 40px;
}

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

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

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

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

.summary-card {
    background: #f8f9ff;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}

.summary-card h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.summary-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-item .label {
    color: #666;
    font-size: 0.9rem;
}

.summary-item .value {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
}

.mixed-orientation-alert {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #856404;
    font-weight: 500;
}

.alert-icon {
    font-size: 1.5rem;
}

/* Pages Detail */
.pages-detail {
    margin-bottom: 30px;
}

.pages-detail h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

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

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

tbody tr:hover {
    background: #f8f9ff;
}

tbody tr:last-child td {
    border-bottom: none;
}

.orientation-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.orientation-portrait {
    background: #d1ecf1;
    color: #0c5460;
}

.orientation-landscape {
    background: #d4edda;
    color: #155724;
}

.rotation-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background: #e2e3e5;
    color: #383d41;
}

.rotation-rotated {
    background: #f8d7da;
    color: #721c24;
}

.status-normal {
    color: #28a745;
    font-weight: 600;
}

.status-warning {
    color: #ffc107;
    font-weight: 600;
}

.status-rotated {
    color: #dc3545;
    font-weight: 600;
}

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

.btn {
    padding: 12px 30px;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.btn:hover {
    transform: scale(1.05);
}

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

.btn-secondary {
    background: #6c757d;
    color: white;
}

/* Error Message */
.error-message {
    background: #f8d7da;
    border: 2px solid #dc3545;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #721c24;
    font-weight: 500;
}

.error-icon {
    font-size: 1.5rem;
}

/* Footer */
footer {
    background: #f8f9ff;
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    main {
        padding: 20px;
    }

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

    .actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}
