/* 分数カード生成アプリ - WordPressプラグイン用CSS */

.fraction-card-generator-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0e7ff 50%, #fce7f3 100%);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

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

.fraction-header h2 {
    color: #1f2937;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.fraction-header p {
    color: #6b7280;
    font-size: 1.1rem;
    margin: 0;
}

.fraction-main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
    .fraction-main-content {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
}

.fraction-preview-section h3,
.fraction-controls-section h3 {
    color: #374151;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.fraction-preview-section h3::before {
    content: "🎨";
}

.fraction-controls-section h3::before {
    content: "⚙️";
}

.canvas-container {
    display: flex;
    justify-content: center;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 20px;
}

#fractionCanvas {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 100%;
    height: auto;
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.color-presets {
    margin-bottom: 20px;
}

.color-presets h4 {
    color: #374151;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-presets h4::before {
    content: "🎨";
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.preset-btn {
    padding: 12px 8px;
    border: 2px solid;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.preset-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.fraction-inputs {
    background: #f9fafb;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.fraction-inputs h4 {
    color: #374151;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fraction-inputs h4::before {
    content: "📝";
}

.input-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.input-field label {
    display: block;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
}

.input-field input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.input-field input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.fraction-display {
    text-align: center;
    padding: 12px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-weight: 600;
    color: #374151;
}

.quick-fractions {
    margin-bottom: 20px;
}

.quick-fractions h4 {
    color: #374151;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-fractions h4::before {
    content: "🔢";
}

.fraction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 8px;
}

.fraction-btn {
    padding: 8px 4px;
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.fraction-btn:hover {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1d4ed8;
    transform: scale(1.05);
}

.advanced-settings {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.settings-toggle {
    width: 100%;
    padding: 15px;
    background: #f9fafb;
    border: none;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-align: left;
}

.settings-toggle:hover {
    background: #f3f4f6;
}

.settings-panel {
    padding: 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

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

.setting-group label {
    display: block;
    color: #374151;
    font-weight: 500;
    margin-bottom: 8px;
}

.setting-group select,
.setting-group input[type="range"] {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.setting-group select:focus,
.setting-group input[type="range"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.setting-group input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
}

.paper-preview {
    background: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    margin-top: 20px;
}

.paper-preview h4 {
    color: #374151;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.paper-preview h4::before {
    content: "📄";
}

.paper-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

#paperDimensions {
    padding: 8px 12px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.color-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.color-input label {
    display: block;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
}

.color-input input[type="color"] {
    width: 100%;
    height: 40px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
    background: none;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.fraction-footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
}

.fraction-footer p {
    margin: 5px 0;
    color: #6b7280;
}

.fraction-footer p:first-child {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
}

/* レスポンシブ対応 */
@media (max-width: 480px) {
    .fraction-card-generator-container {
        margin: 10px;
        padding: 15px;
    }
    
    .fraction-header h2 {
        font-size: 2rem;
    }
    
    .input-group {
        grid-template-columns: 1fr;
    }
    
    .preset-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .fraction-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .color-controls {
        grid-template-columns: 1fr;
    }
}

/* アクセシビリティ */
.fraction-card-generator-container *:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* ローディング状態 */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* 成功メッセージ */
.success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}