/* Admin Panel Specific Styles */
.admin-header {
    background-color: var(--primary-color);
    padding: 1.5rem;
}

.admin-main {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    min-height: calc(100vh - 180px);
}

.admin-sidebar {
    width: 250px;
    background-color: var(--primary-color);
    color: white;
    padding: 2rem 0;
    border-radius: 0 0 0 var(--border-radius);
}

.admin-nav {
    list-style-type: none;
}

.admin-nav li {
    margin-bottom: 0.5rem;
}

.admin-nav a {
    display: block;
    padding: 0.8rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s;
    border-right: 4px solid transparent;
}

.admin-nav a:hover, .admin-nav a.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-right-color: var(--accent-color);
}

.admin-content {
    flex: 1;
    padding: 2rem;
    background-color: var(--background-color);
}

.admin-section {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.admin-form .form-group {
    margin-bottom: 1.5rem;
}

.radio-group {
    margin: 0.5rem 0;
}

.small-input {
    width: 80px !important;
    display: inline-block;
    margin: 0 0.5rem;
}

/* Questions Management */
.questions-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.search-bar {
    display: flex;
    align-items: center;
}

.search-bar input {
    width: 300px;
    padding: 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.search-bar button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.7rem 1rem;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    cursor: pointer;
}

.question-list-container {
    margin-bottom: 2rem;
    overflow-x: auto;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.close-modal:hover {
    color: var(--accent-color);
}

/* Options for questions */
.options-section {
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.options-section h4 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.option-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    background-color: white;
    padding: 0.8rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.option-input {
    flex: 1;
}

.option-correct {
    margin: 0 1rem;
    cursor: pointer;
}

.option-remove {
    background-color: var(--danger-color);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

/* Reports section */
.tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: 0.8rem 1.5rem;
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-color);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab-btn.active {
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
}

.tab-content {
    margin-top: 1.5rem;
}

.report-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* Monitor Live Page Styles */
.live-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    border-radius: var(--border-radius);
}

.auto-refresh {
    display: flex;
    align-items: center;
}

.auto-refresh label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auto-refresh select {
    padding: 0.3rem;
    border-radius: var(--border-radius);
    border: none;
}

.monitor-container {
    overflow-x: auto;
    margin-bottom: 2rem;
}

.player-row {
    transition: all 0.5s ease;
}

.player-row.moving-up {
    background-color: rgba(46, 204, 113, 0.2);
}

.player-row.moving-down {
    background-color: rgba(231, 76, 60, 0.2);
}

.player-status {
    font-weight: bold;
}

.player-status.active {
    color: var(--success-color);
}

.player-status.inactive {
    color: var(--text-color);
}

.player-status.complete {
    color: var(--primary-color);
}

.progress-bar-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    position: relative;
    transition: width 0.3s ease;
}

.answer-history {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
    max-width: 120px;
}

.answer-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.answer-indicator.correct {
    background-color: var(--success-color);
}

.answer-indicator.wrong {
    background-color: var(--danger-color);
}

.answer-indicator.timeout {
    background-color: var(--warning-color);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.player-row.new {
    animation: fadeIn 0.5s ease;
}

/* Appearance Customization */
.background-option {
    margin-top: 1rem;
}

.pattern-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 0.5rem;
}

.pattern-option {
    height: 100px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s;
}

.pattern-option:hover, .pattern-option.selected {
    border-color: var(--secondary-color);
    transform: scale(1.05);
}

.pattern-option[data-pattern="pattern1"] {
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%232c3e50' fill-opacity='0.1' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
}

.pattern-option[data-pattern="pattern2"] {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%232c3e50' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.pattern-option[data-pattern="pattern3"] {
    background-image: url("data:image/svg+xml,%3Csvg width='64' height='64' viewBox='0 0 64 64' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 16c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zm0-2c3.314 0 6-2.686 6-6s-2.686-6-6-6-6 2.686-6 6 2.686 6 6 6zm33.414-6l5.95-5.95L45.95.636 40 6.586 34.05.636 32.636 2.05 38.586 8l-5.95 5.95 1.414 1.414L40 9.414l5.95 5.95 1.414-1.414L41.414 8zM40 48c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zm0-2c3.314 0 6-2.686 6-6s-2.686-6-6-6-6 2.686-6 6 2.686 6 6 6zM9.414 40l5.95-5.95-1.414-1.414L8 38.586l-5.95-5.95L.636 34.05 6.586 40l-5.95 5.95 1.414 1.414L8 41.414l5.95 5.95 1.414-1.414L9.414 40z' fill='%232c3e50' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
}

.pattern-option[data-pattern="pattern4"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='24' viewBox='0 0 88 24'%3E%3Cg fill-rule='evenodd'%3E%3Cg id='autumn' fill='%232c3e50' fill-opacity='0.1'%3E%3Cpath d='M10 0l30 15 2 1V2.18A10 10 0 0 0 41.76 0H39.7a8 8 0 0 1 .3 2.18v10.58L14.47 0H10zm31.76 24a10 10 0 0 0-5.29-6.76L4 1 2 0v13.82a10 10 0 0 0 5.53 8.94L10 24h4.47l-6.05-3.02A8 8 0 0 1 4 13.82V3.24l31.58 15.78A8 8 0 0 1 39.7 24h2.06zM78 24l2.47-1.24A10 10 0 0 0 86 13.82V0l-2 1-32.47 16.24A10 10 0 0 0 46.24 24h2.06a8 8 0 0 1 4.12-4.98L84 3.24v10.58a8 8 0 0 1-4.42 7.16L73.53 24H78zm0-24L48 15l-2 1V2.18A10 10 0 0 1 46.24 0h2.06a8 8 0 0 0-.3 2.18v10.58L73.53 0H78z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.pattern-option[data-pattern="pattern5"] {
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%232c3e50' fill-opacity='0.1' fill-rule='evenodd'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3Ccircle cx='13' cy='13' r='3'/%3E%3C/g%3E%3C/svg%3E");
}

.pattern-option[data-pattern="pattern6"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cg fill-rule='evenodd'%3E%3Cg id='hexagons' fill='%232c3e50' fill-opacity='0.1' fill-rule='nonzero'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

@media (max-width: 992px) {
    .admin-main {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        border-radius: 0;
    }
    
    .admin-nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .admin-nav li {
        margin: 0.25rem;
    }
    
    .admin-nav a {
        border-right: none;
        border-bottom: 4px solid transparent;
    }
    
    .admin-nav a:hover, .admin-nav a.active {
        border-bottom-color: var(--accent-color);
    }
}