/*
Theme Name: GraphCalc Pro
Description: Professional graphing calculator and data visualization platform with interactive mathematical plotting using Plotly.js. Features real-time function plotting, data visualization charts, and mobile-responsive design.
Version: 1.0.0
Author: GraphCalc Pro Team
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: calculator, mathematics, plotting, visualization, interactive, charts, education
*/

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.6;
}

/* Header styles */
.site-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2563eb;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.site-title:hover {
    color: #1d4ed8;
    text-decoration: none;
}

/* Main content */
.site-main {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Calculator container */
.calculator-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: 80vh;
}

/* Tab navigation */
.tab-navigation {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.tab-button {
    flex: 1;
    padding: 1rem 2rem;
    border: none;
    background: transparent;
    font-size: 1rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.tab-button:hover {
    background: #e2e8f0;
    color: #334155;
}

.tab-button.active {
    background: white;
    color: #2563eb;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #2563eb;
}

/* Tab content */
.tab-content {
    padding: 2rem;
    min-height: 600px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Function plotter styles */
.function-plotter {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    height: 70vh;
}

.controls-panel {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    overflow-y: auto;
}

.control-section {
    margin-bottom: 2rem;
}

.control-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.function-input {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    align-items: center;
}

.function-input input[type="text"] {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
}

.function-input input[type="color"] {
    width: 40px;
    height: 35px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

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

.btn-secondary:hover {
    background: #4b5563;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Graph area */
.graph-area {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    position: relative;
}

.graph-toolbar {
    background: #f8fafc;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toolbar-section {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.range-input {
    width: 80px;
    padding: 0.25rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.875rem;
}

/* Data visualization styles */
.visualization-tools {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    height: 70vh;
}

.chart-controls {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    overflow-y: auto;
}

.chart-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.chart-type {
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.chart-type:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.chart-type.active {
    border-color: #2563eb;
    background: #dbeafe;
}

.chart-type-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.chart-area {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 1rem;
    overflow: hidden;
}

/* Data input styles */
.data-input {
    margin-bottom: 1.5rem;
}

.data-input label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.data-input textarea {
    width: 100%;
    height: 120px;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    resize: vertical;
}

.data-input input[type="text"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

/* Responsive design */
@media (max-width: 768px) {
    .function-plotter,
    .visualization-tools {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .controls-panel,
    .chart-controls {
        order: 2;
        max-height: 300px;
    }
    
    .graph-area,
    .chart-area {
        order: 1;
        height: 400px;
    }
    
    .site-main {
        padding: 0 0.5rem;
        margin: 1rem auto;
    }
    
    .tab-content {
        padding: 1rem;
    }
    
    .header-content {
        padding: 0 1rem;
    }
    
    .site-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .tab-button {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .chart-selector {
        grid-template-columns: 1fr;
    }
    
    .function-input {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .function-input input[type="color"] {
        width: 100%;
        height: 40px;
    }
}

/* Loading animation */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error states */
.error-message {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 0.75rem;
    margin: 0.5rem 0;
    font-size: 0.875rem;
}

/* Success states */
.success-message {
    color: #059669;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 0.75rem;
    margin: 0.5rem 0;
    font-size: 0.875rem;
}

/* Footer */
.site-footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem 0;
    margin-top: 2rem;
    text-align: center;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}