* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', sans-serif;
    line-height: 1.6;
    padding: 20px;
    background-color: #f5f5f5;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

.hidden {
    display: none !important;
}

#functions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

.function-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    min-height: 250px;
}

.function-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.function-card h3 {
    margin-bottom: 5px;
    color: #2c3e50;
}

.function-card p {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-weight: bold;
}

.function-card .math-expression {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 10px 5px;
    background-color: rgba(52, 152, 219, 0.05);
    border-radius: 4px;
    min-height: 80px;
}

.function-card .math-expression .MathJax_Display {
    margin: 0 !important;
}

.function-card .math-expression .MathJax_SVG_Display {
    margin: 0 !important;
}

.function-card .math-expression .MathJax {
    font-size: 0.9em;
}

.function-card .mini-plot {
    height: 200px;
    margin-top: 10px;
    background: white;
}

.mini-plot {
    width: 100%;
    height: 200px;
    border-radius: 4px;
    overflow: hidden;
}

.btn {
    padding: 8px 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.btn:hover {
    background-color: #2980b9;
}

.function-detail {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

#back-btn {
    margin-bottom: 20px;
}

.info-tooltips {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}

.tooltip {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    flex: 1;
}

.tooltip-title {
    font-weight: bold;
    color: #2c3e50;
    display: block;
    margin-bottom: 8px;
}

#graph {
    width: 100%;
    height: 600px;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow: hidden;
}

.calculator {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-top: 20px;
}

#x-input {
    width: 100px;
    padding: 8px;
    margin: 0 10px;
}

#result {
    margin-left: 10px;
    font-weight: bold;
}
