/* ===================================================
   Fraction Calculator Styles
   Created: 2025-11-11
   Updated: 2025-11-11 (Phase 2 UI Redesign)
   Description: Styles for the Fraction Calculator page
   =================================================== */


.glass-card h3 i {
    font-size: 1.2rem;
}

/* ===== Input Group Custom ===== */
.input-group-custom {
    margin-bottom: 1.25rem;
}

.input-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-label i {
    color: #667eea;
}

/* ===== Form Input Fields ===== */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid #e0e7ff;
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input:hover {
    border-color: #a5b4fc;
}

/* ===== Basic Input Layout (Horizontal) ===== */
.basic-input-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem 0;
}

.fraction-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 1.25rem;
    border-radius: 12px;
    border: 2px solid #e0e7ff;
    transition: all 0.3s ease;
    min-width: 160px;
}

.fraction-section:hover {
    border-color: #a5b4fc;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.05);
}

.fraction-section-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.fraction-input-wrapper {
    position: relative;
    width: 100%;
}

.fraction-input-large {
    width: 100%;
    padding: 0.75rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    border: 2px solid #e0e7ff;
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
    color: #333;
}

.fraction-input-large:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.fraction-label-hint {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: #94a3b8;
    pointer-events: none;
}

.fraction-divider-line {
    width: 100%;
    height: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0.25rem 0;
}

.operation-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding-top: 2rem;
}

.operation-section-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.operation-select {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid #e0e7ff;
    border-radius: 8px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
}

.operation-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.operation-select:hover {
    border-color: #a5b4fc;
}

/* Compare Input Layout (Horizontal) */
.compare-input-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 1rem 0;
}

.vs-symbol {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #667eea;
    padding: 1rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .basic-input-layout {
        flex-direction: column;
        gap: 1rem;
    }

    .fraction-section {
        width: 100%;
        max-width: 300px;
    }

    .operation-section {
        width: 100%;
        max-width: 300px;
        padding-top: 0;
    }

    .operation-select {
        width: 100%;
    }

    .compare-input-layout {
        flex-direction: column;
        gap: 1rem;
    }

    .vs-symbol {
        transform: rotate(90deg);
        padding: 0.5rem;
    }
}

/* ===== OLD Fraction Input Container (for Compare mode) ===== */
.fraction-input-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    padding: 1rem;
    border-radius: 12px;
    border: 2px solid #e0e7ff;
    transition: all 0.3s ease;
}

.fraction-input-container:hover {
    border-color: #a5b4fc;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.05);
}

.fraction-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.fraction-input-small {
    width: 80px;
    padding: 0.5rem;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    border: 2px solid #e0e7ff;
    border-radius: 6px;
    background: white;
    transition: all 0.3s ease;
}

.fraction-input-small:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.fraction-line {
    width: 100%;
    height: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0;
}

/* ===== Fraction Display (Result) ===== */
.fraction-display {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    margin: 0 0.5rem;
    vertical-align: middle;
}

.fraction-numerator,
.fraction-denominator {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.2;
    min-width: 40px;
}

.mixed-number {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.whole-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    margin-right: 0.25rem;
}

/* Operation Selector */
.operation-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin: 1rem 0;
}

.operation-btn {
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.5rem;
    font-weight: 600;
    color: #64748b;
}

.operation-btn:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8edff 100%);
    transform: translateY(-2px);
}

.operation-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ===== Result Display ===== */
.result-item {
    background: white;
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border-left: 4px solid #48bb78;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.result-item-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-item-label i {
    color: #48bb78;
}

.result-item-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
    padding: 0.75rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #f8fafc 100%);
    border-radius: 8px;
    border: 2px solid #e0f2fe;
}

.result-fraction-container {
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8edff 100%);
    border-radius: 12px;
    margin: 1rem 0;
}

.result-fraction-large {
    font-size: 2.5rem;
}

.result-fraction-large .fraction-numerator,
.result-fraction-large .fraction-denominator {
    font-size: 2.5rem;
}

.result-fraction-large .whole-number {
    font-size: 3rem;
}

.result-conversions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

.conversion-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #48bb78;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.conversion-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.conversion-label {
    font-size: 0.95rem;
    color: #64748b;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.conversion-label i {
    color: #48bb78;
}

.conversion-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
}

/* ===== Steps Display ===== */
.steps-container {
    margin-top: 1rem;
}

.toggle-steps-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #667eea;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 600;
    color: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.toggle-steps-btn:hover {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8edff 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.toggle-steps-btn i {
    transition: transform 0.3s ease;
}

.toggle-steps-btn.active i {
    transform: rotate(180deg);
}

.steps-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0 0;
}

.step-item {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-left: 4px solid #667eea;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    animation: slideIn 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.step-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    margin-right: 0.75rem;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.step-content {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.6;
}

.step-formula {
    display: inline-block;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8edff 100%);
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #667eea;
    margin: 0 0.25rem;
    border: 1px solid #e0e7ff;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 300px;
    margin: 1rem 0;
}

.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.chart-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.chart-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
    text-align: center;
}

/* Action Buttons Grid */
.action-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* Action Buttons */
.btn-custom,
.btn-custom-outline {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
}

.btn-custom {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-custom-outline {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-custom-outline:hover {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8edff 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.btn-custom:active,
.btn-custom-outline:active {
    transform: translateY(0);
}

/* Sponsor Button */
.btn-sponsor {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    color: white;
}

.btn-sponsor:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-sponsor:active {
    transform: translateY(0);
}

/* Mode Buttons (Phase 2) */
.mode-btn {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 600;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.mode-btn:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8edff 100%);
    transform: translateY(-2px);
}

.mode-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.mode-btn.active:hover {
    transform: translateY(-2px);
}

/* Calculate Button */
.btn-calculate {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.btn-calculate:active {
    transform: translateY(0);
}

/* Error Message */
.error-message {
    background: #fee;
    color: #c33;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border-left: 4px solid #c33;
    margin: 1rem 0;
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.error-message.show {
    display: flex;
}

/* ===== Tooltip ===== */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: help;
    margin-left: 0.35rem;
    position: relative;
    transition: all 0.3s ease;
}

.tooltip-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #334155;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 400;
    white-space: nowrap;
    z-index: 100;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #334155;
}

.tooltip-icon:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}
.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #48bb78;
    border-radius: 12px;
    font-family: 'Roboto Mono', monospace;
    font-size: 1.1rem;
    background: #f0fff4;
    transition: all 0.3s ease;
}



/* ===== Responsive Design ===== */
@media (max-width: 992px) {
    .chart-grid {
        grid-template-columns: 1fr;
    }

    .page-header h1 {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
    }

    .page-header .subtitle {
        font-size: 1rem;
    }

    .fraction-input-container {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.25rem;
    }

    .result-fraction-large {
        font-size: 2rem;
    }

    .result-fraction-large .fraction-numerator,
    .result-fraction-large .fraction-denominator {
        font-size: 2rem;
    }

    .result-fraction-large .whole-number {
        font-size: 2.5rem;
    }

    .glass-card {
        padding: 1.25rem;
    }
}

@media (max-width: 576px) {
    .page-header h1 {
        font-size: 1.75rem;
    }

    .action-buttons-grid {
        grid-template-columns: 1fr;
    }

    .fraction-input-small {
        width: 70px;
        padding: 0.4rem;
        font-size: 1rem;
    }

    .result-fraction-large {
        font-size: 1.5rem;
    }

    .result-fraction-large .fraction-numerator,
    .result-fraction-large .fraction-denominator {
        font-size: 1.5rem;
    }

    .result-fraction-large .whole-number {
        font-size: 2rem;
    }

    .chart-container {
        height: 250px;
    }

    .glass-card {
        padding: 1rem;
    }

    .glass-card h3 {
        font-size: 1.1rem;
    }

    .mode-buttons {
        grid-template-columns: 1fr !important;
    }

    .tooltip-text {
        white-space: normal;
        max-width: 200px;
    }
}

/* ========== ENHANCEMENT FEATURES STYLES (Phase 3) ========== */

/* Enhanced Mode Selector - 4 buttons layout */
.enhanced-mode-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 20px;
}

.enhanced-mode-btn {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 2px solid #e2e8f0;
    background: white;
    color: #475569;
}

.enhanced-mode-btn:hover {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8edff 100%);
    border-color: #667eea;
    transform: translateY(-2px);
}

.enhanced-mode-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.enhanced-mode-btn i {
    font-size: 1.1rem;
}

/* Decimal Converter Specific Styles */
.decimal-input-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.decimal-input {
    width: 100%;
    padding: 0.75rem;
    font-size: 1.1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    text-align: center;
}

.decimal-input:focus {
    border-color: #48bb78;
    outline: none;
    box-shadow: 0 0 0 3px rgba(72, 187, 120, 0.1);
}

.notation-hint {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 0.5rem;
    text-align: center;
    font-style: italic;
}

.decimal-result-display {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #0ea5e9;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.decimal-result-display .result-fraction {
    font-size: 2rem;
    font-weight: 700;
    color: #0c4a6e;
    text-align: center;
    margin-bottom: 0.5rem;
}

.decimal-result-display .result-type {
    text-align: center;
    font-size: 0.9rem;
    color: #0369a1;
}

/* Continued Fraction Display */
.continued-fraction-display {
    background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.continued-fraction-result {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 1rem;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bracket-notation {
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    text-align: center;
    margin-top: 1rem;
    border: 1px dashed #f59e0b;
}

/* Egyptian Fraction Display */
.egyptian-fraction-display {
    background: linear-gradient(135deg, #fdf4ff 0%, #fae8ff 100%);
    border: 2px solid #a855f7;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.unit-fractions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin: 1rem 0;
}

.unit-fraction-item {
    background: white;
    border: 2px solid #a855f7;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
}

.unit-fraction-plus {
    color: #a855f7;
    font-weight: 700;
    font-size: 1.2rem;
    margin: 0 0.5rem;
}

.egyptian-sum-formula {
    text-align: center;
    font-size: 1.3rem;
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
}

.historical-note {
    background: rgba(255, 255, 255, 0.5);
    border-left: 4px solid #a855f7;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    font-size: 0.9rem;
    font-style: italic;
    color: #6b21a8;
}

/* Multi-Fraction Sorting */
.fraction-sort-container {
    margin-top: 1rem;
}

.fraction-inputs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.fraction-input-item {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    position: relative;
}

.fraction-input-item .remove-fraction {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.fraction-input-item .remove-fraction:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.fraction-input-mini {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    text-align: center;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.fraction-input-mini:focus {
    border-color: #48bb78;
    outline: none;
}

.fraction-divider-mini {
    height: 2px;
    background: #cbd5e1;
    margin: 0.25rem 0;
}

.add-fraction-btn {
    width: 100%;
    padding: 1rem;
    border: 2px dashed #94a3b8;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.add-fraction-btn:hover {
    border-color: #667eea;
    color: #667eea;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8edff 100%);
}

.sorted-result-display {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 2px solid #10b981;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.inequality-chain {
    font-size: 1.8rem;
    text-align: center;
    margin: 1rem 0;
    font-weight: 600;
    color: #065f46;
}

.number-line-visual {
    margin-top: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
}

/* Enhanced Steps Display */
.step-item {
    background: white;
    border-left: 4px solid #667eea;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.step-item h4 {
    color: #667eea;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.step-description {
    color: #475569;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.step-formula {
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: 6px;
    margin: 0.5rem 0;
    text-align: center;
    font-size: 1.1rem;
}

.step-result {
    color: #10b981;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* Toggle Section Styles */
.toggle-section {
    margin-bottom: 1rem;
}

.toggle-section-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.toggle-section-header:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8edff 100%);
}

.toggle-section-header i {
    transition: transform 0.3s ease;
}

.toggle-section-header.active i {
    transform: rotate(180deg);
}

.toggle-section-content {
    margin-top: 1rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Example Boxes */
.example-box {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 2px solid #f59e0b;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.example-box .example-title {
    color: #92400e;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.example-box .example-content {
    color: #78350f;
    font-size: 0.85rem;
}

/* Copy Result Button */
.copy-result-btn {
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.copy-result-btn:hover {
    background: #667eea;
    color: white;
}

.copy-result-btn:active {
    transform: scale(0.95);
}

/* Responsive for Enhancement Features */
@media (max-width: 768px) {
    .enhanced-mode-selector {
        grid-template-columns: repeat(2, 1fr);
    }

    .fraction-inputs-grid {
        grid-template-columns: 1fr;
    }

    .inequality-chain {
        font-size: 1.3rem;
    }

    .decimal-result-display .result-fraction {
        font-size: 1.5rem;
    }

    .continued-fraction-result {
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .enhanced-mode-selector {
        grid-template-columns: 1fr;
    }

    .enhanced-mode-btn {
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
    }
}

/* Print Styles */
@media print {
    .action-buttons-grid,
    .btn-calculate,
    .step-toggle-btn,
    .enhanced-mode-selector,
    .add-fraction-btn,
    .remove-fraction,
    .copy-result-btn {
        display: none;
    }

    .steps-list,
    .toggle-section-content {
        display: block !important;
    }

    .step-item {
        page-break-inside: avoid;
    }
}
