/**
 * Smart Rules Styles
 * Mobile-optimized for quick phone lookup
 */

.smart-rules {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 100%;
    margin: 0 auto;
    padding: 10px;
}

/* Header Controls */
.smart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

/* Program Buttons - Left side */
.smart-programs {
    display: flex;
    gap: 20px;
}

.program-btn {
    padding: 5px 0;
    background: transparent;
    border: none;
    color: #999;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
}

.program-btn.active {
    color: #2c3e50;
    font-weight: 700;
}

/* Level Buttons - Right side */
.smart-levels {
    display: flex;
    gap: 20px;
}

.level-btn {
    padding: 5px 0;
    background: transparent;
    border: none;
    color: #999;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
}

.level-btn.active {
    color: #2c3e50;
    font-weight: 700;
}

/* Program Title */
.smart-program-title {
    margin-bottom: 20px;
}

#smart-program-name {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    display: block;
}

.smart-passing-score {
    font-size: 16px;
    color: #666;
    font-weight: 400;
}

/* Loading */
.smart-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Phase Sections */
.smart-phase {
    margin-bottom: 15px;
    border: 1px solid #ddd;
}

.smart-phase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
}

.smart-phase-header:hover {
    background: #e8e8e8;
}

.smart-phase-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    margin: 0;
}

.smart-phase-toggle {
    font-size: 14px;
    color: #999;
    transition: transform 0.2s;
}

.smart-phase.open .smart-phase-toggle {
    transform: rotate(180deg);
}

.smart-phase-content {
    display: none;
    padding: 10px;
}

.smart-phase.open .smart-phase-content {
    display: block;
}

/* Exercise Accordion */
.smart-exercise {
    border: 1px solid #ddd;
    margin-bottom: 8px;
    overflow: hidden;
    background: #fff;
}

.smart-exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    cursor: pointer;
    background: #f8f9fa;
    transition: background 0.2s;
}

.smart-exercise-header:hover {
    background: #eef0f2;
}

.smart-exercise-header:active {
    background: #e2e6ea;
}

.smart-exercise-name {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    flex: 1;
    padding-right: 10px;
}

.smart-exercise-name.optional {
    font-style: italic;
}

.smart-exercise-points {
    font-size: 18px;
    font-weight: 700;
    color: #27ae60;
    white-space: nowrap;
}

.smart-exercise-toggle {
    margin-left: 10px;
    font-size: 18px;
    color: #999;
    transition: transform 0.2s;
}

.smart-exercise.open .smart-exercise-toggle {
    transform: rotate(180deg);
}

/* Exercise Content (expanded) */
.smart-exercise-content {
    display: none;
    padding: 15px;
    border-top: 1px solid #eee;
}

.smart-exercise.open .smart-exercise-content {
    display: block;
}

.smart-exercise-image {
    width: 100%;
    height: auto;
    margin-bottom: 15px;
}

/* Section Toggles within Exercise */
.smart-section {
    border: 1px solid #eee;
    margin-bottom: 8px;
}

.smart-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    background: #fafafa;
    transition: background 0.2s;
}

.smart-section-header:hover {
    background: #f0f0f0;
}

.smart-section-label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    color: #666;
}

.smart-section-toggle {
    font-size: 14px;
    color: #999;
    transition: transform 0.2s;
}

.smart-section.open .smart-section-toggle {
    transform: rotate(180deg);
}

.smart-section-content {
    display: none;
    padding: 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #444;
    border-top: 1px solid #eee;
}

.smart-section.open .smart-section-content {
    display: block;
}

/* Penalties Section */
.smart-section.penalties .smart-section-label {
    color: #c0392b;
}

.smart-penalty {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 10px;
}

.smart-penalty:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.smart-penalty:first-child {
    padding-top: 0;
}

.smart-penalty-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
}

.smart-penalty-points {
    font-size: 14px;
    font-weight: 600;
    color: #c0392b;
    white-space: nowrap;
}

/* Fatal penalties */
.smart-penalty.fatal {
    background: #fff5f5;
    margin: 0 -12px;
    padding: 10px 12px;
}

.smart-penalty.fatal .smart-penalty-text {
    color: #c0392b;
    font-weight: 600;
}

.smart-penalty.fatal .smart-penalty-text::before {
    content: "⚠ ";
}

.smart-penalty.fatal .smart-penalty-points {
    color: #c0392b;
    font-weight: 700;
}

/* No content messages */
.smart-no-penalties,
.smart-no-exercises {
    color: #888;
    font-style: italic;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 480px) {
    .smart-rules {
        padding: 8px;
    }
    
    .smart-header {
        gap: 10px;
    }
    
    .program-btn,
    .level-btn {
        font-size: 15px;
    }
    
    .smart-programs,
    .smart-levels {
        gap: 15px;
    }
    
    #smart-program-name {
        font-size: 24px;
    }
    
    .smart-exercise-name {
        font-size: 15px;
    }
    
    .smart-exercise-points {
        font-size: 16px;
    }
}
