/* PM Community Quiz Styles */

/* ============================================
   SEZNAM KVÍZŮ
   ============================================ */
.pm-quiz-list-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.pm-quiz-list-header {
    text-align: center;
    margin-bottom: 40px;
}

.pm-quiz-list-header h2 {
    font-size: 2.5em;
    color: #2d3748 !important;
    margin-bottom: 10px;
}

.pm-quiz-list-header p {
    font-size: 1.1em;
    color: #718096 !important;
}

.pm-quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.pm-quiz-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 25px;
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
}

.pm-quiz-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    border-color: #007cba;
}

.pm-quiz-card.completed {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

.pm-quiz-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.pm-quiz-card-header h3 {
    font-size: 1.4em;
    color: #2d3748 !important;
    margin-bottom: 10px;
}

.pm-quiz-description {
    color: #000000 !important;
    font-size: 0.95em;
    line-height: 1.5;
}

.pm-quiz-card-meta {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    padding: 15px 0;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.pm-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #4a5568 !important;
    font-size: 0.9em;
}

.pm-meta-item i {
    color: #007cba;
    font-size: 16px;
}

.pm-quiz-user-score {
    background: #f7fafc;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.pm-score-info, .pm-points-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    color: #2d3748 !important;
}

.pm-score-value {
    font-size: 1.3em;
    font-weight: bold;
    color: #007cba;
}

.pm-points-value {
    font-size: 1.1em;
    font-weight: bold;
    color: #48bb78;
}

.pm-can-improve {
    color: #ed8936;
    font-size: 0.9em;
    margin-top: 10px;
    font-weight: 500;
}

.pm-max-score {
    color: #48bb78;
    font-size: 0.9em;
    margin-top: 10px;
    font-weight: 500;
}

.pm-quiz-card-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pm-quiz-card-actions .pm-btn {
    flex: 1;
    min-width: 120px;
    text-align: center;
    text-decoration: none;
}

@media (max-width: 480px) {
    .pm-quiz-card-actions .pm-btn {
        flex: 1 0 100%;
    }
}

.pm-no-quizzes {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
    font-size: 1.1em;
}

/* ============================================
   JEDNOTLIVÝ KVÍZ
   ============================================ */
.pm-quiz-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.pm-quiz-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    padding: 30px;
    text-align: center;
}

.pm-quiz-title {
    margin: 0 0 15px 0;
    font-size: 28px;
    font-weight: 600;
    color: white !important;
}

.pm-quiz-header .pm-quiz-description {
    margin-bottom: 20px;
    opacity: 0.95;
    font-size: 16px;
    color: white !important;
}

/* Zajistit bílou barvu pro všechny texty v hlavičce */
.pm-quiz-header * {
    color: white !important;
}

.pm-quiz-header h1,
.pm-quiz-header h2,
.pm-quiz-header h3,
.pm-quiz-header p {
    color: white !important;
}

.pm-quiz-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.pm-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.2);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    color: white !important;
}

.pm-stat-icon {
    font-size: 16px;
    color: white !important;
}

.pm-stat-text {
    color: white !important;
}

.pm-quiz-content {
    padding: 30px;
}

/* Quiz Start */
.pm-quiz-start {
    text-align: center;
}

.pm-quiz-instructions {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: left;
}

.pm-quiz-instructions h3 {
    margin-top: 0;
    color: #333;
}

.pm-quiz-instructions ul {
    margin-bottom: 0;
}

.pm-quiz-instructions li {
    margin-bottom: 8px;
}

/* Quiz Completed */
.pm-quiz-completed {
    text-align: center;
    padding: 20px;
}

.pm-completion-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.pm-quiz-completed h3 {
    color: #28a745;
    margin-bottom: 20px;
}

.pm-result-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
}

.pm-score-big {
    font-size: 48px;
    font-weight: bold;
    color: #28a745;
    margin-bottom: 15px;
}

.pm-result-details p {
    margin: 5px 0;
    font-size: 16px;
}

/* Login Required */
.pm-quiz-login-required {
    text-align: center;
    padding: 40px 20px;
}

.pm-login-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.pm-quiz-login-required h3 {
    color: #dc3545;
    margin-bottom: 15px;
}

/* Buttons */
.pm-btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    line-height: 1.4;
}

.pm-btn-primary {
    background: #007cba;
    color: white;
}

.pm-btn-primary:hover {
    background: #005a87;
    color: white;
}

.pm-btn-secondary {
    background: #6c757d;
    color: white;
}

.pm-btn-secondary:hover {
    background: #545b62;
    color: white;
}

.pm-btn-success {
    background: #28a745;
    color: white;
}

.pm-btn-success:hover {
    background: #1e7e34;
    color: white;
}

.pm-btn-large {
    padding: 16px 32px;
    font-size: 18px;
}

/* Quiz Form */
.pm-quiz-form {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 30px;
}

.pm-quiz-progress {
    margin-bottom: 30px;
}

.pm-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.pm-progress-text {
    font-weight: 500;
    color: #333;
}

.pm-timer {
    background: #fff3cd;
    color: #856404;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 500;
}

.pm-progress-bar {
    background: #e9ecef;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
}

.pm-progress-fill {
    background: linear-gradient(90deg, #28a745, #20c997);
    height: 100%;
    transition: width 0.3s ease;
}

/* Questions */
.pm-question {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
}

.pm-question-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 15px;
}

.pm-question-title {
    margin: 0;
    color: #333;
    font-size: 20px;
    line-height: 1.4;
}

.pm-question-points {
    background: #ffc107;
    color: #212529;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.pm-question-answers {
    margin-bottom: 25px;
}

.pm-answer-option {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pm-answer-option:hover {
    border-color: #007cba;
    background: #f0f8ff;
}

.pm-answer-option input[type="radio"] {
    display: none;
}

.pm-answer-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #dee2e6;
    border-radius: 50%;
    margin-right: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.pm-answer-option input[type="radio"]:checked + .pm-answer-radio {
    border-color: #007cba;
    background: #007cba;
}

.pm-answer-option input[type="radio"]:checked + .pm-answer-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.pm-answer-text {
    flex: 1;
    font-size: 16px;
    line-height: 1.4;
}

.pm-text-answer {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.pm-text-answer:focus {
    outline: none;
    border-color: #007cba;
}

.pm-question-explanation {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 15px;
    margin-top: 15px;
    border-radius: 0 4px 4px 0;
}

.pm-question-explanation h4 {
    margin: 0 0 10px 0;
    color: #1976d2;
}

.pm-question-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.pm-question-navigation .pm-btn {
    min-width: 120px;
}

/* Responsive */
@media (max-width: 768px) {
    .pm-quiz-wrapper {
        margin: 0;
        border-radius: 0;
    }
    
    .pm-quiz-header {
        padding: 20px;
    }
    
    .pm-quiz-title {
        font-size: 24px;
    }
    
    .pm-quiz-content {
        padding: 20px;
    }
    
    .pm-quiz-stats {
        gap: 10px;
    }
    
    .pm-stat {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .pm-question {
        padding: 20px;
    }
    
    .pm-question-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .pm-question-title {
        font-size: 18px;
    }
    
    .pm-progress-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .pm-question-navigation {
        flex-direction: column;
    }
    
    .pm-question-navigation .pm-btn {
        width: 100%;
    }
}

/* Loading states */
.pm-quiz-loading {
    opacity: 0.6;
    pointer-events: none;
}

.pm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Success animations */
@keyframes checkmark {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.pm-completion-icon {
    animation: checkmark 0.6s ease-in-out;
}

/* Modal Styles */
.pm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

.pm-modal {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    margin: 20px;
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    animation: modalSlideIn 0.3s ease 0.1s forwards;
}

.pm-modal-header {
    background: #007cba;
    color: white;
    padding: 20px;
    border-radius: 10px 10px 0 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.pm-modal-icon {
    font-size: 24px;
}

.pm-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.pm-modal-body {
    padding: 25px;
}

.pm-modal-body p {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
}

.pm-modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.pm-modal-confirm .pm-modal-footer {
    justify-content: space-between;
}

/* Modal Animations */
@keyframes fadeIn {
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    to { 
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Modal Responsive */
@media (max-width: 600px) {
    .pm-modal {
        width: 95%;
        margin: 10px;
    }
    
    .pm-modal-header {
        padding: 15px;
    }
    
    .pm-modal-title {
        font-size: 18px;
    }
    
    .pm-modal-body {
        padding: 20px;
    }
    
    .pm-modal-footer {
        padding: 15px 20px;
        flex-direction: column;
    }
    
    .pm-modal-confirm .pm-modal-footer {
        flex-direction: column-reverse;
    }
    
    .pm-modal-footer .pm-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Leaderboard Styles */
.pm-modal-leaderboard {
    max-width: 90%;
    width: 700px;
}

.pm-leaderboard {
    margin-top: 20px;
    overflow-x: auto;
}

.pm-leaderboard-wrapper {
    min-width: 500px;
}

.pm-leaderboard-header {
    display: grid;
    grid-template-columns: 50px minmax(120px, 1fr) 80px 80px 100px;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.pm-leaderboard-row {
    display: grid;
    grid-template-columns: 50px minmax(120px, 1fr) 80px 80px 100px;
    gap: 10px;
    padding: 12px 10px;
    border-bottom: 1px solid #e9ecef;
    align-items: center;
    transition: background 0.2s ease;
}

.pm-leaderboard-row:hover {
    background: #f8f9fa;
}

.pm-leaderboard-row.gold {
    background: linear-gradient(90deg, rgba(255,215,0,0.1) 0%, transparent 100%);
}

.pm-leaderboard-row.silver {
    background: linear-gradient(90deg, rgba(192,192,192,0.1) 0%, transparent 100%);
}

.pm-leaderboard-row.bronze {
    background: linear-gradient(90deg, rgba(205,127,50,0.1) 0%, transparent 100%);
}

.pm-rank {
    font-weight: bold;
    text-align: center;
    font-size: 18px;
}

.pm-leaderboard-row.gold .pm-rank {
    color: #FFD700;
}

.pm-leaderboard-row.silver .pm-rank {
    color: #C0C0C0;
}

.pm-leaderboard-row.bronze .pm-rank {
    color: #CD7F32;
}

.pm-user {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.pm-user-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #2d3748;
    transition: color 0.2s ease;
    min-width: 0;
}

.pm-user-link:hover {
    color: #007cba;
}

.pm-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pm-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pm-score {
    font-weight: bold;
    color: #007cba;
    text-align: center;
}

.pm-time {
    text-align: center;
    color: #666;
}

.pm-date {
    text-align: center;
    color: #666;
    font-size: 13px;
}

.pm-modal-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    margin-left: auto;
}

/* Responsive Leaderboard */
@media (max-width: 768px) {
    .pm-modal-leaderboard {
        width: 95%;
        max-width: none;
    }
    
    .pm-leaderboard-header,
    .pm-leaderboard-row {
        grid-template-columns: 40px minmax(100px, 1fr) 60px 60px;
    }
    
    .pm-leaderboard-header > span:last-child,
    .pm-leaderboard-row > span:last-child {
        display: none;
    }
    
    .pm-rank {
        font-size: 16px;
    }
    
    .pm-avatar {
        width: 28px;
        height: 28px;
    }
    
    .pm-score {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .pm-leaderboard-header,
    .pm-leaderboard-row {
        grid-template-columns: 35px 1fr 50px;
    }
    
    .pm-leaderboard-header > span:nth-child(4),
    .pm-leaderboard-row > span:nth-child(4) {
        display: none;
    }
    
    .pm-avatar {
        width: 24px;
        height: 24px;
    }
}