input[readonly] {
  background-color: lightgray;
}

/* Accessibility: Screen reader only text */
.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;
}

/* Section Header Container */
.section-header-container {
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
  border-left: 4px solid #3182ce;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 8px;
}

/* Focus indicators for better keyboard navigation */
input[type="checkbox"]:focus,
select:focus {
  outline: 2px solid #007cba;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .label-option {
    border: 1px solid;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Problems */
.problem {
  font-family: MathJax_MainRegular;
  font-size: 16px;
  width: 580px;
  display: table !important;
}

.problem ol {
    counter-reset: list;
}

.problem ol .widtha {
  min-width: 95px;
}

.problem ol .widthb {
  min-width: 170px;
}

.problem ol .widthc {
  min-width: 400px;
}

.choices {
  counter-reset: list;
  padding-left: 0px;
  overflow: hidden;
  display: table-row;

  /***
  float:left;
  ***/
}

.choices > li {
  list-style: none;
  display: table-cell;
  float: left;
  vertical-align: middle;
  white-space: nowrap;
  margin-right: 10px;
}

.choices > li:before {
  content: "(" counter(list, upper-alpha) ") ";
  display: table-cell;
  counter-increment: list;
  float: left;
  vertical-align: middle;
  padding-top: 0px;
  padding-right: 3px;
}

.choices img {
  margin-bottom: 5px;
}
.problem span {
  display: inline;
  /***
	font-weight:300 !important; 
    color: #414141 !important;	
	***/
}

.problem .imgvermiddle {
  display: block;
  margin: 5px auto;
}

.problem .problemcontent {
  display: table-cell;
  vertical-align: top;
}

.problem img {
    max-width: 100%;
    height: auto;
}

.problem .problemimage {
  padding: 20px;
  display: table-cell;
  vertical-align: top;
  min-width: 120px;
}

.problem .problemimage img {
  display: block;
  margin: 0 auto;
}

.problem .choiceimage {
  vertical-align: middle;
  display: table-cell;
  float: left;
  margin-left: 5px;
}

.problem .choiceimage img {
  float: right;
}

.arrow,
.arrow:active {
  opacity: 0.4;
  cursor: pointer;
  filter: alpha(opacity=40);
}

.arrow:hover {
  opacity: 1;
  cursor: pointer;
  filter: alpha(opacity=100);
}

.left {
  float: left;
}

.middle {
  /**  
  alignment-adjust: middle;
  **/
  align-content: middle;
}

.right {
  float: right;
}

.listLable {
  display: block;
  float: left;
  margin: 1em 1em 0 0;
  font-size: 12px;
  font-style: italic;
  font-weight: bold;
}

#commandbar ul {
  list-style: none;
  display: table;

  /***	
    list-style-position: inside;
	***/
  padding-left: 5px;
}

.searchlist li {
  list-style-type: disc;
  display: table-cell;
  float: left;
  white-space: nowrap;
}

.problemsource {
  font-size: 14px;
  font-style: italic;
} 
/***
input[type="checkbox"]:disabled {

	display:none;
}
***/

/* Label Styles with Shades */

/* Section Header Row Container */
.section-header-row {
    display: table-row;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

.section-header-row .header-cell {
    display: table-cell;
    padding: 8px 12px;
    vertical-align: middle;
    border-left: 4px solid #3182ce;
    border-radius: 4px 0 0 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.section-header-row .controls-cell {
    display: table-cell;
    padding: 8px 12px;
    vertical-align: middle;
    text-align: right;
    white-space: nowrap;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Section Header Labels */
.label-section-header {
    display: block;
    font-weight: bold;
    font-size: 16px;
    color: #2d3748;
    margin: 0;
    padding: 0; /* Remove padding since it's now on the cell */
    background: none; /* Remove background since it's now on the row */
    border: none; /* Remove border since it's now on the row */
    border-radius: 0; /* Remove border-radius since it's now on the row */
    box-shadow: none; /* Remove box-shadow since it's now on the row */
}

/* Checkbox/Option Labels */
.label-option {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    margin: 2px 0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e2e8f0;
}

.label-option:hover {
    background: linear-gradient(135deg, #ebf8ff 0%, #bee3f8 100%);
    border-color: #3182ce;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* Contest Grade Labels - Pink Shade */
.label-contest {
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
    color: #be185d;
}

.label-contest:hover {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    box-shadow: 0 3px 6px rgba(236, 72, 153, 0.2);
}

/* Primary Topic Labels - Blue Shade */
.label-primary {
    background: linear-gradient(135deg, #ebf8ff 0%, #bee3f8 100%);
    color: #2b6cb0;
}

.label-primary:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #93c5fd 100%);
    box-shadow: 0 3px 6px rgba(49, 130, 206, 0.2);
}

/* Secondary Topic Labels - Green Shade */
.label-secondary {
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
    color: #2f855a;
}

.label-secondary:hover {
    background: linear-gradient(135deg, #dcfce7 0%, #86efac 100%);
    box-shadow: 0 3px 6px rgba(56, 161, 105, 0.2);
}

/* Small Labels for Form Elements */
.label-small {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #718096;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Button Styles matching sidebar gradient theme */

/* Primary Button - Orange to Teal gradient like sidebar */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    text-align: center;
    color: white;
    background: linear-gradient(135deg, #ea580c 0%, #0d9488 100%);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #dc2626 0%, #0f766e 100%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-primary:focus {
    outline: 2px solid #3182ce;
    outline-offset: 2px;
}

/* Secondary Button - Subtle gray gradient */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    text-align: center;
    color: #374151;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-color: #9ca3af;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
    color: #374151;
    text-decoration: none;
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-secondary:focus {
    outline: 2px solid #6b7280;
    outline-offset: 2px;
}

/* Success Button - Green gradient */
.btn-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    text-align: center;
    color: white;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

.btn-success:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-success:focus {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

/* Button sizing variants */
.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

/* Full width button */
.btn-block {
    width: 100%;
}

/* Disabled state for all button types */
.btn-primary:disabled,
.btn-secondary:disabled,
.btn-success:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary:disabled:hover,
.btn-secondary:disabled:hover,
.btn-success:disabled:hover {
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Form Elements - Contest and Year Selection Styling */

/* Form Select Dropdown */
.form-select {
    display: block;
    width: 100%;
    padding: 10px 40px 10px 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    color: #374151;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 16px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s ease;
    appearance: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-select:hover {
    border-color: #d1d5db;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-select:focus {
    outline: none;
    border-color: #ea580c;
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.1), 0 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #ffffff 0%, #fef7f0 100%);
}

.form-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f3f4f6;
}

/* Form Labels */
.form-label,
label[for="contest"],
label[for="contestYear"] {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
    margin-bottom: 6px;
    text-transform: capitalize;
    letter-spacing: 0.025em;
}

/* Container Styling for Contest Selection */
.contest-selection-container {
    background: linear-gradient(135deg, #fefefe 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.contest-selection-container:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* Small helper text */
.form-help-text {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
    font-style: italic;
}

/* Loading indicator styling */
.loading-indicator {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, #fef3cd 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 6px;
    color: #92400e;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 12px;
}

/* Contest Year Section */
.contest-year-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #0369a1;
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
}

/* Optional: Add some animation for the dropdown appearance */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.contest-year-section {
    animation: slideIn 0.3s ease-out;
}

/* Responsive design for smaller screens */
@media (max-width: 640px) {
    .form-select {
        padding: 8px 32px 8px 10px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .contest-selection-container {
        padding: 16px;
    }
}

/* Enhanced Topic Checkbox Styling */

/* Part Selection Container */
.part-selection-container {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.part-selection-container:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Enhanced Part Select Dropdowns - Left Aligned */
.part-select {
    display: block;
    width: 80px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border: 2px solid #d1d5db;
    border-radius: 8px;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 4px center;
    background-repeat: no-repeat;
    background-size: 12px 8px;
    text-align: left;
    cursor: pointer;
    margin: 0;
}

.part-select:hover {
    border-color: #9ca3af;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.part-select:focus {
    outline: none;
    border-color: #ea580c;
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15);
    background: linear-gradient(135deg, #ffffff 0%, #fef7f0 100%);
}

/* Part Labels with Color Coding - Left Aligned */
.part-label-a {
    color: #dc2626;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    display: block;
    text-align: left;
}

.part-label-b {
    color: #059669;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    display: block;
    text-align: left;
}

.part-label-c {
    color: #7c3aed;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    display: block;
    text-align: left;
}

/* Part Selection Cells - Left Aligned */
.part-cell {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 12px;
    text-align: left;
    transition: all 0.2s ease;
    margin: 0 4px;
}

.part-cell:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

/* Enhanced Checkbox Grid Layout */
.checkbox-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.checkbox-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 12px;
}

/* Improved Label Options */
.label-option {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    margin: 0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
    border: 1.5px solid transparent;
}

.label-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    accent-color: #ea580c;
    cursor: pointer;
}

.label-option span {
    flex: 1;
    line-height: 1.3;
}

/* Enhanced Contest Labels */
.label-contest {
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
    color: #be185d;
    border-color: transparent;
}

.label-contest:hover {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    border-color: #ec4899;
    box-shadow: 0 3px 6px rgba(236, 72, 153, 0.15);
    transform: translateY(-1px);
}

.label-contest input[type="checkbox"]:checked {
    accent-color: #ec4899;
}

/* Enhanced Primary Topic Labels */
.label-primary {
    background: linear-gradient(135deg, #ebf8ff 0%, #dbeafe 100%);
    color: #1e40af;
    border-color: transparent;
}

.label-primary:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #3b82f6;
    box-shadow: 0 3px 6px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.label-primary input[type="checkbox"]:checked {
    accent-color: #3b82f6;
}

/* Enhanced Secondary Topic Labels */
.label-secondary {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: #166534;
    border-color: transparent;
}

.label-secondary:hover {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border-color: #22c55e;
    box-shadow: 0 3px 6px rgba(34, 197, 94, 0.15);
    transform: translateY(-1px);
}

.label-secondary input[type="checkbox"]:checked {
    accent-color: #22c55e;
}

/* Status Messages */
.status-message {
    background: linear-gradient(135deg, #fef3cd 0%, #fde68a 100%);
    color: #92400e;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid #f59e0b;
    font-size: 14px;
    font-style: italic;
    margin-top: 12px;
    text-align: center;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .checkbox-grid-3 {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .checkbox-grid-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .part-cell {
        margin: 0 2px;
        padding: 12px 8px;
    }
    
    .label-option {
        padding: 8px 10px;
        font-size: 12px;
    }
}

/* Online Problem Display Styling */

/* Problem Container */
.problem-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin: 16px 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.problem-content {
    font-size: 16px;
    line-height: 1.6;
    color: #374151;
}

/* Radio Button Choices Styling */
.choices-container {
    margin-top: 20px;
}

.choice-radio-label {
    display: flex;
    align-items: flex-start;
    padding: 12px 16px;
    margin: 8px 0;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
}

.choice-radio-label:hover {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.choice-radio-label:has(input:checked) {
    border-color: #ea580c;
    background: linear-gradient(135deg, #fef7f0 0%, #fed7aa 100%);
    box-shadow: 0 3px 6px rgba(234, 88, 12, 0.2);
}

.choice-radio-label:has(input:disabled) {
    opacity: 0.7;
    cursor: not-allowed;
}

.choice-radio-input {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    margin-top: 2px;
    accent-color: #ea580c;
    cursor: pointer;
    flex-shrink: 0;
}

.choice-content {
    display: flex;
    align-items: flex-start;
    width: 100%;
}

.choice-letter {
    font-weight: 700;
    color: #374151;
    margin-right: 8px;
    min-width: 24px;
    flex-shrink: 0;
}

.choice-text {
    flex: 1;
    line-height: 1.5;
    color: #374151;
}

/* Result styling */
.result-correct {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #22c55e;
}

.result-incorrect {
    background: linear-gradient(135def, #fef2f2 0%, #fecaca 100%);
    border: 2px solid #ef4444;
}

/* Problem badges */
.problem-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-grade {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

.badge-part {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
}

.badge-problem {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: #4338ca;
}

/* Mobile responsive for choices */
@media (max-width: 640px) {
    .choice-radio-label {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .choice-radio-input {
        width: 16px;
        height: 16px;
        margin-right: 10px;
    }
    
    .problem-container {
        padding: 16px;
    }
}
