/* Main layout styles */
body { 
    font-family: Arial, sans-serif; 
    padding: 5px; 
    background-color: #f4f4f4; 
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

h2 {
    text-align: center;
    color: #878787;
    margin: 5px;
}

.footer-logo {
            text-align: center;
            margin-top: 30px;
            padding: 20px;
            border-top: 1px solid #ddd;
        }
        
        .footer-logo a {
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 10px;
            color: #666;
            font-size: 0.9em;
        }
        
        .footer-logo img {
            height: 30px;
            width: auto;
        }
        
        .footer-logo:hover a {
            color: #333;
            transition: color 0.3s ease;
        }


/* Snake Game Styles */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
}

/* Level Header */
.level-header {
    width: 100%;
    max-width: 400px;
    text-align: center;
    margin-bottom: 5px;
}

.level-name {
    margin: 0 0 5px 0;
    color: #373737;
    font-size: 1.5em;
}

.progress-info {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

canvas {
    border: 2px solid #333;
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.game-info {
    margin-top: 5px;
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 400px;
}

.score-display {
    font-size: 18px;
    font-weight: bold;
    color: #388E3C;
    text-align: center;
}

.controls {
    margin-top: 5px;
    font-size: 14px;
    color: #666;
    text-align: center;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

/* *** DODANO: Analytics Panel Styles *** */
.analytics-panel {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.analytics-panel h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #495057;
    font-size: 1.2em;
    text-align: center;
}

.analytics-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    justify-content: center;
}

/* Analytics Button Variants */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
}

/* Live Stats Display */
.live-stats {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.live-stats h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #495057;
    font-size: 1em;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 13px;
    border: 1px solid #e9ecef;
}

.stat-label {
    font-weight: bold;
    color: #6c757d;
}

.stat-item span:last-child {
    font-weight: bold;
    color: #495057;
}

/* Special colors for specific stats */
#statRisk {
    font-weight: bold;
}

#statDirectness {
    color: #28a745;
}

#statTime {
    color: #007bff;
}

/* Rating System Styles */
.rating-container {
    display: none;
    margin-top: 5px;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.rating-title {
    font-size: 18px;
    margin-bottom: 15px;
}

.rating-group {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.rating-group label {
    cursor: pointer;
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s;
}

.rating-group input[type="radio"] {
    display: none;
}

.rating-group input[type="radio"]:checked + span {
    font-weight: bold;
    color: #388E3C;
}

.rating-group label:hover {
    background-color: #f0f0f0;
}

.rating-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* Button styles */
button {
    padding: 8px 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #388E3C;
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    text-align: center;
}

/* *** DODANO: Enhanced Modal Styles for Analytics *** */
#summaryModal .modal-content {
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    text-align: left;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 15px;
}

.modal-header h2 {
    margin: 0;
    color: #495057;
}

.summary-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.summary-section h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #495057;
    font-size: 1.1em;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.summary-stat {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #28a745;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.summary-stat .value {
    font-size: 1.8em;
    font-weight: bold;
    color: #007bff;
    display: block;
    margin-bottom: 5px;
}

.summary-stat .label {
    color: #6c757d;
    font-size: 0.9em;
    font-weight: 500;
}

/* Progress bar styles */
.progress-bar {
    width: 100%;
    height: 24px;
    background: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    margin: 10px 0;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    transition: width 0.3s ease;
    border-radius: 12px;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: bold;
    color: #495057;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #333;
}

.modal-title {
    font-size: 24px;
    margin-bottom: 20px;
}

/* Loading spinner */
.loader {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #388E3C;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* *** DODANO: Responsive Design *** */
@media (max-width: 600px) {
    .analytics-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .summary-stats {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .analytics-panel {
        margin-top: 20px;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .stat-item {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .analytics-panel h3 {
        font-size: 1.1em;
    }
    
    .live-stats h4 {
        font-size: 0.9em;
    }
}

/* *** DODANO: Accessibility improvements *** */
.btn:focus, button:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.stat-item:hover {
    background: #e9ecef;
    transition: background-color 0.2s;
}

/* *** DODANO: Animation for stats updates *** */
.stat-item span:last-child {
    transition: color 0.3s ease;
}

.stat-updating {
    color: #007bff !important;
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}