/* 数学グラフ描画ツール スタイルシート */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
}

.language-selector {
    margin-top: 20px;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    padding: 8px 16px;
    margin: 0 5px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.lang-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
}

main {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.input-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.function-inputs {
    margin-bottom: 20px;
}

.function-input-group {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
}

.function-input {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    transition: border-color 0.3s ease;
}

.function-input:focus {
    outline: none;
    border-color: #667eea;
}

.color-picker {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.color-picker:hover {
    transform: scale(1.1);
}

.remove-function {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.remove-function:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

#add-function {
    width: 100%;
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

#add-function:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.settings {
    margin-bottom: 30px;
}

.settings h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.setting-group {
    margin-bottom: 15px;
}

.setting-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #555;
}

.setting-group input[type="number"] {
    width: 80px;
    padding: 6px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
}

.setting-group input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

.setting-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.actions button {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

#plot-button {
    background: #2ecc71;
    color: white;
}

#plot-button:hover {
    background: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
}

#clear-button {
    background: #95a5a6;
    color: white;
}

#clear-button:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

#export-button {
    background: #3498db;
    color: white;
}

#export-button:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.canvas-section {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    min-height: 600px;
}

#graph-canvas {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    cursor: crosshair;
}

#coordinates {
    position: absolute;
    top: 10px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    display: none;
}

.examples {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.examples h2 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.example-btn {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    padding: 15px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 14px;
}

.example-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.help {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.help h2 {
    color: #333;
    margin-bottom: 20px;
}

.help ul {
    list-style: none;
    padding-left: 0;
}

.help li {
    padding: 10px 0;
    color: #555;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    padding-left: 25px;
}

.help li:before {
    content: "📐";
    position: absolute;
    left: 0;
}

.help li:last-child {
    border-bottom: none;
}

footer {
    text-align: center;
    color: white;
    padding: 20px 0;
    font-size: 14px;
}

/* レスポンシブデザイン */
@media (max-width: 968px) {
    main {
        grid-template-columns: 1fr;
    }
    
    .canvas-section {
        min-height: 400px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .actions {
        grid-template-columns: 1fr;
    }
    
    .example-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .input-section,
    .canvas-section,
    .examples,
    .help {
        padding: 20px;
    }
    
    .function-input-group {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .color-picker {
        width: 100%;
        height: 30px;
        border-radius: 6px;
    }
}