/* Proportion Calculator Styles */
.proportion-calculator-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 2rem;
}

.calculator-card {
    background: var(--card-bg, #ffffff);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color, #e5e7eb);
    transition: box-shadow 0.3s ease;
}

.calculator-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Proportion Visual */
.proportion-visual {
    margin-bottom: 2rem;
}

.proportion-formula {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.ratio-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

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

.ratio-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ratio-input {
    width: 100px;
    padding: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    text-align: center;
    border: 2px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    background: white;
    transition: all 0.2s ease;
    color: var(--text-color, #1f2937);
}

.ratio-input:focus {
    outline: none;
    border-color: var(--primary-color, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.ratio-input::placeholder {
    color: var(--text-muted, #9ca3af);
    font-weight: 400;
}

.ratio-divider {
    width: 2px;
    height: 40px;
    background: var(--border-color, #d1d5db);
    border-radius: 2px;
}

.equals-sign {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--primary-color, #3b82f6);
    border-radius: 50%;
    color: white;
    flex-shrink: 0;
}

.equals-sign svg {
    width: 24px;
    height: 24px;
}

.proportion-hint {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted, #6b7280);
    margin: 0;
}

/* Action Section */
.action-section {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.calculate-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: var(--primary-color, #3b82f6);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.calculate-btn:hover {
    background: var(--primary-hover, #2563eb);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
}

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

.calculate-btn .btn-icon {
    width: 20px;
    height: 20px;
}

.clear-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color, #6b7280);
    background: white;
    border: 2px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-btn:hover {
    background: var(--bg-secondary, #f9fafb);
    border-color: var(--text-muted, #9ca3af);
}

.clear-btn svg {
    width: 18px;
    height: 18px;
}

/* Result Section */
.result-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 12px;
    border-left: 4px solid var(--primary-color, #3b82f6);
    animation: slideIn 0.3s ease;
}

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

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.result-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color, #1f2937);
    margin: 0;
}

.result-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted, #6b7280);
    transition: all 0.2s ease;
}

.result-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-color, #1f2937);
}

.result-close svg {
    width: 20px;
    height: 20px;
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.result-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted, #6b7280);
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color, #3b82f6);
}

.result-proportion {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color, #1f2937);
    
}

.result-check {
    font-size: 1rem;
    font-weight: 500;
    color: var(--success-color, #10b981);
}

.calculation-steps {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(59, 130, 246, 0.2);
}

.steps-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color, #1f2937);
    margin-bottom: 0.75rem;
}

.steps-content {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-color, #4b5563);
}

.step-item {
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    position: relative;
}

.step-item::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary-color, #3b82f6);
    font-weight: bold;
}

/* Error Message */
.error-message {
    margin-top: 1rem;
    padding: 1rem;
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    border-radius: 8px;
    color: #dc2626;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

/* Info Card */
.info-card {
    background: var(--card-bg, #ffffff);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color, #e5e7eb);
}

.info-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color, #1f2937);
    margin-bottom: 1.5rem;
}

.info-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-subtitle {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color, #1f2937);
    margin: 0;
}

.info-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-color, #4b5563);
    margin: 0;
}

.formula-box {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid var(--primary-color, #3b82f6);
}

.formula {
    display: block;
    
    font-size: 1rem;
    color: var(--text-color, #1f2937);
    font-weight: 600;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-list li {
    padding-left: 1.5rem;
    position: relative;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-color, #4b5563);
}

.info-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-color, #3b82f6);
    font-weight: bold;
    font-size: 1.25rem;
}

.examples-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.example-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid var(--primary-color, #3b82f6);
}

.example-question {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color, #1f2937);
    margin-bottom: 0.5rem;
}

.example-solution {
    font-size: 0.9375rem;
    color: var(--text-color, #4b5563);
    
    margin: 0;
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .calculator-card {
        padding: 1.5rem;
    }

    .proportion-formula {
        padding: 1.5rem 1rem;
        gap: 0.75rem;
    }

    .ratio-group {
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 0.25rem;
    }

    .ratio-input {
        width: 80px;
        padding: 0.625rem;
        font-size: 1rem;
    }

    .ratio-divider {
        width: 40px;
        height: 2px;
    }

    .equals-sign {
        width: 40px;
        height: 40px;
    }

    .equals-sign svg {
        width: 20px;
        height: 20px;
    }

    .action-section {
        flex-direction: column;
    }

    .calculate-btn,
    .clear-btn {
        width: 100%;
        justify-content: center;
    }

    .result-section {
        padding: 1.25rem;
    }

    .result-value {
        font-size: 1.25rem;
    }

    .info-card {
        padding: 1.5rem;
    }

    .info-title {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .proportion-formula {
        flex-direction: column;
    }

    .ratio-group {
        width: 100%;
        justify-content: center;
    }

    .equals-sign {
        transform: rotate(90deg);
    }
}
