/* Modern CSS for Arabic Letter Classification App */

:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #1abc9c;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f5f7fa;
    color: var(--dark-color);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

header h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 2.5rem;
}

header p {
    color: var(--dark-color);
    font-size: 1.2rem;
    opacity: 0.8;
}

.app-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.camera-section, .prediction-section {
    flex: 1;
    min-width: 300px;
}

.panel {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    height: 100%;
}

.panel h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel h3 {
    color: var(--dark-color);
    margin: 15px 0;
    font-size: 1.2rem;
}

/* Camera Container */
.camera-container {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

#video {
    width: 100%;
    border-radius: var(--border-radius);
    background-color: #000;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.camera-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Buttons */
.btn {
    padding: 10px 15px;
    border: none;
    border-radius: var(--border-radius);
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

.btn i {
    font-size: 1.1rem;
}

/* Upload Section */
.upload-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed rgba(0, 0, 0, 0.1);
}

.file-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background-color: var(--secondary-color);
    color: white;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.file-upload-btn:hover {
    background-color: #27ae60;
}

#fileName {
    margin-left: 10px;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.submit-btn {
    background-color: var(--secondary-color);
    margin-left: 10px;
}

.submit-btn:hover {
    background-color: #27ae60;
}

/* Prediction Section */
.prediction-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.captured-image-container {
    text-align: center;
}

#capturedImage {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.results-container {
    margin-top: 20px;
}

.main-prediction {
    margin-bottom: 20px;
}

.prediction-result {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

#mainPrediction {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    min-width: 80px;
}

.confidence-bar-container {
    flex-grow: 1;
    height: 20px;
    background-color: #ecf0f1;
    border-radius: 10px;
    overflow: hidden;
}

.confidence-bar {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 10px;
    transition: width 0.5s ease-in-out;
}

#mainConfidence {
    font-size: 1rem;
    color: var(--dark-color);
    min-width: 50px;
    text-align: right;
}

.top-predictions {
    margin-top: 10px;
}

.prediction-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.prediction-label {
    font-size: 1.1rem;
    min-width: 80px;
}

.prediction-confidence-bar-container {
    flex-grow: 1;
    height: 15px;
    background-color: #ecf0f1;
    border-radius: 10px;
    overflow: hidden;
}

.prediction-confidence-bar {
    height: 100%;
    background-color: var(--info-color);
    border-radius: 10px;
}

.prediction-confidence {
    font-size: 0.9rem;
    min-width: 50px;
    text-align: right;
}

/* Notifications */
.notification {
    margin-bottom: 20px;
    width: 100%;
}

.notification-content {
    padding: 15px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.notification-content.warning {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
}

.notification-content.info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.notification-content i {
    font-size: 1.2rem;
}

/* Real-time Mode Toggle */
.real-time-mode {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed rgba(0, 0, 0, 0.1);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--secondary-color);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--secondary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

#realtimeStatus {
    font-weight: bold;
}

.info-text {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #7f8c8d;
    flex-basis: 100%;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    color: #7f8c8d;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .camera-section, .prediction-section {
        width: 100%;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .camera-controls {
        flex-direction: column;
    }
    
    .prediction-result {
        flex-wrap: wrap;
    }
    
    #mainPrediction {
        flex-basis: 100%;
        margin-bottom: 10px;
    }
}
