
:root {
    --primary-red: #ef0107;
    --primary-blue: #063672;
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
    --bg-light: #f8f9fa;
    --text-primary: #333;
    --text-secondary: #333333;
    --text-muted: #555555;
    --border: #ddd;
    --shadow: 0 10px 40px rgba(0,0,0,0.2);
    --shadow-light: 0 2px 8px rgba(0,0,0,0.1);
    --border-radius: 10px;
    --border-radius-sm: 5px;
    --sidebar-width: 350px;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-blue);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    z-index: 10000;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 6px;
}

* {
    box-sizing: border-box;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 5px;
    border: 1px solid #f0f0f0;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #c0c0c0 #f0f0f0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-blue) 100%);
    min-height: 100vh;
    color: var(--text-primary);
}

/* Desktop Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Left Sidebar - Desktop */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    box-shadow: var(--shadow);
    position: fixed;
    height: 100vh;
    overflow-y: scroll;
    z-index: 100;
    padding: 20px;
}

.sidebar-toggle {
    display: none;
}

/* Main Content - Desktop */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 20px;
    overflow-y: scroll;
    height: 100vh;
    transition: padding 0.4s ease-in-out, margin 0.4s ease-in-out;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 5px;
}

.header h2 {
    color: var(--primary-red);
    margin: 0 0 10px 0;
    font-size: 1.8rem;
}

.header p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.95rem;
}

/* Credits Section */
.credits {
    margin-top: 5px;
    padding-top: 5px;
    padding-bottom: 15px;
    margin-bottom: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.credits p {
    font-size: 0.85rem;
    color: #333;
    margin: 0;
    text-align: center;
    line-height: 1.4;
}

.credits a {
    color: #8b1538;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s ease;
}

.credits a:hover {
    color: #a01650;
    text-decoration: underline;
}

/* Form Styles */
.form-section {
    background: var(--bg-light);
    padding: 20px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
}

.form-section h2 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333333;
    font-size: 1.1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    background-color: white;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-family: inherit;
}

/* Custom dropdown arrow for select */
.form-group select {
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23333" viewBox="0 0 12 8" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L6 6L11 1" stroke="%23333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 36px;
    cursor: pointer;
}

/* Number input specific styling */
.form-group input[type="number"] {
    -moz-appearance: textfield;
}

.form-group input[type="number"]::-webkit-inner-spin-button,
.form-group input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form-group input:hover,
.form-group select:hover {
    border-color: var(--primary-red);
    box-shadow: 0 2px 8px rgba(220, 38, 127, 0.15);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(220, 38, 127, 0.1), 0 2px 8px rgba(220, 38, 127, 0.15);
    transform: translateY(-1px);
}

/* Rules Section */
.rules-section {
    background: var(--bg-light);
    padding: 20px;
    border-radius: var(--border-radius-sm);
    margin: 20px 0;
    border-left: 4px solid var(--primary-red);
}

.rules-section h2 {
    margin-top: 0;
    color: #8b1538;
    font-size: 1.1rem;
}

.rule-item {
    margin-bottom: 15px;
    padding: 12px;
    background: white;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-light);
}

.rule-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.rule-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.rule-checkbox {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin-bottom: 8px;
}

.rule-checkbox label {
    position: relative;
    padding-left: 35px;
    cursor: pointer;
    font-weight: 600;
    margin: 0;
}

.rule-checkbox label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 20px;
    width: 20px;
    background-color: white;
    border: 2px solid var(--border);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.rule-checkbox label::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    opacity: 0;
    transition: all 0.3s ease;
}

.rule-checkbox input[type="checkbox"]:checked + label::before {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
}

.rule-checkbox input[type="checkbox"]:checked + label::after {
    opacity: 1;
}

.rule-checkbox:hover label::before {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 2px rgba(220, 38, 127, 0.1);
}

.rule-checkbox label {
    font-weight: 600;
    cursor: pointer;
    margin: 0;
    font-size: 0.9rem;
}

.rule-details {
    margin-left: 25px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.rule-details select,
.rule-details input {
    width: auto;
    min-width: 80px;
    margin-right: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 2px solid var(--border);
    border-radius: 6px;
    background-color: white;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-family: inherit;
}

/* Custom dropdown arrow for rule select */
.rule-details select {
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23333" viewBox="0 0 12 8" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L6 6L11 1" stroke="%23333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 10px;
    padding-right: 28px;
    cursor: pointer;
}

/* Number input specific styling for rules */
.rule-details input[type="number"] {
    -moz-appearance: textfield;
    text-align: center;
}

.rule-details input[type="number"]::-webkit-inner-spin-button,
.rule-details input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.rule-details select:hover,
.rule-details input:hover {
    border-color: var(--primary-red);
    box-shadow: 0 2px 6px rgba(220, 38, 127, 0.12);
}

.rule-details select:focus,
.rule-details input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 2px rgba(220, 38, 127, 0.1), 0 2px 6px rgba(220, 38, 127, 0.12);
}

.rule-details span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Button */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-red) 0%, #c91c60 100%);
    color: white;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    margin-top: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(220, 38, 127, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #b8174c 0%, #a01650 100%);
    box-shadow: 0 6px 20px rgba(220, 38, 127, 0.4);
    transform: translateY(-2px);
}

.btn-primary:hover:not(:disabled)::before {
    left: 100%;
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0px);
    box-shadow: 0 2px 8px rgba(220, 38, 127, 0.3);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-secondary {
    background: var(--primary-blue);
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    width: 100%;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.btn-secondary:hover:not(:disabled) {
    background: #0056b3;
}

.btn-secondary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Progress */
.progress-section {
    display: none;
    margin: 0 0 20px 0;
    padding: 20px;
    background: white;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-light);
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-red);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

/* Results Section */
.results-section {
    display: block;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    overflow: hidden;
    position: relative;
}

/* Empty State */
.empty-state {
    padding: 60px 40px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-content {
    max-width: 600px;
    margin: 0 auto;
}

.empty-state-content h2 {
    color: var(--primary-red);
    margin: 0 0 20px 0;
    font-size: 2rem;
}

.empty-state-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin: 0 0 40px 0;
    max-width: 500px;
}

.empty-state-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin: 0 auto;
}

.step {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-light);
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.step-number {
    background: var(--primary-red);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.step-text {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
}

.results-header {
    padding: 25px;
    border-bottom: 2px solid var(--bg-light);
    text-align: center;
}

.results-header h2 {
    color: var(--primary-red);
    margin: 0 0 8px 0;
    font-size: 1.6rem;
}

.results-header p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 1rem;
}

.results-header .data-updated {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 5px;
    font-style: italic;
}

.active-rules {
    margin-top: 10px;
    padding: 10px;
    background: var(--bg-light);
    border-radius: var(--border-radius-sm);
    border-left: 4px solid var(--primary-red);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Summary Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    padding: 25px;
    background: var(--bg-light);
}

.summary-card {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius-sm);
    text-align: center;
    box-shadow: var(--shadow-light);
}

.summary-number {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 6px;
}

.summary-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Table Section with Sticky Elements */
.table-section {
    position: relative;
}

/* Sticky Filter Section */
.filter-section-sticky {
    position: sticky;
    top: 0;
    z-index: 20;
    background: white;
}

.filter-section {
    padding: 20px 25px;
    border-bottom: 2px solid var(--bg-light);
    background: white;
}

.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

/* Search Box */
.search-box {
    flex: 1;
    max-width: 300px;
    min-width: 200px;
}

.table-search-input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid var(--border);
    border-radius: 25px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: white;
}

.table-search-input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(239, 1, 7, 0.1);
}

.table-search-input::placeholder {
    color: var(--text-muted);
}

.filter-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid var(--border);
    border-radius: 20px;
    background: white;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--primary-red);
}

.filter-btn.active {
    background: var(--primary-red);
    color: white;
    border-color: var(--primary-red);
}

.filter-btn.success.active {
    background: var(--success);
    border-color: var(--success);
}

.filter-btn.error.active {
    background: var(--error);
    border-color: var(--error);
}

/* Table */
.table-container {
    overflow-x: scroll;
    max-height: calc(100vh - 300px);
    overflow-y: scroll;
    position: relative;
}

.results-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    background: white;
}

.results-table th {
    background: var(--primary-red);
    color: white;
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.9rem;
}


.results-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    font-size: 0.85rem;
}

.results-table tbody tr {
    transition: background-color 0.2s ease;
}

.results-table tbody tr:hover {
    background: #f8f9ff;
}

.results-table tbody tr.hidden {
    display: none;
}

.results-table tbody tr.compliant {
    border-left: 3px solid var(--success);
}

.results-table tbody tr.non-compliant {
    border-left: 3px solid var(--error);
}

.badge {
    display: inline-block;
    padding: 3px 7px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-error {
    background: var(--error);
    color: white;
}

.badge-warning {
    background: var(--warning);
    color: white;
}

.badge-info {
    background: #6c757d;
    color: white;
}

.icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    margin-left: 8px;
    color: white;
    text-align: center;
    line-height: 1;
}

.icon-badge-success {
    background-color: #10B981;
}

.icon-badge-error {
    background-color: #EF4444;
}

@media (max-width: 767px) {
    .icon-badge {
        width: 18px;
        height: 18px;
        font-size: 11px;
        margin-left: 6px;
    }
}

.player-list {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 3px;
    font-style: italic;
    line-height: 1.2;
}

/* Error Section */
.error-section {
    display: none;
    background: #fee;
    color: #c33;
    padding: 20px;
    border-radius: var(--border-radius-sm);
    border-left: 4px solid #c33;
    margin: 0 0 20px 0;
}

.error-section h2 {
    margin-top: 0;
    color: #c33;
}

.empty-results-message {
    padding: 60px 20px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--border-radius);
    margin: 20px;
}

.empty-results-message .empty-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.empty-results-message h3 {
    color: var(--text-primary);
    margin: 0 0 10px 0;
    font-size: 1.4rem;
}

.empty-results-message p {
    color: var(--text-secondary);
    margin: 0 0 10px 0;
    font-size: 1rem;
}

.empty-results-message .empty-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

/* Tablet Layout (768px - 1023px) */
@media (max-width: 1023px) and (min-width: 768px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        max-height: none;
        overflow-y: visible;
        padding: 15px;
    }
    
    .main-content {
        margin-left: 0;
        padding: 15px;
    }
    
    .app-layout {
        flex-direction: column;
    }
    
    .sidebar-content {
        display: block;
        max-height: none;
        opacity: 1;
        overflow: visible;
    }
    
    .table-container {
        max-height: 60vh;
    }
}


/* Mobile Layout (< 768px) */
@media (max-width: 767px) {
    body {
        padding: 0;
    }
    
    .app-layout {
        flex-direction: column;
    }
    
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        max-height: none;
        overflow-y: visible;
        padding: 15px;
        border-radius: 0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        display: flex;
        flex-direction: column;
    }
    
    .main-content {
        margin-left: 0;
        padding: 15px;
    }
    
    .header h2 {
        font-size: 1.6rem;
    }
    
    .header p {
        font-size: 0.9rem;
    }
    
    .sidebar-content {
        display: block;
        max-height: none;
        opacity: 1;
        overflow: visible;
    }
    
    .form-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .rules-section {
        padding: 15px;
        margin: 15px 0;
    }
    
    .rule-details {
        margin-left: 0;
        margin-top: 8px;
    }
    
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 20px 15px;
    }
    
    .summary-number {
        font-size: 1.6rem;
    }
    
    .filter-section-sticky {
        top: 0;
    }
    
    .filter-section {
        padding: 15px;
    }
    
    .filter-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .filter-controls {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .filter-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .results-table {
        min-width: 800px;
    }
    
    .results-table th,
    .results-table td {
        padding: 8px 6px;
        font-size: 0.8rem;
    }
    
    
    .badge {
        padding: 2px 5px;
        font-size: 0.7rem;
    }
}

/* Very small mobile (< 480px) */
@media (max-width: 479px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-controls {
        gap: 6px;
    }
    
    .filter-btn {
        font-size: 0.75rem;
        padding: 5px 10px;
    }
    
    .empty-state {
        padding: 40px 20px;
        min-height: 400px;
    }
    
    .empty-state-content h2 {
        font-size: 1.5rem;
    }
    
    .empty-state-content p {
        font-size: 1rem;
    }
    
    .empty-state-steps {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .step {
        padding: 15px;
    }
}