/* Rock Paper Scissors AI - Professional Styles */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 30%, #CD853F 70%, #DEB887 100%);
    min-height: 100vh;
    color: #2F1B14;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(139, 69, 19, 0.3);
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(160, 82, 45, 0.2);
}

.header h1 {
    color: #8B4513;
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(139, 69, 19, 0.2);
}

.header p {
    color: #A0522D;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.api-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 500;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #dc3545;
    animation: pulse 2s infinite;
}

.status-dot.online {
    background: #28a745;
}

.status-dot.offline {
    background: #dc3545;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Main Content */
.main-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(139, 69, 19, 0.3);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(160, 82, 45, 0.2);
}

/* Navigation */
.navigation {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.2);
}

.nav-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    background: rgba(139, 69, 19, 0.1);
    color: #8B4513;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn:hover {
    background: rgba(139, 69, 19, 0.2);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: #8B4513;
    color: white;
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.3);
}

/* Sections */
.section {
    display: none;
}

.section.active {
    display: block;
}

.section-header {
    text-align: center;
    margin-bottom: 30px;
}

.section-header h2 {
    color: #8B4513;
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.section-header p {
    color: #A0522D;
    font-size: 1.1rem;
}

/* Upload Area */
.upload-area {
    border: 3px dashed #A0522D;
    border-radius: 15px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(205, 133, 63, 0.05);
}

.upload-area:hover {
    border-color: #8B4513;
    background: rgba(205, 133, 63, 0.1);
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #8B4513;
    background: rgba(205, 133, 63, 0.15);
    transform: scale(1.02);
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 4rem;
    color: #A0522D;
    margin-bottom: 20px;
    display: block;
}

.upload-area h3 {
    color: #8B4513;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.upload-area p {
    color: #A0522D;
    font-size: 1.1rem;
    margin-bottom: 25px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: #8B4513;
    color: white;
}

.btn-primary:hover {
    background: #A0522D;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

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

.btn-secondary:hover {
    background: #5a6268;
}

/* Preview Section */
.preview-section {
    text-align: center;
    margin-top: 30px;
}

.image-preview {
    margin-bottom: 25px;
}

.image-preview img {
    max-width: 400px;
    max-height: 400px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(139, 69, 19, 0.3);
    border: 3px solid rgba(160, 82, 45, 0.2);
}

.preview-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

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

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

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

.loading p {
    color: #8B4513;
    font-size: 1.2rem;
    font-weight: 500;
}

/* Results Section */
.results-section {
    margin-top: 30px;
}

.result-card {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    background: rgba(139, 69, 19, 0.05);
    padding: 30px;
    border-radius: 15px;
    border: 2px solid rgba(160, 82, 45, 0.2);
}

.result-image img {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.3);
}

.result-content {
    flex: 1;
}

.prediction-result {
    text-align: center;
    margin-bottom: 30px;
}

.prediction-icon {
    font-size: 3rem;
    color: #8B4513;
    margin-bottom: 15px;
}

.prediction-result h3 {
    color: #8B4513;
    font-size: 2rem;
    margin-bottom: 10px;
}

.confidence {
    background: #28a745;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 600;
    display: inline-block;
}

/* Probabilities */
.probabilities {
    margin-bottom: 30px;
}

.probabilities h4 {
    color: #8B4513;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.prob-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.prob-label {
    width: 100px;
    font-weight: 600;
    color: #8B4513;
}

.prob-track {
    flex: 1;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.prob-fill {
    height: 100%;
    background: linear-gradient(90deg, #8B4513, #CD853F);
    border-radius: 10px;
    transition: width 0.8s ease;
}

.prob-value {
    width: 50px;
    text-align: right;
    font-weight: 600;
    color: #8B4513;
}

/* Error Message */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #f5c6cb;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-message i {
    font-size: 1.2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 25px;
    }
    
    .result-card {
        flex-direction: column;
        text-align: center;
    }
    
    .result-image img {
        width: 100%;
        max-width: 300px;
        height: auto;
    }
    
    .prob-bar {
        flex-direction: column;
        gap: 8px;
    }
    
    .prob-label {
        width: auto;
    }
}

/* Animation for elements appearing */
.fade-in {
    animation: fadeIn 0.5s ease;
}

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

/* Training Section Styles */
.class-selector {
    margin-bottom: 30px;
    text-align: center;
}

.class-selector h3 {
    color: #8B4513;
    margin-bottom: 20px;
}

.class-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.class-btn {
    padding: 15px 25px;
    border: 2px solid #A0522D;
    border-radius: 10px;
    background: transparent;
    color: #8B4513;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.class-btn:hover {
    background: rgba(139, 69, 19, 0.1);
    transform: translateY(-2px);
}

.class-btn.active {
    background: #8B4513;
    color: white;
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.3);
}

.training-upload-area {
    border: 3px dashed #A0522D;
    border-radius: 15px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(205, 133, 63, 0.05);
    margin-bottom: 30px;
}

.training-upload-area:hover {
    border-color: #8B4513;
    background: rgba(205, 133, 63, 0.1);
    transform: translateY(-2px);
}

.training-upload-area.dragover {
    border-color: #8B4513;
    background: rgba(205, 133, 63, 0.15);
    transform: scale(1.02);
}

.upload-queue {
    background: rgba(139, 69, 19, 0.05);
    border-radius: 15px;
    padding: 25px;
    border: 2px solid rgba(160, 82, 45, 0.2);
}

.upload-queue h3 {
    color: #8B4513;
    margin-bottom: 20px;
}

.queue-items {
    margin-bottom: 20px;
}

.queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.queue-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Retraining Section Styles */
.retrain-info {
    margin-bottom: 30px;
}

.info-card {
    background: rgba(139, 69, 19, 0.05);
    border-radius: 15px;
    padding: 25px;
    border: 2px solid rgba(160, 82, 45, 0.2);
    margin-bottom: 25px;
}

.info-card h3 {
    color: #8B4513;
    margin-bottom: 20px;
    text-align: center;
}

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

.status-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.status-item .label {
    font-weight: 600;
    color: #8B4513;
}

.status-item .value {
    color: #A0522D;
    font-weight: 500;
}

.retrain-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.retrain-progress {
    background: rgba(139, 69, 19, 0.05);
    border-radius: 15px;
    padding: 25px;
    border: 2px solid rgba(160, 82, 45, 0.2);
    text-align: center;
}

.retrain-progress h3 {
    color: #8B4513;
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8B4513, #CD853F);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    color: #A0522D;
    font-weight: 500;
}

.retrain-results {
    background: rgba(40, 167, 69, 0.1);
    border-radius: 15px;
    padding: 25px;
    border: 2px solid rgba(40, 167, 69, 0.3);
    text-align: center;
}

.retrain-results h3 {
    color: #28a745;
    margin-bottom: 20px;
}

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

.result-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.result-item .label {
    font-weight: 600;
    color: #8B4513;
    margin-bottom: 5px;
}

.result-item .value {
    color: #28a745;
    font-weight: 700;
    font-size: 1.2rem;
}

/* Statistics Section Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: rgba(139, 69, 19, 0.05);
    border-radius: 15px;
    padding: 25px;
    border: 2px solid rgba(160, 82, 45, 0.2);
    text-align: center;
    transition: transform 0.3s ease;
}

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

.stat-icon {
    font-size: 2.5rem;
    color: #8B4513;
    margin-bottom: 15px;
}

.stat-content h3 {
    color: #8B4513;
    font-size: 2rem;
    margin-bottom: 5px;
}

.stat-content p {
    color: #A0522D;
    font-weight: 500;
}

.class-distribution {
    background: rgba(139, 69, 19, 0.05);
    border-radius: 15px;
    padding: 25px;
    border: 2px solid rgba(160, 82, 45, 0.2);
}

.class-distribution h3 {
    color: #8B4513;
    margin-bottom: 25px;
    text-align: center;
}

.distribution-bars {
    display: grid;
    gap: 15px;
}

.dist-bar {
    display: flex;
    align-items: center;
    gap: 15px;
}

.dist-label {
    width: 120px;
    font-weight: 600;
    color: #8B4513;
}

.dist-track {
    flex: 1;
    height: 25px;
    background: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
}

.dist-fill {
    height: 100%;
    background: linear-gradient(90deg, #8B4513, #CD853F);
    border-radius: 12px;
    transition: width 0.8s ease;
}

.dist-value {
    width: 60px;
    text-align: right;
    font-weight: 600;
    color: #8B4513;
}
