/* style.css - دمج الألوان الجديدة مع الوظائف القديمة */

/* الخطوط والأساسيات */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a2e !important;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(121, 94, 206, 0.4), transparent 30%),
        radial-gradient(circle at 80% 90%, rgba(45, 156, 219, 0.4), transparent 30%) !important;
    min-height: 100vh;
    color: #e0e0e0;
    line-height: 1.6;
    overflow-x: hidden;
}

/* شريط المستخدم العلوي */
.user-status-bar {
    background-color: rgba(17, 17, 34, 0.8)!important;
    backdrop-filter: blur(5px);
    width: 100%;
    color: white;
    padding: 5px 0;
}

.user-status-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-status-bar .btn {
    padding: 8px 15px;
    font-size: 0.9rem;
}

.user-status-bar span {
    font-size: 0.9rem;
}

.user-status-bar a.username-link {
    color: #4facfe;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.user-status-bar a.username-link:hover {
    color: #74b9ff;
    text-decoration: underline;
}

/* الصفحة الرئيسية */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    background: rgba(255, 255, 255, 0.08)!important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 40px 20px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.header h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: #ffffff;
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3), 0 0 20px rgba(189, 147, 249, 0.5);
}

.header p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: #bdc3c7;
    font-weight: 400;
}

.main-content {
    background: rgba(255, 255, 255, 0.08)!important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.game-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.option-card {
    background: rgba(255, 255, 255, 0.08)!important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.option-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.3);
}

.option-card h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.game-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    text-align: right;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #bdc3c7;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.2)!important;
    color: #fff;
    text-align: center;
    transition: all 0.3s ease;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.3) !important;
    border-color: #7d5fff;
    box-shadow: 0 0 15px rgba(125, 95, 255, 0.5);
}

.btn {
    padding: 14px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #7d5fff 0%, #a25fff 100%) !important;
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(125, 95, 255, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #434343 0%, #000000 100%) !important;
    color: white;
    border: 1px solid #7d5fff;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #7d5fff 0%, #a25fff 100%) !important;
    box-shadow: 0 6px 20px rgba(125, 95, 255, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #1d976c 0%, #93f9b9 100%) !important;
    color: #1f2041;
}

.btn-diamond {
    background: linear-gradient(135deg, #717272 0%, #014181 100%) !important;
    color: #ffffff;
    border: none;
}

.error-message {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%) !important;
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.balance-info {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-top: 5px;
}

/* قواعد اللعبة */
.game-rules {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.game-rules h3 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: #fff;
}

.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 15px;
}

.rule-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
    color: #7d5fff;
}

.rule-item strong {
    display: block;
    margin-bottom: 5px;
    color: #fff;
    font-size: 1.1rem;
}

.rule-item p {
    font-size: 0.9rem;
    opacity: 0.8;
    color: #bdc3c7;
}

.footer {
    text-align: center;
    margin-top: 40px;
    color: #bdc3c7;
    font-weight: 500;
}

/* صفحة اللعبة */
.game-body {
    background: #1f2041;
}

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

.game-header {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 20px 30px;
    border-radius: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.game-info h2 {
    color: #fff;
    margin-bottom: 5px;
}

.game-code {
    background: rgba(0,0,0,0.3);
    color: #e0e0e0;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 1rem;
}

.game-code strong {
    color: #f1c40f;
}

/* منطقة الانتظار */
.waiting-area {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.join-form {
    max-width: 400px;
    margin: 0 auto;
}

.join-form h3 {
    color: #fff;
    margin-bottom: 30px;
    font-size: 2rem;
}

.join-form input {
    width: 100%;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-size: 1.1rem;
    margin-bottom: 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
}

.teams-list h3 {
    color: #fff;
    margin-bottom: 20px;
}

.teams-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 30px;
}

/* منطقة اللعبة */
.game-area {
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: 20px;
    height: calc(100vh - 120px);
}

.teams-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.team-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.team-card.current-turn {
    transform: scale(1.02);
    box-shadow: 0 0 25px #7d5fff;
    border-color: #7d5fff;
}

.team-card h3 {
    font-size: 1.6rem;
    color: #fff;
    margin-bottom: 15px;
    text-align: center;
}

.team-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.8;
    color: #bdc3c7;
}

.stat-value {
    display: block;
    font-size: 2rem;
    color: #f1c40f;
    font-weight: bold;
    margin-top: 5px;
}

.player-list {
    list-style: none;
    padding: 0;
    margin-top: 10px;
    text-align: right;
}

.player-list li {
    background: rgba(0,0,0,0.2);
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.player-list .captain {
    font-weight: bold;
    color: #9b59b6;
    border-right: 4px solid #7d5fff;
}

.join-team-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    color: #333;
}

.join-team-card:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.05);
    color: #333;
}

.join-team-card h4,
.join-team-card .team-name {
    color: #333 !important;
    font-weight: bold;
}

.join-team-card .player-list,
.join-team-card .player-list li {
    color: #555 !important;
}

.creator-controls {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(5px);
    padding: 10px 15px;
    border-radius: 15px;
    margin-top: 15px;
}

.creator-controls .form-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    background: transparent;
    padding: 5px;
}

/* منطقة اللعب */
.game-play-area {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* اختيار الأسئلة */
.question-selection h3 {
    color: #fff;
    margin-bottom: 30px;
    font-size: 1.8rem;
}

.questions-list {
    display: grid;
    gap: 15px;
    max-width: 800px;
    width: 100%;
}

.question-item {
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    padding: 20px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 5px solid;
}

.question-item:hover {
    background: rgba(0,0,0,0.4);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.question-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.question-preview h4 {
    text-align: right;
    flex: 1;
    font-size: 1.1rem;
    color: #e0e0e0;
}

.question-price {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 10px;
    font-weight: bold;
    white-space: nowrap;
    font-size: 0.9rem;
}

/* ألوان صعوبة الأسئلة */
.question-item.difficulty-easy {
    border-color: #2ecc71;
}

.question-item.difficulty-easy h4,
.question-item.difficulty-easy .question-price {
    color: #2ecc71;
}

.question-item.difficulty-medium {
    border-color: #f1c40f;
}

.question-item.difficulty-medium h4,
.question-item.difficulty-medium .question-price {
    color: #f1c40f;
}

.question-item.difficulty-hard {
    border-color: #e74c3c;
}

.question-item.difficulty-hard h4,
.question-item.difficulty-hard .question-price {
    color: #e74c3c;
}

/* عرض السؤال */
.question-display {
    max-width: 900px;
    width: 100%;
}

.question-info {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.price-tag,
.turn-info {
    background: rgba(0,0,0,0.3);
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1.1rem;
}

.price-tag {
    color: #f1c40f;
}

.turn-info {
    color: #7d5fff;
}

.question-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
    background: linear-gradient(145deg, #41436a, #262740);
    color: white;
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
}

.question-content h3 {
    margin: 0;
    font-size: 1.8rem;
    line-height: 1.6;
    color: #ffffff;
}

.answer-section {
    display: grid;
    gap: 30px;
}

.answer-form {
    display: flex;
    gap: 15px;
    align-items: center;
}

.answer-form input {
    flex: 1;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-size: 1.1rem;
    background: rgba(255,255,255,0.1);
    color: white;
}

.answer-form input:focus {
    outline: none;
    background: rgba(255,255,255,0.2);
    border-color: #7d5fff;
}

.powerups-section {
    margin-top: 25px;
}

.powerups-section h4 {
    color: #fff;
    margin-bottom: 15px;
}

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

.powerup-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

.powerup-btn:disabled {
    background: #555;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

.info-message {
    text-align: center;
    color: #bdc3c7;
    font-size: 1.2rem;
    padding: 40px;
}

/* مؤقت الإجابة */
.timer-display {
    margin-bottom: 15px;
    font-size: 2rem;
    color: #e74c3c;
    font-weight: bold;
    text-shadow: 0 0 10px #e74c3c;
}

/* شريط التقدم */
.progress-bar {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.progress-info {
    text-align: center;
    margin-bottom: 10px;
    color: #e0e0e0;
    font-weight: 600;
}

.progress-track {
    background: rgba(0,0,0,0.3);
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #7d5fff, #ab5fff);
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 5px;
}

/* مودال نهاية اللعبة */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #1f2041;
    border: 1px solid #7d5fff;
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 0 40px rgba(125, 95, 255, 0.5);
    color: #fff;
}

.modal-content h2 {
    color: #fff;
    margin-bottom: 30px;
    font-size: 2.5rem;
}

.winner-section {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.winner-section h3 {
    font-size: 1.5rem;
}

.final-scores {
    background: rgba(0,0,0,0.3);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.score-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: #e0e0e0;
    font-weight: 600;
}

.score-item:last-child {
    border-bottom: none;
}

.score-item span:last-child {
    color: #f1c40f;
    font-weight: bold;
}

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

/* الخيارات المتقدمة */
.advanced-options {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.advanced-options fieldset {
    border: none;
    padding: 0;
}

.advanced-options fieldset[disabled] {
    opacity: 0.6;
    pointer-events: none;
}

.advanced-options legend {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #fff;
    padding: 0;
    width: 100%;
    text-align: right;
}

.advanced-options .form-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.advanced-options .form-group label {
    margin-bottom: 0;
    font-weight: 500;
    color: #e0e0e0;
    cursor: pointer;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.2);
    transition: .4s;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #7d5fff;
}

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

/* زر الاشتراك المقفل */
.locked-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(0,0,0,0.3);
    border-radius: 20px;
    padding: 8px;
    transition: all 0.3s ease;
}

.locked-toggle:hover {
    background: rgba(0,0,0,0.5);
}

.locked-toggle .lock-icon {
    font-size: 1.2rem;
    color: #ff4b2b;
    margin-bottom: 2px;
}

.locked-toggle .subscribe-text {
    font-size: 0.7rem;
    color: #fad541;
    font-weight: bold;
}

/* تحسينات خاصة بقسم التصنيفات */
.category-selection-container {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 15px;
    margin-top: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.category-search {
    margin-bottom: 15px;
}

.category-search input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9rem;
    text-align: center;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.category-search input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.category-search input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    margin-bottom: 15px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    font-size: 0.85rem;
}

.category-item:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.category-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #4facfe;
    cursor: pointer;
}

.category-item.hidden {
    display: none;
}

.category-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #000000;
    font-weight: 500;
}

.category-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-show-more {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-show-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-show-more .arrow {
    transition: transform 0.3s ease;
    font-size: 0.9rem;
}

.btn-show-more.expanded .arrow {
    transform: rotate(180deg);
}

.category-controls {
    display: flex;
    gap: 8px;
}

.btn-category-control {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    backdrop-filter: blur(5px);
}

.btn-category-control:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* تأثير البحث */
.category-item.search-highlight {
    background: rgba(255, 215, 0, 0.3);
    border-color: rgba(255, 215, 0, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 215, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
}

/* تحسين عرض النتائج الفارغة */
.no-results-message {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    padding: 20px;
    font-style: italic;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin: 10px 0;
}

/* معلومات الرصيد */
#balance-display {
    margin-top: 10px !important;
    padding: 10px 15px !important;
    background: rgba(0, 0, 0, 0.2) !important;
    border-radius: 8px !important;
    color: #e0e0e0 !important;
    font-weight: bold !important;
    font-size: 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: none !important;
}

.dark-icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
    color: #ffffff;
    font-size: 24px;
    flex-shrink: 0;
}

.dark-icon-box i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: inherit;
    text-align: center;
}

/* دعم الصور في الأسئلة */
.question-image-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.question-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    object-fit: contain;
    background: #f8f9fa;
    border: 3px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.question-image:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
}

.question-image-loading {
    display: inline-block;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #bdc3c7;
    font-style: italic;
    font-size: 0.9rem;
}

.result-display .question-image-container {
    margin-bottom: 20px;
}

.result-display .question-image {
    max-height: 200px;
    border-radius: 12px;
}

.question-content:has(.question-image-container) h3 {
    margin-top: 0;
}

.question-image-container img {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.question-image-container img[src] {
    opacity: 1;
}

.question-image-container::before {
    content: "";
    display: block;
    width: 100%;
    height: 200px;
    background: linear-gradient(45deg, rgba(255,255,255,0.05), rgba(255,255,255,0.1));
    border-radius: 15px;
    position: absolute;
    z-index: -1;
}

/* استجابة للأجهزة المحمولة */
@media (max-width: 768px) {
    .user-status-bar .container {
        flex-direction: column;
        gap: 10px;
    }

    .container, .game-container {
        padding: 15px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .game-options {
        grid-template-columns: 1fr;
    }

    .teams-info {
        grid-template-columns: 1fr;
    }

    .game-header {
        flex-direction: column;
        gap: 15px;
    }

    .answer-form {
        flex-direction: column;
    }

    .powerup-buttons {
        flex-direction: column;
        align-items: center;
    }

    .modal-actions {
        flex-direction: column;
    }

    .questions-list {
        grid-template-columns: 1fr;
    }

    .question-preview {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .question-info {
        flex-direction: column;
        gap: 10px;
    }

    .teams-container {
        flex-direction: column;
        gap: 15px;
    }

    .question-image {
        max-height: 220px;
        max-width: 95%;
    }

    .question-content {
        padding: 20px;
        gap: 15px;
    }

    .question-content h3 {
        font-size: 1.4rem;
    }

    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
        gap: 6px;
    }

    .category-item {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .category-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .category-controls {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 20px;
    }

    .option-card {
        padding: 20px;
    }

    .game-play-area {
        padding: 20px;
    }

    .question-content h3 {
        font-size: 1.2rem;
    }

    .modal-content {
        padding: 30px 20px;
    }

    .header {
        padding: 30px 15px;
    }

    .form-group input,
    .form-group select {
        padding: 12px 15px;
        font-size: 0.9rem;
    }

    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    .team-card {
        padding: 20px;
    }

    .team-card h3 {
        font-size: 1.3rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .advanced-options {
        padding: 15px;
    }

    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }

    .category-item {
        padding: 5px 8px;
        font-size: 0.75rem;
    }

    .question-image {
        max-height: 180px;
        border-radius: 10px;
    }

    .result-display .question-image {
        max-height: 150px;
    }

    .question-content {
        padding: 15px;
        gap: 12px;
    }

    .question-content h3 {
        font-size: 1.2rem;
        line-height: 1.4;
    }
}