/* ========================================
   استایل‌های بازی معمای جنایی
   نسخه: 1.0 - کامل و ریسپانسیو
   ======================================== */

/* ریست و تنظیمات پایه */
.mystery-game-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
    direction: rtl;
    text-align: right;
    line-height: 1.6;
}

.mystery-game-wrapper * {
    box-sizing: border-box;
}

/* کانتینر اصلی */
.mystery-game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
}

/* ========================================
   هدر بازی
   ======================================== */
.mg-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px 30px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    color: white;
}

.mg-mystery-info h2 {
    margin: 0 0 10px;
    font-size: 28px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.mg-difficulty {
    display: inline-block;
    padding: 6px 18px;
    background: rgba(255,255,255,0.3);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
}

.mg-game-stats {
    display: flex;
    gap: 30px;
    margin-top: 15px;
}

.mg-stat {
    text-align: center;
    background: rgba(255,255,255,0.15);
    padding: 12px 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.mg-stat-label {
    display: block;
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mg-stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: white;
}

/* ========================================
   نوار پیشرفت
   ======================================== */
.mg-progress-bar {
    height: 8px;
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 25px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.mg-progress {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.5);
}

/* ========================================
   محتوای مرحله
   ======================================== */
.mg-stage-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    min-height: 500px;
    margin-bottom: 20px;
}

.mg-stage-header {
    margin-bottom: 30px;
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 2px solid #f1f3f5;
}

.mg-stage-title {
    font-size: 26px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 10px;
}

.mg-stage-description {
    color: #6c757d;
    font-size: 16px;
    margin: 0;
}

/* ========================================
   لودینگ و خطاها
   ======================================== */
.mg-loading {
    text-align: center;
    padding: 80px 20px;
}

.mg-loading-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: mg-spin 1s linear infinite;
}

@keyframes mg-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.mg-loading p {
    color: #6c757d;
    font-size: 16px;
    margin: 0;
}

.mg-error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.mg-error h3 {
    margin: 0 0 15px;
    font-size: 22px;
}

.mg-error p {
    margin: 10px 0;
    font-size: 16px;
    opacity: 0.95;
}

/* ========================================
   دکمه‌ها
   ======================================== */
.mg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.mg-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.mg-btn:active {
    transform: translateY(0);
}

.mg-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.mg-btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a4193 100%);
}

.mg-btn-secondary {
    background: #6c757d;
    color: white;
}

.mg-btn-secondary:hover {
    background: #5a6268;
}

.mg-btn-success {
    background: linear-gradient(135deg, #51cf66 0%, #37b24d 100%);
    color: white;
}

.mg-btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
}

/* ========================================
   ناوبری
   ======================================== */
.mg-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.mg-btn-prev,
.mg-btn-next {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    color: white;
    flex: 1;
    max-width: 200px;
}

.mg-btn-prev:hover,
.mg-btn-next:hover {
    background: linear-gradient(135deg, #343a40 0%, #23272b 100%);
}

.mg-btn-next {
    margin-right: auto;
}

.mg-btn-prev {
    margin-left: auto;
}

/* ========================================
   مرحله 1 - معرفی
   ======================================== */
.mg-stage-1 {
    animation: mg-fadeIn 0.5s ease;
}

@keyframes mg-fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mg-stage-image {
    margin-bottom: 25px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.mg-stage-image img {
    width: 100%;
    height: auto;
    max-height: 450px;
    object-fit: cover;
    display: block;
}

.mg-case-description {
    line-height: 1.8;
    font-size: 16px;
    color: #495057;
    margin-bottom: 25px;
}

.mg-case-description p {
    margin-bottom: 15px;
}

.mg-case-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 25px 0;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
}

.mg-detail-item {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.mg-detail-item strong {
    display: block;
    margin-bottom: 8px;
    color: #6c757d;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mg-detail-item span {
    font-size: 16px;
    color: #2c3e50;
    font-weight: 600;
}

.mg-instruction-box {
    background: linear-gradient(135deg, #e7f3ff 0%, #d0e7ff 100%);
    border-right: 5px solid #667eea;
    padding: 25px;
    border-radius: 12px;
    margin: 25px 0;
}

.mg-instruction-box h4 {
    margin: 0 0 15px;
    color: #2c3e50;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mg-instruction-box ul {
    margin: 0;
    padding-right: 25px;
    list-style: none;
}

.mg-instruction-box li {
    margin: 12px 0;
    color: #495057;
    position: relative;
    padding-right: 25px;
}

.mg-instruction-box li:before {
    content: '✓';
    position: absolute;
    right: 0;
    color: #51cf66;
    font-weight: 700;
    font-size: 18px;
}

/* ========================================
   مرحله 2 - سرنخ‌ها
   ======================================== */
.mg-clues-stats {
    text-align: center;
    margin-bottom: 25px;
    padding: 15px;
    background: linear-gradient(135deg, #fff3bf 0%, #ffe066 100%);
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    color: #856404;
}

.mg-scene-image {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    margin: 30px 0;
}

.mg-clue-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.mg-clue-marker:hover {
    transform: translate(-50%, -50%) scale(1.2);
    z-index: 20;
}

.mg-marker-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.6);
    border: 3px solid white;
    animation: mg-pulse 2s infinite;
}

.mg-clue-marker.mg-found .mg-marker-icon {
    background: linear-gradient(135deg, #51cf66 0%, #37b24d 100%);
    box-shadow: 0 4px 15px rgba(81, 207, 102, 0.6);
    animation: none;
}

@keyframes mg-pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(255, 107, 107, 0.6);
    }
    50% {
        box-shadow: 0 4px 25px rgba(255, 107, 107, 0.9), 0 0 0 10px rgba(255, 107, 107, 0.1);
    }
}

.mg-marker-label {
    position: absolute;
    top: 55px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 8px 14px;
    border-radius: 8px;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.mg-clue-marker:hover .mg-marker-label {
    opacity: 1;
}

.mg-found-clues {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.mg-clue-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.mg-clue-card:hover {
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    transform: translateY(-3px);
}

.mg-clue-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.mg-clue-content h5 {
    margin: 0 0 10px;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 700;
}

.mg-clue-content p {
    margin: 0 0 12px;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.6;
}

.mg-clue-points {
    display: inline-block;
    background: linear-gradient(135deg, #ffd43b 0%, #fab005 100%);
    color: #495057;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(250, 176, 5, 0.3);
}

/* ========================================
   مرحله 3 - مظنونین
   ======================================== */
.mg-suspects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.mg-suspect-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.mg-suspect-card:hover {
    border-color: #667eea;
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.2);
    transform: translateY(-5px);
}

.mg-suspect-avatar {
    width: 130px;
    height: 130px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #e9ecef;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.mg-suspect-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mg-suspect-info h4 {
    margin: 0 0 8px;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 700;
}

.mg-suspect-role {
    color: #6c757d;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mg-suspect-description {
    color: #495057;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.mg-btn-interview {
    background: linear-gradient(135deg, #9775fa 0%, #845ef7 100%);
    color: white;
    width: 100%;
}

.mg-btn-interview:hover {
    background: linear-gradient(135deg, #845ef7 0%, #7950f2 100%);
}

/* ========================================
   مودال‌ها
   ======================================== */
.mg-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.75);
    overflow: auto;
    animation: mg-fadeIn 0.3s ease;
    backdrop-filter: blur(5px);
}

.mg-modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: mg-slideUp 0.3s ease;
}

@keyframes mg-slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mg-modal-close {
    color: #aaa;
    float: left;
    font-size: 32px;
    font-weight: 700;
    padding: 15px 25px;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.mg-modal-close:hover {
    color: #000;
}

.mg-modal-body {
    padding: 25px 35px 35px;
}

/* ========================================
   ریسپانسیو - موبایل
   ======================================== */
@media (max-width: 768px) {
    .mystery-game-container {
        padding: 15px;
        border-radius: 10px;
    }
    
    .mg-header {
        padding: 20px;
    }
    
    .mg-mystery-info h2 {
        font-size: 20px;
    }
    
    .mg-game-stats {
        width: 100%;
        justify-content: space-around;
        gap: 15px;
    }
    
    .mg-stat {
        flex: 1;
        padding: 10px;
    }
    
    .mg-stat-value {
        font-size: 20px;
    }
    
    .mg-stage-container {
        padding: 20px 15px;
        min-height: 400px;
    }
    
    .mg-stage-title {
        font-size: 20px;
    }
    
    .mg-scene-image {
        padding-bottom: 75%;
    }
    
    .mg-marker-icon {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .mg-suspects-grid,
    .mg-found-clues {
        grid-template-columns: 1fr;
    }
    
    .mg-modal-content {
        margin: 10% 15px;
        max-width: 100%;
    }
    
    .mg-navigation {
        flex-direction: column;
    }
    
    .mg-btn-prev,
    .mg-btn-next {
        max-width: 100%;
    }
    
    .mg-case-details {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .mg-mystery-info h2 {
        font-size: 18px;
    }
    
    .mg-stage-container {
        padding: 15px 12px;
    }
    
    .mg-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* ========================================
   انیمیشن‌های اضافی
   ======================================== */
.mg-new-clue {
    animation: mg-bounceIn 0.6s ease;
}

@keyframes mg-bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

/* ========================================
   پرینت
   ======================================== */
@media print {
    .mg-navigation,
    .mg-modal {
        display: none !important;
    }
}