/**
 * Group Play Quiz Styles
 * Mobile-first responsive design
 */

/* CSS Variables for viewport height (handles mobile keyboard) */
:root {
    --vh: 1vh;
}

/* Body scroll lock when modal is open */
body.kqr-modal-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
}

/* Full-screen page lock for mobile stability */
body.kqr-lock {
    overflow: hidden !important;
    height: 100vh !important;
    width: 100% !important;
    position: fixed !important;
    top: 0;
    left: 0;
}

/* Base Wrapper */
.kqr-group-play-wrapper {
    max-width: 100%;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

* {
    box-sizing: border-box;
}

/* Initial Button */
.kqr-gp-initial {
    text-align: center;
    padding: 40px 20px;
}

.kqr-gp-button-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-bottom: 32px;
}

.kqr-gp-main-btn,
.kqr-gp-new-match-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px 40px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 60px;
    touch-action: manipulation;
}

.kqr-gp-main-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
}

.kqr-gp-main-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.kqr-gp-new-match-btn {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    box-shadow: 0 2px 8px rgba(17, 153, 142, 0.25);
}

.kqr-gp-new-match-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(17, 153, 142, 0.3);
}

.kqr-gp-main-btn:active,
.kqr-gp-new-match-btn:active {
    transform: translateY(0);
}

.kqr-gp-btn-icon {
    font-size: 1.5rem;
}

/* Lobby Panel */
.kqr-gp-lobby {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 24px;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    max-height: calc(var(--vh, 1vh) * 100);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.kqr-gp-lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.kqr-gp-lobby-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.kqr-gp-lobby-section-header {
    margin-bottom: 16px;
}

.kqr-gp-lobby-section-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #667eea;
    font-weight: 600;
}

.kqr-gp-lobby-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, #e0e0e0, transparent);
    margin: 24px 0;
}

.kqr-gp-lobby-active-match {
    margin-bottom: 24px;
}

.kqr-gp-active-match-card {
    background: linear-gradient(135deg, #f6f8fb 0%, #e9ecf5 100%);
    border: 2px solid #667eea;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.kqr-gp-active-match-card .kqr-gp-match-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kqr-gp-active-match-card .kqr-gp-match-status {
    font-size: 1.2rem;
    animation: pulse-green 1.5s infinite;
}

@keyframes pulse-green {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.kqr-gp-active-match-card .kqr-gp-match-meta {
    font-size: 0.9rem;
    color: #666;
    margin-top: 4px;
}

.kqr-gp-new-match-btn-lobby {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.3);
    transition: all 0.3s ease;
    touch-action: manipulation;
}

.kqr-gp-new-match-btn-lobby:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(17, 153, 142, 0.4);
}

.kqr-gp-new-match-btn-lobby:active {
    transform: translateY(0);
}

.kqr-gp-close-btn {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.kqr-gp-close-btn:hover {
    color: #333;
}

/* Registration */
.kqr-gp-registration {
    margin-bottom: 24px;
}

.kqr-gp-input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    position: relative;
}

.kqr-gp-input {
    flex: 1;
    padding: 14px 16px;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    background-color: #fff;
}

.kqr-gp-input:focus {
    outline: none;
    border-color: #667eea;
    /* Prevent iOS zoom on focus */
    font-size: 16px;
}

.kqr-gp-btn-primary {
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: #667eea;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
    min-height: 48px;
    touch-action: manipulation;
    white-space: nowrap;
}

.kqr-gp-btn-primary:hover {
    background: #5568d3;
}

.kqr-gp-btn-primary:active {
    transform: scale(0.98);
}

.kqr-gp-player-count {
    text-align: center;
    font-size: 0.95rem;
    color: #666;
}

/* Player List */
.kqr-gp-player-list {
    margin-bottom: 24px;
    min-height: 100px;
}

.kqr-gp-empty {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-style: italic;
}

.kqr-gp-player-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background 0.2s ease;
}

.kqr-gp-player-item:hover {
    background: #e9ecef;
}

.kqr-gp-player-avatar {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 50%;
}

.kqr-gp-player-name {
    flex: 1;
    font-weight: 600;
    color: #333;
}

.kqr-gp-player-score {
    font-size: 0.9rem;
    color: #667eea;
    font-weight: 600;
}

.kqr-gp-player-remove {
    background: #dc3545;
    color: #fff;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    transition: background 0.2s ease;
}

.kqr-gp-player-remove:hover {
    background: #c82333;
}

/* Actions */
.kqr-gp-actions {
    text-align: center;
}

.kqr-gp-btn-success {
    padding: 16px 32px;
    font-size: 1.125rem;
    font-weight: 700;
    color: #fff;
    background: #28a745;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 52px;
    touch-action: manipulation;
}

.kqr-gp-btn-success:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-2px);
}

.kqr-gp-btn-success:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.kqr-gp-requirement {
    margin-top: 12px;
    font-size: 0.9rem;
    color: #999;
}

/* Match Panel - Fixed Modal */
.kqr-gp-match {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

/* Match Modal - Fixed positioning with overlay */
.kqr-match-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overscroll-behavior: contain;
}

.kqr-match-modal-inner {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    position: relative;
}

.kqr-gp-match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.kqr-gp-match-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
    font-weight: 700;
}

.kqr-gp-match-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kqr-gp-new-match-btn-header {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(17, 153, 142, 0.3);
    transition: all 0.3s ease;
    touch-action: manipulation;
    white-space: nowrap;
}

.kqr-gp-new-match-btn-header:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(17, 153, 142, 0.4);
}

.kqr-gp-new-match-btn-header:active:not(:disabled) {
    transform: translateY(0);
}

.kqr-gp-new-match-btn-header:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: linear-gradient(135deg, #999 0%, #bbb 100%);
}

.kqr-gp-new-match-btn-header .kqr-gp-btn-icon {
    font-size: 1rem;
}

.kqr-gp-close-match-btn {
    background: transparent;
    border: none;
    font-size: 2.5rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 50%;
    touch-action: manipulation;
}

.kqr-gp-close-match-btn:hover {
    color: #333;
    background: #f0f0f0;
}

.kqr-gp-close-match-btn:active {
    transform: scale(0.95);
}

/* Scoreboard - Compact */
.kqr-gp-scoreboard {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.kqr-gp-scoreboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.kqr-gp-scoreboard-header h3 {
    margin: 0;
    font-size: 1rem;
}

.kqr-gp-round-info {
    font-size: 0.9rem;
    font-weight: 600;
}

.kqr-gp-scoreboard-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kqr-gp-score-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    transition: background 0.2s ease;
}

.kqr-gp-score-item.kqr-gp-active-turn {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 2px #fff;
}

.kqr-gp-score-rank {
    font-weight: 700;
    font-size: 0.95rem;
    min-width: 32px;
}

.kqr-gp-score-avatar {
    font-size: 1.1rem;
}

.kqr-gp-score-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.9rem;
}

.kqr-gp-score-points {
    font-weight: 700;
    font-size: 0.95rem;
}

.kqr-gp-turn-badge {
    color: #ffd700;
    font-size: 1rem;
}

/* Question Panel - Compact */
.kqr-gp-question-panel {
    margin-bottom: 16px;
}

.kqr-gp-turn-feedback-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.kqr-gp-turn-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    width: fit-content;
}

.kqr-gp-turn-label {
    font-size: 0.8rem;
    color: #666;
    margin-right: 0;
}

.kqr-gp-turn-player {
    font-size: 0.9rem;
    font-weight: 700;
    color: #667eea;
}

.kqr-gp-question-content h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: #333;
}

.kqr-gp-question-meta {
    margin: 10px 0;
}

.kqr-gp-points-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #667eea;
    color: #fff;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Options */
.kqr-gp-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.kqr-gp-option {
    padding: 14px 16px;
    font-size: 0.95rem;
    text-align: left;
    color: #222;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 48px;
    touch-action: manipulation;
}

.kqr-gp-option:hover:not(:disabled) {
    color: #222;
    background: #f0f7ff;
    border-color: #667eea;
}

.kqr-gp-option:active:not(:disabled) {
    transform: scale(0.98);
}

.kqr-gp-option:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.kqr-gp-option.kqr-gp-correct {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
    font-weight: 600;
}

.kqr-gp-option.kqr-gp-incorrect {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

/* Feedback - Inline Badge */
.kqr-gp-feedback {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    margin-left: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    vertical-align: middle;
}

.kqr-gp-feedback-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #28a745;
}

.kqr-gp-feedback-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #dc3545;
}

/* Match Controls - Side by Side */
.kqr-gp-match-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
}

.kqr-gp-btn-secondary {
    flex: 1;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    touch-action: manipulation;
    min-height: 40px;
}

.kqr-gp-btn-secondary:hover {
    background: #e9ecef;
    border-color: #ccc;
}

.kqr-gp-btn-danger {
    flex: 1;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: #dc3545;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    touch-action: manipulation;
    min-height: 40px;
}

.kqr-gp-btn-danger:hover {
    background: #c82333;
}

/* Results Modal */
.kqr-gp-results-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.kqr-gp-results-content {
    background: #fff;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.kqr-gp-results-header {
    padding: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 12px 12px 0 0;
}

.kqr-gp-results-header h2 {
    margin: 0;
    font-size: 1.75rem;
}

.kqr-gp-results-body {
    padding: 24px;
}

.kqr-gp-winner-announce {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 24px;
    padding: 20px;
    background: #f0f7ff;
    border-radius: 8px;
}

.kqr-gp-results-table {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kqr-gp-result-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.kqr-gp-result-row:first-child {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    font-weight: 700;
}

.kqr-gp-result-rank {
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 60px;
}

.kqr-gp-result-avatar {
    font-size: 1.5rem;
}

.kqr-gp-result-name {
    flex: 1;
    font-weight: 600;
}

.kqr-gp-result-score {
    font-weight: 700;
    font-size: 1.1rem;
    color: #667eea;
}

.kqr-gp-result-stats {
    font-size: 0.9rem;
    color: #666;
}

.kqr-gp-results-actions {
    padding: 24px;
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Toast Notifications */
.kqr-gp-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kqr-gp-toast {
    padding: 16px 24px;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.25s ease;
}

.kqr-gp-toast-show {
    opacity: 1;
    transform: translateX(0);
}

.kqr-gp-toast-success {
    background: #28a745;
}

.kqr-gp-toast-error {
    background: #dc3545;
}

.kqr-gp-toast-info {
    background: #764ba2;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .kqr-group-play-wrapper {
        margin: 12px;
    }
    
    /* Match Modal - Full screen on mobile */
    .kqr-match-modal {
        padding: 0;
        border-radius: 0;
    }
    
    .kqr-match-modal-inner {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        padding: 16px;
    }

    .kqr-gp-lobby,
    .kqr-gp-match {
        padding: 16px;
        max-height: calc(var(--vh, 1vh) * 95);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Two-column grid for answer options */
    .kqr-gp-options {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .kqr-gp-option {
        padding: 12px;
        font-size: 0.9rem;
        min-height: 44px;
    }
    
    /* Prevent input zoom on iOS */
    .kqr-gp-input {
        font-size: 16px;
    }

    .kqr-gp-input-group {
        flex-direction: column;
    }

    .kqr-gp-btn-primary {
        width: 100%;
    }

    .kqr-gp-toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .kqr-gp-toast {
        min-width: auto;
        width: 100%;
    }

    .kqr-gp-results-actions {
        flex-direction: column;
    }

    .kqr-gp-results-actions button {
        width: 100%;
    }
    
    /* Ensure modals stay visible when keyboard opens */
    .kqr-gp-lobby {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        max-width: 100%;
        border-radius: 0;
        margin: 0;
    }
}

@media (max-width: 480px) {
    .kqr-gp-main-btn {
        padding: 16px 28px;
        font-size: 1.1rem;
    }

    .kqr-gp-lobby-header h2 {
        font-size: 1.25rem;
    }
    
    /* Compact scoreboard on small screens */
    .kqr-gp-scoreboard {
        padding: 10px;
    }
    
    .kqr-gp-scoreboard-header h3 {
        font-size: 0.95rem;
    }
    
    .kqr-gp-score-item {
        padding: 6px;
        gap: 6px;
    }
    
    .kqr-gp-score-name {
        font-size: 0.85rem;
    }
    
    /* Additional keyboard handling for small screens */
    .kqr-gp-input {
        font-size: 16px; /* Prevent iOS zoom */
    }
    
    .kqr-gp-lobby {
        padding: 12px;
    }
    
    /* Match header responsive */
    .kqr-gp-match-header {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .kqr-gp-match-header h2 {
        width: 100%;
        font-size: 1.25rem;
    }
    
    .kqr-gp-match-header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .kqr-gp-new-match-btn-header {
        flex: 1;
    }
    
    .kqr-gp-close-match-btn {
        width: 36px;
        height: 36px;
        font-size: 2rem;
    }
}

/* Active Matches Section */
.kqr-gp-active-matches {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.kqr-gp-active-matches h3 {
    margin: 0 0 16px 0;
    font-size: 1.1rem;
    color: #333;
    text-align: center;
    font-weight: 600;
}

.kqr-gp-active-match-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    margin-bottom: 10px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.kqr-gp-active-match-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
    border-color: #ccc;
}

.kqr-gp-active-match-btn.disabled:hover {
    transform: none;
    border-color: #ccc;
    background: #f5f5f5;
}

.kqr-gp-active-match-btn:hover {
    border-color: #667eea;
    background: #f0f3ff;
    transform: translateX(2px);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.12);
}

.kqr-gp-active-match-btn:active {
    transform: translateX(1px);
}

.kqr-gp-active-match-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.kqr-gp-match-status {
    font-size: 1.2rem;
    flex-shrink: 0;
    animation: pulse-green 2s ease-in-out infinite;
}

.kqr-gp-active-match-btn.disabled .kqr-gp-match-status {
    animation: none;
    opacity: 0.5;
}

@keyframes pulse-green {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.kqr-gp-match-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kqr-gp-match-title {
    font-weight: 600;
    font-size: 1rem;
    color: #333;
}

.kqr-gp-match-meta {
    font-size: 0.85rem;
    color: #666;
}

.kqr-gp-match-spinner {
    margin-left: auto;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive active matches */
@media (max-width: 768px) {
    .kqr-gp-active-matches {
        padding: 16px;
    }

    .kqr-gp-active-match-btn {
        padding: 12px 14px;
    }
    
    .kqr-gp-match-details {
        gap: 6px;
    }
    
    .kqr-gp-match-title {
        font-size: 0.95rem;
    }
    
    .kqr-gp-match-meta {
        font-size: 0.8rem;
        line-height: 1.3;
    }
}

/* Bulk Selection Styles */
.kqr-gp-matches-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.kqr-gp-matches-header h3 {
    margin: 0;
}

.kqr-gp-bulk-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.kqr-gp-select-all-container {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: #666;
    cursor: pointer;
    user-select: none;
}

.kqr-gp-select-all-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.kqr-gp-match-item-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.kqr-gp-match-checkbox {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    cursor: pointer;
    margin-top: 0;
}

.kqr-gp-match-item-wrapper .kqr-gp-active-match-btn {
    flex: 1;
    margin-bottom: 0;
}

.kqr-gp-bulk-delete-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.kqr-gp-bulk-delete-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.kqr-gp-bulk-delete-btn:active:not(:disabled) {
    transform: translateY(0);
}

.kqr-gp-bulk-delete-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #ccc;
}

.kqr-gp-bulk-delete-btn .kqr-gp-btn-icon {
    font-size: 1rem;
}

.kqr-gp-bulk-delete-btn .kqr-gp-selected-count {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Progress Overlay */
.kqr-gp-progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kqr-gp-progress-modal {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.kqr-gp-progress-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 16px;
    text-align: center;
}

.kqr-gp-progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.kqr-gp-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.kqr-gp-progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
}

/* Undo Toast */
.kqr-gp-toast.kqr-gp-toast-undo {
    background: #ff9800;
    min-width: 320px;
}

.kqr-gp-toast-undo-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.kqr-gp-undo-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #ff9800;
    background: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kqr-gp-undo-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Responsive bulk actions */
@media (max-width: 768px) {
    .kqr-gp-matches-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .kqr-gp-bulk-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .kqr-gp-bulk-delete-btn {
        flex: 1;
    }
}
