/* Function Plotter Calculator Styles */

/* Main container styles */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Function input area */
.function-input-group {
    margin-bottom: 1rem;
}

.function-input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.function-input-row .color-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.function-input-row input[type="text"] {
    flex: 1;
    min-width: 0;
}

.function-input-row .btn-remove {
    padding: 0.5rem 0.75rem;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.function-input-row .btn-remove:hover {
    background: #c82333;
    transform: scale(1.05);
}

.btn-add-function {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-add-function:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-add-function:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Form input styles */
.form-input,
input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e7ff;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus,
input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Parameter slider styles */
.parameter-slider {
    margin-bottom: 1.5rem;
}

.parameter-slider label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.slider-container input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
    outline: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid #667eea;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-container input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.5);
}

.slider-container input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid #667eea;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-container input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.5);
}

.slider-value {
    min-width: 60px;
    text-align: center;
    font-weight: 600;
    color: #667eea;
    font-size: 1.1rem;
}

/* Chart container */
.chart-container {
    position: relative;
    width: 100%;
    height: 500px;
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Analysis tools */
.analysis-tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.analysis-tools .btn-analysis {
    padding: 0.75rem 1rem;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.analysis-tools .btn-analysis:hover {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8edff 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.analysis-tools .btn-analysis:active {
    transform: translateY(0);
}

/* Results display */
.result-item {
    padding: 1rem;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8edff 100%);
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.result-item h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.25rem;
}

.result-description {
    font-size: 0.9rem;
    color: #6c757d;
    margin: 0;
}

/* Steps display */
.steps-container {
    margin-top: 1rem;
}

.step-item {
    padding: 1rem;
    background: white;
    border-left: 4px solid #667eea;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.step-item .step-number {
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.step-item .step-content {
    color: #495057;
    line-height: 1.6;
}

.step-item .katex {
    font-size: 1.1rem;
}

/* 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);
}

/* Toggle button for steps */
.btn-toggle-steps {
    width: 100%;
    padding: 0.75rem;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.btn-toggle-steps:hover {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8edff 100%);
}

.btn-toggle-steps i {
    transition: transform 0.3s ease;
}

.btn-toggle-steps.active i {
    transform: rotate(180deg);
}

/* Error message */
.error-message {
    padding: 1rem;
    background: #fff3cd;
    border: 1px solid #ffeeba;
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    color: #856404;
    margin-bottom: 1rem;
}

/* Success message */
.success-message {
    padding: 1rem;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-left: 4px solid #28a745;
    border-radius: 8px;
    color: #155724;
    margin-bottom: 1rem;
}

/* Info message */
.info-message {
    padding: 1rem;
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-left: 4px solid #17a2b8;
    border-radius: 8px;
    color: #0c5460;
    margin-bottom: 1rem;
}

/* Responsive design */
@media (max-width: 992px) {
    .chart-container {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
    }

    .page-header .subtitle {
        font-size: 1rem;
    }

    .chart-container {
        height: 350px;
    }

    .analysis-tools {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .action-buttons-grid {
        grid-template-columns: 1fr;
    }

    .chart-container {
        height: 300px;
        padding: 0.5rem;
    }

    .function-input-row {
        flex-wrap: wrap;
    }

    .function-input-row input[type="text"] {
        width: 100%;
        order: 2;
    }

    .function-input-row .color-indicator {
        order: 1;
    }

    .function-input-row .btn-remove {
        order: 3;
        width: 100%;
        margin-top: 0.5rem;
    }
}

/* Print styles */
@media print {
    .action-buttons-grid,
    .btn-toggle-steps,
    .analysis-tools {
        display: none !important;
    }

    .glass-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .chart-container {
        page-break-inside: avoid;
    }
}
