/**
 * Integral Calculator Plugin Styles
 * Version: 1.0.0
 * Author: GiaSuVietEdu
 */

 .integral-calculator-container {
    max-width: 1200px;
    margin: 20px auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    overflow: hidden;
    position: relative;
}

.integral-calculator-container * {
    box-sizing: border-box;
}

/* Header */
.ic-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.ic-header h1 {
    font-size: 2.2em;
    margin-bottom: 10px;
    font-weight: 700;
}

.ic-header p {
    font-size: 1.1em;
    opacity: 0.95;
}

/* Main Content */
.ic-main-content {
    padding: 30px;
}

/* Examples */
.ic-examples {
    background: #fff3cd;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #ffc107;
}

.ic-examples h4 {
    color: #856404;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.ic-example-list {
    list-style: none;
    color: #856404;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ic-example-list li {
    padding: 8px 15px;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(255,255,255,0.5);
    border-radius: 5px;
    font-size: 0.95em;
}

.ic-example-list li:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* Input Section */
.ic-input-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.ic-input-group {
    margin-bottom: 20px;
}

.ic-input-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 1.05em;
}

.ic-input-group input,
.ic-input-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
}

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

/* Math Keyboard */
.ic-toggle-keyboard {
    background: #e9ecef;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    transition: all 0.3s;
}

.ic-toggle-keyboard:hover {
    background: #667eea;
    color: white;
}

.ic-math-keyboard {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
    display: none;
    border: 1px solid #e0e0e0;
}

.ic-math-keyboard.active {
    display: block;
    animation: slideDown 0.3s ease;
}

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

.ic-keyboard-section {
    margin-bottom: 15px;
}

.ic-keyboard-section h5 {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ic-keyboard-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 5px;
}

.ic-math-btn {
    padding: 10px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    font-family: 'Courier New', monospace;
}

.ic-math-btn:hover {
    background: #667eea;
    color: white;
    transform: scale(1.05);
}

/* Math Display */
.ic-math-display {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 15px 0;
    border: 2px solid #667eea;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3em;
}

/* Bounds Inputs */
.ic-bounds-inputs {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.ic-bounds-inputs.active {
    display: grid;
}

.ic-infinity-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.ic-infinity-btn {
    padding: 8px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.1em;
}

.ic-infinity-btn:hover {
    background: #667eea;
    color: white;
}

/* Buttons */
.ic-button-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.ic-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
    min-width: 150px;
}

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

.ic-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.ic-btn-secondary {
    background: #6c757d;
    color: white;
}

.ic-btn-secondary:hover {
    background: #5a6268;
}

/* Results */
.ic-result-section {
    display: none;
    animation: fadeIn 0.5s;
}

.ic-result-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ic-result-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 20px;
    border-left: 5px solid #667eea;
}

.ic-result-card h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.ic-result-value {
    font-size: 1.2em;
    color: #667eea;
    font-weight: 600;
    padding: 20px;
    background: white;
    border-radius: 8px;
    margin-top: 10px;
    text-align: center;
}

.ic-steps-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-top: 15px;
}

.ic-step {
    padding: 12px;
    margin: 10px 0;
    background: #f1f3f5;
    border-radius: 5px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    border-left: 3px solid #667eea;
}

#icGraph {
    width: 100%;
    height: 400px;
    margin-top: 20px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Error & Loading */
.ic-error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    display: none;
    border-left: 4px solid #dc3545;
}

.ic-error-message.active {
    display: block;
}

.ic-loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.ic-loading.active {
    display: block;
}

.ic-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Watermark */
.ic-watermark {
    position: absolute;
    bottom: 10px;
    right: 15px;
    font-size: 11px;
    color: #999;
    opacity: 0.7;
    pointer-events: none;
}

/* Anti-copy styles */
.integral-calculator-container[data-protected="true"] {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
}

.integral-calculator-container[data-protected="true"] input,
.integral-calculator-container[data-protected="true"] select {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* Responsive */
@media (max-width: 768px) {
    .ic-header h1 {
        font-size: 1.6em;
    }
    
    .ic-button-group {
        flex-direction: column;
    }
    
    .ic-btn {
        width: 100%;
    }
    
    .ic-bounds-inputs {
        grid-template-columns: 1fr;
    }
    
    .ic-example-list {
        flex-direction: column;
    }
    
    .ic-example-list li {
        width: 100%;
    }
}

/* Print protection */
@media print {
    .integral-calculator-container {
        display: none !important;
    }
    
    body:after {
        content: "⚠️ Nội dung được bảo vệ bản quyền bởi GiaSuVietEdu.com.vn";
        display: block;
        text-align: center;
        font-size: 20px;
        color: red;
        margin-top: 100px;
    }
}