/* 
 * 電卓のスタイルシート（複数テーマ対応版）
 */

/* ========== 共通スタイル ========== */

/* 電卓全体のラッパー */
.simple-calculator-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    margin: 20px 0;
}

/* テーマセレクター */
.calc-theme-selector {
    margin-bottom: 15px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.calc-theme-selector label {
    font-weight: bold;
    margin-right: 10px;
    color: #333;
}

.calc-theme-dropdown {
    padding: 5px 10px;
    border-radius: 5px;
    border: 2px solid #ddd;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.3s;
}

.calc-theme-dropdown:hover {
    border-color: #3498db;
}

.calc-theme-dropdown:focus {
    outline: none;
    border-color: #3498db;
}

/* 電卓本体の共通スタイル */
.calculator {
    border-radius: 15px;
    padding: 20px;
    max-width: 320px;
    width: 100%;
    transition: all 0.3s ease;
}

/* 表示画面の共通スタイル */
.calc-display {
    width: 100%;
    height: 60px;
    border: none;
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 10px 15px;
    font-size: 24px;
    text-align: right;
    box-sizing: border-box;
    font-family: 'Courier New', monospace;
}

/* ボタンのグリッドレイアウト */
.calc-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

/* すべてのボタンの基本スタイル */
.calc-btn {
    padding: 20px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.calc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.3);
}

.calc-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* イコールボタン */
.calc-equals {
    grid-column: span 1;
}

/* ANSボタン（6行目で4列分を占める） */
.calc-ans {
    grid-column: span 4;
    font-size: 16px; /* 幅が広いのでフォントサイズを調整 */
}

/* ========== テーマ1: クラシック（ダークブルー） ========== */

.theme-classic {
    background: linear-gradient(145deg, #2c3e50, #34495e);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.theme-classic .calc-display {
    background-color: #34495e;
    color: #ecf0f1;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

.theme-classic .calc-number {
    background: linear-gradient(145deg, #3498db, #2980b9);
    color: white;
}

.theme-classic .calc-number:hover {
    background: linear-gradient(145deg, #5dade2, #3498db);
}

.theme-classic .calc-operator {
    background: linear-gradient(145deg, #e67e22, #d35400);
    color: white;
}

.theme-classic .calc-operator:hover {
    background: linear-gradient(145deg, #f39c12, #e67e22);
}

.theme-classic .calc-equals {
    background: linear-gradient(145deg, #27ae60, #229954);
    color: white;
}

.theme-classic .calc-equals:hover {
    background: linear-gradient(145deg, #2ecc71, #27ae60);
}

.theme-classic .calc-clear {
    background: linear-gradient(145deg, #e74c3c, #c0392b);
    color: white;
}

.theme-classic .calc-clear:hover {
    background: linear-gradient(145deg, #ec7063, #e74c3c);
}

.theme-classic .calc-ans {
    background: linear-gradient(145deg, #9b59b6, #8e44ad);
    color: white;
}

.theme-classic .calc-ans:hover {
    background: linear-gradient(145deg, #af7ac5, #9b59b6);
}

.theme-classic .calc-delete {
    background: linear-gradient(145deg, #95a5a6, #7f8c8d);
    color: white;
}

.theme-classic .calc-delete:hover {
    background: linear-gradient(145deg, #bdc3c7, #95a5a6);
}

.theme-classic .calc-bracket {
    background: linear-gradient(145deg, #16a085, #138d75);
    color: white;
}

.theme-classic .calc-bracket:hover {
    background: linear-gradient(145deg, #1abc9c, #16a085);
}

/* ========== テーマ2: モダン（ホワイト＆ミニマル） ========== */

.theme-modern {
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
}

.theme-modern .calc-display {
    background-color: #f5f5f5;
    color: #333333;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0e0e0;
}

.theme-modern .calc-number {
    background: #f0f0f0;
    color: #333333;
    border: 1px solid #e0e0e0;
}

.theme-modern .calc-number:hover {
    background: #e8e8e8;
}

.theme-modern .calc-operator {
    background: #ff9500;
    color: white;
}

.theme-modern .calc-operator:hover {
    background: #ffaa33;
}

.theme-modern .calc-equals {
    background: #34c759;
    color: white;
}

.theme-modern .calc-equals:hover {
    background: #5dd97c;
}

.theme-modern .calc-clear {
    background: #ff3b30;
    color: white;
}

.theme-modern .calc-clear:hover {
    background: #ff5c54;
}

.theme-modern .calc-ans {
    background: #5856d6;
    color: white;
}

.theme-modern .calc-ans:hover {
    background: #7775e0;
}

.theme-modern .calc-delete {
    background: #8e8e93;
    color: white;
}

.theme-modern .calc-delete:hover {
    background: #aeaeb2;
}

.theme-modern .calc-bracket {
    background: #007aff;
    color: white;
}

.theme-modern .calc-bracket:hover {
    background: #3395ff;
}

/* ========== テーマ3: ネオン（サイバーパンク風） ========== */

.theme-neon {
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    box-shadow: 0 10px 40px rgba(255, 0, 255, 0.3);
    border: 2px solid #0f3460;
}

.theme-neon .calc-display {
    background-color: #0f3460;
    color: #00ff00;
    box-shadow: inset 0 2px 8px rgba(0, 255, 0, 0.2);
    border: 1px solid #00ff00;
    text-shadow: 0 0 10px #00ff00;
}

.theme-neon .calc-number {
    background: linear-gradient(145deg, #e94560, #c43250);
    color: white;
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.4);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.theme-neon .calc-number:hover {
    background: linear-gradient(145deg, #ff5577, #e94560);
    box-shadow: 0 6px 20px rgba(233, 69, 96, 0.6);
}

.theme-neon .calc-operator {
    background: linear-gradient(145deg, #00d4ff, #00a8cc);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.theme-neon .calc-operator:hover {
    background: linear-gradient(145deg, #33ddff, #00d4ff);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.6);
}

.theme-neon .calc-equals {
    background: linear-gradient(145deg, #00ff00, #00cc00);
    color: black;
    box-shadow: 0 4px 15px rgba(0, 255, 0, 0.4);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
    font-weight: 900;
}

.theme-neon .calc-equals:hover {
    background: linear-gradient(145deg, #33ff33, #00ff00);
    box-shadow: 0 6px 20px rgba(0, 255, 0, 0.6);
}

.theme-neon .calc-clear {
    background: linear-gradient(145deg, #ff0066, #cc0052);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 0, 102, 0.4);
}

.theme-neon .calc-clear:hover {
    background: linear-gradient(145deg, #ff3385, #ff0066);
    box-shadow: 0 6px 20px rgba(255, 0, 102, 0.6);
}

.theme-neon .calc-ans {
    background: linear-gradient(145deg, #9933ff, #7700cc);
    color: white;
    box-shadow: 0 4px 15px rgba(153, 51, 255, 0.4);
}

.theme-neon .calc-ans:hover {
    background: linear-gradient(145deg, #aa55ff, #9933ff);
    box-shadow: 0 6px 20px rgba(153, 51, 255, 0.6);
}

.theme-neon .calc-delete {
    background: linear-gradient(145deg, #ffa500, #ff8800);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 165, 0, 0.4);
}

.theme-neon .calc-delete:hover {
    background: linear-gradient(145deg, #ffbb33, #ffa500);
    box-shadow: 0 6px 20px rgba(255, 165, 0, 0.6);
}

.theme-neon .calc-bracket {
    background: linear-gradient(145deg, #00ffff, #00cccc);
    color: black;
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.4);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

.theme-neon .calc-bracket:hover {
    background: linear-gradient(145deg, #33ffff, #00ffff);
    box-shadow: 0 6px 20px rgba(0, 255, 255, 0.6);
}

/* ========== テーマ4: パステル（優しい色合い） ========== */

.theme-pastel {
    background: linear-gradient(145deg, #ffeaa7, #fdcb6e);
    box-shadow: 0 10px 30px rgba(253, 203, 110, 0.3);
}

.theme-pastel .calc-display {
    background-color: #fff5e1;
    color: #2d3436;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 2px solid #fab1a0;
}

.theme-pastel .calc-number {
    background: linear-gradient(145deg, #74b9ff, #a29bfe);
    color: white;
}

.theme-pastel .calc-number:hover {
    background: linear-gradient(145deg, #98c9ff, #b8b2ff);
}

.theme-pastel .calc-operator {
    background: linear-gradient(145deg, #fd79a8, #e84393);
    color: white;
}

.theme-pastel .calc-operator:hover {
    background: linear-gradient(145deg, #ff9abe, #fd79a8);
}

.theme-pastel .calc-equals {
    background: linear-gradient(145deg, #55efc4, #00b894);
    color: white;
}

.theme-pastel .calc-equals:hover {
    background: linear-gradient(145deg, #7ff5d4, #55efc4);
}

.theme-pastel .calc-clear {
    background: linear-gradient(145deg, #fab1a0, #ff7675);
    color: white;
}

.theme-pastel .calc-clear:hover {
    background: linear-gradient(145deg, #fcc5b8, #fab1a0);
}

.theme-pastel .calc-ans {
    background: linear-gradient(145deg, #a29bfe, #6c5ce7);
    color: white;
}

.theme-pastel .calc-ans:hover {
    background: linear-gradient(145deg, #bbb5ff, #a29bfe);
}

.theme-pastel .calc-delete {
    background: linear-gradient(145deg, #ffeaa7, #fdcb6e);
    color: #2d3436;
}

.theme-pastel .calc-delete:hover {
    background: linear-gradient(145deg, #fff5c8, #ffeaa7);
}

.theme-pastel .calc-bracket {
    background: linear-gradient(145deg, #81ecec, #00cec9);
    color: white;
}

.theme-pastel .calc-bracket:hover {
    background: linear-gradient(145deg, #a3f5f5, #81ecec);
}

/* ========== テーマ5: ダーク（真っ黒） ========== */

.theme-dark {
    background: linear-gradient(145deg, #000000, #1a1a1a);
    box-shadow: 0 10px 40px rgba(255, 255, 255, 0.1);
    border: 1px solid #333333;
}

.theme-dark .calc-display {
    background-color: #0a0a0a;
    color: #00ff00;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8);
    border: 1px solid #333333;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

.theme-dark .calc-number {
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    color: #ffffff;
    border: 1px solid #404040;
}

.theme-dark .calc-number:hover {
    background: linear-gradient(145deg, #3a3a3a, #2a2a2a);
}

.theme-dark .calc-operator {
    background: linear-gradient(145deg, #ff6b00, #cc5500);
    color: white;
}

.theme-dark .calc-operator:hover {
    background: linear-gradient(145deg, #ff8533, #ff6b00);
}

.theme-dark .calc-equals {
    background: linear-gradient(145deg, #00cc00, #009900);
    color: white;
}

.theme-dark .calc-equals:hover {
    background: linear-gradient(145deg, #00ff00, #00cc00);
}

.theme-dark .calc-clear {
    background: linear-gradient(145deg, #cc0000, #990000);
    color: white;
}

.theme-dark .calc-clear:hover {
    background: linear-gradient(145deg, #ff0000, #cc0000);
}

.theme-dark .calc-ans {
    background: linear-gradient(145deg, #6600cc, #4400aa);
    color: white;
}

.theme-dark .calc-ans:hover {
    background: linear-gradient(145deg, #8833dd, #6600cc);
}

.theme-dark .calc-delete {
    background: linear-gradient(145deg, #555555, #333333);
    color: white;
    border: 1px solid #666666;
}

.theme-dark .calc-delete:hover {
    background: linear-gradient(145deg, #666666, #555555);
}

.theme-dark .calc-bracket {
    background: linear-gradient(145deg, #0099cc, #007799);
    color: white;
}

.theme-dark .calc-bracket:hover {
    background: linear-gradient(145deg, #00bbee, #0099cc);
}

/* ========== レスポンシブデザイン ========== */

@media (max-width: 480px) {
    .calculator {
        max-width: 280px;
        padding: 15px;
    }
    
    .calc-display {
        height: 50px;
        font-size: 20px;
    }
    
    .calc-btn {
        padding: 15px;
        font-size: 16px;
    }
    
    .calc-buttons {
        gap: 8px;
    }
    
    .calc-theme-selector {
        font-size: 14px;
    }
    
    .calc-theme-dropdown {
        font-size: 12px;
    }
}
