/* Tool Hero Section - Required by tool-page-structure.mdc */
.tool-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.hero-text {
    flex: 1;
    min-width: 260px;
}

.hero-text h1 {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 640px;
    margin-bottom: 1rem;
    margin-top: 0;
}

@media (max-width: 767px) {
    .hero-text h1 {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
    }
    
    .hero-subtitle {
        font-size: clamp(1rem, 3vw, 1.125rem);
    }
}

/* Normal Distribution Calculator Styles */
.normal-dist-calculator {
    margin: 2rem 0;
}

.calc-wrapper {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 2rem;
    align-items: start;
}

.calc-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

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

.calc-header {
    margin-bottom: 1.5rem;
}

.calc-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.calc-subtitle {
    font-size: 0.95rem;
    color: #6b7280;
    margin: 0;
}

/* Parameters Grid */
.params-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

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

.param-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.label-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    font-size: 1.25rem;
    font-weight: 600;
    flex-shrink: 0;
}

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

.label-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: #111827;
}

.label-desc {
    font-size: 0.85rem;
    color: #6b7280;
}

.param-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    color: #111827;
    transition: all 0.2s ease;
}

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

.param-input::placeholder {
    color: #9ca3af;
}

/* Calculation Modes */
.calc-modes {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.mode-tab {
    flex: 1;
    min-width: 120px;
    padding: 0.875rem 1.25rem;
    background: #f3f4f6;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #6b7280;
}

.mode-tab:hover {
    background: #e5e7eb;
    color: #374151;
}

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

.tab-icon {
    font-size: 1.1rem;
}

.tab-text {
    font-weight: 500;
}

/* Mode Content */
.mode-content {
    display: none;
}

.mode-content.active {
    display: block;
}

.input-group {
    margin-bottom: 1.25rem;
}

.input-group:last-child {
    margin-bottom: 0;
}

.input-label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.input-label-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: #111827;
}

.input-label-hint {
    font-size: 0.85rem;
    color: #6b7280;
}

.input-field {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    color: #111827;
    transition: all 0.2s ease;
}

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

.input-field::placeholder {
    color: #9ca3af;
}

/* Range Inputs */
.range-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.range-separator {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.5rem 0;
}

.separator-line {
    flex: 1;
    height: 2px;
    background: #e5e7eb;
}

.separator-text {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
    padding: 0 0.5rem;
}

/* Action Buttons */
.calc-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.btn-calculate,
.btn-reset {
    flex: 1;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

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

.btn-reset {
    background: #f3f4f6;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.btn-reset:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.btn-icon {
    font-size: 1.1rem;
}

.btn-text {
    font-weight: 600;
}

/* Sidebar */
.calc-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 2rem;
}

.results-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    animation: slideIn 0.3s ease;
}

.visualization-card {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

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

.viz-title,
.results-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.viz-toggle {
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viz-toggle:hover {
    background: #e5e7eb;
}

.toggle-icon {
    font-size: 1.1rem;
}

.viz-container {
    position: relative;
    width: 100%;
    background: #f9fafb;
    border-radius: 12px;
    overflow: hidden;
}

#bell-curve {
    width: 100%;
    height: auto;
    display: block;
}

.viz-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.overlay-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ef4444;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay-line.visible {
    opacity: 1;
}

.overlay-label {
    position: absolute;
    top: 10px;
    transform: translateX(-50%);
    background: #ef4444;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.overlay-label.visible {
    opacity: 1;
}

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

.results-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.results-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.results-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-item {
    padding: 1rem;
    background: #f9fafb;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.result-label {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}

.result-description {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
}

.result-grid-item {
    padding: 0.75rem;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    text-align: center;
}

.result-grid-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.result-grid-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: #f9fafb;
    border-radius: 16px;
    border: 2px dashed #e5e7eb;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.75rem 0;
}

.empty-text {
    font-size: 0.95rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.6;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .calc-wrapper {
        grid-template-columns: 1fr;
    }

    .calc-sidebar {
        position: static;
    }

    .params-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .normal-dist-calculator {
        margin: 1.5rem 0;
    }

    .calc-card {
        padding: 1.5rem;
    }

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

    .calc-subtitle {
        font-size: 0.9rem;
    }

    .params-grid {
        gap: 1rem;
    }

    .label-icon {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    .calc-modes {
        flex-direction: column;
    }

    .mode-tab {
        width: 100%;
    }

    .calc-actions {
        flex-direction: column;
    }

    .result-grid {
        grid-template-columns: 1fr;
    }

    .empty-state {
        padding: 2rem 1.5rem;
    }

    .empty-icon {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .calc-card {
        padding: 1.25rem;
        border-radius: 12px;
    }

    .calc-title {
        font-size: 1.1rem;
    }

    .label-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .param-input,
    .input-field {
        padding: 0.75rem 0.875rem;
        font-size: 0.95rem;
    }

    .btn-calculate,
    .btn-reset {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }
}
