/* 
   Maturitní četba Plugin Styles - Modern Redesign
   Scoped under .maturitni-cetba-wrapper
*/

.maturitni-cetba-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    color: #212529;
    max-width: 1200px; /* Wider for new layout */
    margin: 0 auto;
    padding: 20px 0;
}

.maturitni-cetba-wrapper h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #343a40;
}

.mc-section-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.mc-count-info {
    font-size: 1rem;
    font-weight: normal;
    color: #6c757d;
}

/* --- CARDS & LAYOUT --- */
.mc-dashboard-grid {
    display: grid;
    grid-template-columns: 350px 1fr; /* Fixed width for User Info, rest for Rules */
    gap: 20px;
    margin-bottom: 20px;
}

.mc-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1.25rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.mc-card-title {
    border-bottom: 2px solid #f1f3f5;
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #495057;
}

/* --- INPUTS --- */
.mc-form-group {
    margin-bottom: 1rem;
}

.mc-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: #495057;
}

.mc-input {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    box-sizing: border-box;
}

.mc-input:focus {
    color: #495057;
    background-color: #fff;
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* --- RULES LIST --- */
.mc-rules-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* Responsive columns */
    column-gap: 30px;
    row-gap: 10px;
}

.mc-rule {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #f1f3f5;
}

.mc-rule:last-child { border-bottom: none; }

.mc-rule-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
    position: relative;
}

/* States */
.mc-rule-incomplete .mc-rule-icon {
    background: #ffe3e3;
    border: 1px solid #ffa8a8;
}
.mc-rule-incomplete .mc-rule-icon::after {
    content: '×';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -55%);
    color: #c92a2a;
    font-weight: bold;
    line-height: 1;
    font-size: 16px;
}
.mc-rule-incomplete .mc-rule-text { color: #495057; }

.mc-rule-complete .mc-rule-icon {
    background: #d3f9d8;
    border: 1px solid #b2f2bb;
}
.mc-rule-complete .mc-rule-icon::after {
    content: '✓';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: #2b8a3e;
    font-weight: bold;
    font-size: 12px;
}
.mc-rule-complete .mc-rule-text { color: #2b8a3e; font-weight: 500; opacity: 1; text-decoration: none; }

.mc-rule-value {
    margin-left: auto;
    font-size: 0.75rem;
    background: #f1f3f5;
    padding: 3px 8px;
    border-radius: 12px;
    color: #868e96;
    font-weight: 600;
    white-space: nowrap;
}

/* --- FILTERS (PILLS) --- */
.mc-filters-card {
    margin-bottom: 20px;
}

.mc-filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.mc-filter-col {
    flex: 1;
    min-width: 250px;
}

.mc-filter-col strong {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #495057;
}

.mc-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.mc-pill {
    cursor: pointer;
    margin: 0;
}

.mc-pill input {
    display: none; /* Hide actual checkbox */
}

.mc-pill span {
    display: inline-block;
    padding: 5px 12px;
    font-size: 0.85rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 50px;
    color: #495057;
    transition: all 0.2s;
    user-select: none;
}

.mc-pill input:checked + span {
    background: #e7f5ff;
    border-color: #74c0fc;
    color: #1864ab;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.mc-pill:hover span {
    background: #e9ecef;
}

/* --- RANDOM BUTTON --- */
.mc-random-wrapper {
    text-align: center;
    margin-top: 15px;
    border-top: 1px solid #f1f3f5;
    padding-top: 15px;
}

.mc-btn-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 20px;
    font-size: 0.9rem;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.mc-btn-secondary:hover {
    background-color: #5a6268;
}

/* --- TABLE --- */
.mc-table-container {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1.25rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.mc-table-responsive {
    overflow-x: auto;
}

.mc-works-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.mc-works-table thead th {
    border-bottom: 2px solid #dee2e6;
    padding: 12px;
    text-align: left;
    color: #495057;
    font-weight: 600;
    white-space: nowrap;
}

.mc-works-table tbody td {
    padding: 12px;
    border-bottom: 1px solid #f1f3f5;
    vertical-align: middle;
}

.mc-works-table tr:last-child td { border-bottom: none; }

.mc-work-row:hover { background-color: #f8f9fa; }
.mc-work-item.selected { background-color: #e7f5ff; }

/* Columns Widths */
.mc-cell-check { width: 40px; text-align: center; }
.mc-cell-year { width: 80px; color: #868e96; }
.mc-cell-author { color: #495057; }
.mc-cell-title strong { color: #212529; }
.mc-cell-genre { width: 120px; }
.mc-cell-era { width: 250px; font-size: 0.85rem; }

/* Sortable Headers */
.mc-th-sortable { cursor: pointer; }
.mc-th-sortable:hover { color: #000; background: #f8f9fa; }
.mc-sort-icon { opacity: 0.3; margin-left: 5px; font-size: 0.8em; }
.mc-sort-asc .mc-sort-icon, .mc-sort-desc .mc-sort-icon { opacity: 1; color: #007bff; }

/* Tags (Badges) */
.mc-tag {
    display: inline-block;
    padding: 4px 10px; /* slightly more horizontal padding */
    border-radius: 12px; /* more pill-shaped */
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    margin-bottom: 2px;
}

/* Genre Colors - Vibrant but soft */
.mc-tag-genre-proza { background: #d1e7dd; color: #0a3622; border: 1px solid #a3cfbb; } /* Green */
.mc-tag-genre-poezie { background: #f8d7da; color: #58151c; border: 1px solid #f1aeb5; } /* Red */
.mc-tag-genre-drama { background: #fff3cd; color: #664d03; border: 1px solid #ffe69c; } /* Yellow/Orange */

/* Era Colors - Distinct but harmonious cool tones */

/* 1. Do konce 18. st. (Neutral/Gray-Blue) */
.mc-tag-era-svetova-a-ceska-literatura-do-konce-18-stoleti {
    background: #e2e3e5; color: #383d41; border: 1px solid #d6d8db;
}

/* 2. 19. stoleti (Light Purple/Indigo) */
.mc-tag-era-svetova-a-ceska-literatura-19-stoleti {
    background: #e0cffc; color: #432874; border: 1px solid #ccb2f7;
}

/* 3. 20. a 21. st. Svetova (Light Blue/Cyan) */
.mc-tag-era-svetova-literatura-20-a-21-stoleti {
    background: #cff4fc; color: #055160; border: 1px solid #9eeaf9;
}

/* 4. 20. a 21. st. Ceska (Light Blue/Primary) */
.mc-tag-era-ceska-literatura-20-a-21-stoleti {
    background: #cfe2ff; color: #084298; border: 1px solid #b6d4fe;
}

/* General fallback for eras */
.mc-tag-era { 
    display: block; 
    width: fit-content; 
    margin-top: 2px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- SUBMIT --- */
.mc-submit-wrapper {
    margin-top: 20px;
    text-align: center;
}

#mc-submit-button {
    background-color: #228be6;
    color: white;
    border: none;
    padding: 12px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.15s ease;
}

#mc-submit-button:hover {
    background-color: #1c7ed6;
    transform: translateY(-1px);
    box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
}

#mc-submit-button:disabled {
    background-color: #adb5bd;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .mc-dashboard-grid { grid-template-columns: 1fr; }
    .mc-rules-list { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .mc-works-table thead { 
        display: none !important; 
    }

    .mc-work-item {
        display: flex !important;
        flex-wrap: wrap !important;
        position: relative !important;
        padding: 12px 12px 12px 52px !important; /* 52px left padding for checkbox space */
        background: #fff !important;
        border: 1px solid #dee2e6 !important;
        border-radius: 8px !important;
        margin-bottom: 10px !important;
        min-height: 60px;
    }

    /* Reset all cells to be simple blocks/flex-items */
    .mc-work-item td {
        display: block !important;
        border: none !important;
        padding: 0 !important;
        background: transparent !important;
        text-align: left !important;
        box-sizing: border-box !important;
    }

    /* Checkbox Area - Fixed Sidebar */
    .mc-cell-check {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        width: 40px !important;
        background: #f8f9fa !important;
        border-right: 1px solid #dee2e6 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-top-left-radius: 8px;
        border-bottom-left-radius: 8px;
        z-index: 2;
    }

    /* Content Ordering & Sizing */
    .mc-cell-title {
        width: 100% !important;
        font-size: 1rem !important;
        font-weight: 700 !important;
        line-height: 1.3 !important;
        margin-bottom: 4px !important;
        color: #212529 !important;
        order: 1;
    }

    .mc-cell-author {
        width: 100% !important;
        font-size: 0.9rem !important;
        color: #6c757d !important;
        margin-bottom: 10px !important;
        order: 2;
    }

    /* Metadata - Inline Flow (Order 3) */
    .mc-cell-year, 
    .mc-cell-genre, 
    .mc-cell-era {
        width: auto !important;
        margin-right: 8px !important;
        margin-bottom: 4px !important;
        order: 3;
        display: flex !important; /* Ensure content inside aligns */
        align-items: center !important;
    }
    
    /* Specific Styling */
    .mc-cell-year {
        font-weight: 600;
        background: #e9ecef;
        padding: 2px 8px !important;
        border-radius: 4px;
        font-size: 0.8rem !important;
        color: #495057 !important;
        height: fit-content;
    }
    .mc-cell-year::before { content: none !important; }
    
    .mc-tag {
        font-size: 0.75rem !important;
        padding: 3px 8px !important;
        white-space: normal !important; /* Allow text wrapping */
        text-align: left;
        height: auto !important;
        display: inline-block;
    }
}
