/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: white;
    border-radius: 15px;
    padding: 20px 30px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    font-size: 2.5rem;
    color: #764ba2;
}

.logo h1 {
    font-size: 1.8rem;
    color: #333;
}

.status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
}

.status-indicator.active {
    background: #4CAF50;
    animation: pulse 2s infinite;
}

.status-indicator.inactive {
    background: #f44336;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Cards */
.card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.card-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.card-header h2 {
    color: #333;
    margin-bottom: 10px;
}

.card-header p {
    color: #666;
}

.card-header.success {
    border-bottom-color: #4CAF50;
}

.card-header.success h2 {
    color: #4CAF50;
}

.card.error {
    border: 2px solid #f44336;
}

/* Upload Area */
.upload-area {
    border: 3px dashed #ddd;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    background: #f9f9f9;
}

.upload-area:hover {
    border-color: #764ba2;
    background: #f0f0f0;
}

.upload-icon {
    font-size: 4rem;
    color: #764ba2;
    margin-bottom: 20px;
}

.upload-area h3 {
    color: #333;
    margin-bottom: 10px;
}

.upload-area p {
    color: #666;
    margin-bottom: 5px;
}

.file-size {
    font-size: 0.9rem;
    color: #999;
    margin-bottom: 20px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #f44336 0%, #c62828 100%);
    color: white;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-large {
    padding: 15px 40px;
    font-size: 1.1rem;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* Preview Section */
.preview-section {
    margin-top: 30px;
}

.image-preview {
    position: relative;
    max-width: 400px;
    margin: 0 auto;
}

.image-preview img {
    width: 100%;
    border-radius: 10px;
    display: block;
}

.image-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
}

/* Loading Section */
.loading-content {
    text-align: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #764ba2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 30px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-steps {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 30px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0.5;
}

.step.active {
    opacity: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.step.active .step-number {
    background: #764ba2;
    color: white;
}

/* Results Section */
.ethnicity-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.ethnicity-icon {
    font-size: 3rem;
}

.ethnicity-info h3 {
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.confidence-score {
    position: relative;
}

.score-circle {
    position: relative;
    width: 100px;
    height: 100px;
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 8;
}

.circle-progress {
    fill: none;
    stroke: white;
    stroke-width: 8;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    stroke-dasharray: 251;
    stroke-dashoffset: 251;
    transition: stroke-dashoffset 1s ease;
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-text span {
    font-size: 1.5rem;
    font-weight: bold;
    display: block;
}

.score-text small {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Probabilities Grid */
.probabilities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.probability-item {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.probability-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.prob-label {
    font-weight: 600;
}

.prob-value {
    font-size: 1.2rem;
    font-weight: bold;
}

/* Technical Details */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.detail-item {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
}

.detail-label {
    font-weight: 600;
    color: #666;
}

.detail-value {
    font-weight: 600;
    color: #333;
}

/* Error Section */
.error-content {
    text-align: center;
    padding: 40px 20px;
}

.error-icon {
    font-size: 4rem;
    color: #f44336;
    margin-bottom: 20px;
}

/* Footer */
.footer {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-top: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-section p, .footer-section ul {
    color: #666;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 5px;
}

.footer-section code {
    background: #f0f0f0;
    padding: 5px 10px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 0.9rem;
    margin-top: 5px;
    display: inline-block;
}

.footer-bottom {
    border-top: 1px solid #eee;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #666;
}

.api-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-badge {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.status-badge.online {
    background: #4CAF50;
    color: white;
}

.status-badge.offline {
    background: #f44336;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .ethnicity-card {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .progress-steps {
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}