/* SQLターミナルのスタイル */

.sql-terminal-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.sql-terminal-modal.active {
    display: flex;
}

.sql-terminal-container {
    background: #1a1a1a;
    border: 2px solid #00ff00;
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
    height: 70vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.3);
}

.sql-terminal-header {
    background: #2a2a2a;
    color: #00ff00;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #00ff00;
    border-radius: 6px 6px 0 0;
}

.sql-terminal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
}

.sql-terminal-close-btn {
    background: none;
    border: none;
    color: #00ff00;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.sql-terminal-close-btn:hover {
    color: #ff0000;
}

.sql-terminal-output {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    color: #00ff00;
    background: #000000;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.terminal-welcome {
    color: #00aa00;
    margin-bottom: 15px;
    line-height: 1.6;
}

.terminal-command {
    color: #ffffff;
    margin: 10px 0 5px 0;
}

.terminal-result {
    color: #00ff00;
    margin: 5px 0 10px 20px;
    line-height: 1.4;
}

.terminal-error {
    color: #ff3333;
    margin: 5px 0 10px 20px;
    line-height: 1.4;
}

.terminal-table {
    margin: 10px 0;
    border-collapse: collapse;
    color: #00ff00;
}

.terminal-table th,
.terminal-table td {
    border: 1px solid #00ff00;
    padding: 8px 12px;
    text-align: left;
}

.terminal-table th {
    background: #1a5a1a;
    font-weight: bold;
}

.terminal-table tr:nth-child(even) {
    background: #0a0a0a;
}

.terminal-table tr:nth-child(odd) {
    background: #000000;
}

.sql-terminal-input-area {
    display: flex;
    align-items: flex-start;
    padding: 15px 20px;
    background: #0a0a0a;
    border-top: 1px solid #00ff00;
    border-radius: 0 0 6px 6px;
}

.sql-terminal-prompt {
    color: #00ff00;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    font-weight: bold;
    margin-right: 10px;
}

.sql-terminal-input {
    flex: 1;
    background: #000000;
    border: 1px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    padding: 10px 15px;
    outline: none;
    border-radius: 4px;
    resize: none;
    min-height: 40px;
    max-height: 200px;
    line-height: 1.5;
    overflow-y: auto;
}

.sql-terminal-input::placeholder {
    color: #006600;
}

.sql-terminal-input:focus {
    border-color: #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

/* スクロールバーのカスタマイズ（Webkit系ブラウザ） */
.sql-terminal-output::-webkit-scrollbar {
    width: 10px;
}

.sql-terminal-output::-webkit-scrollbar-track {
    background: #000000;
}

.sql-terminal-output::-webkit-scrollbar-thumb {
    background: #00ff00;
    border-radius: 5px;
}

.sql-terminal-output::-webkit-scrollbar-thumb:hover {
    background: #00cc00;
}

/* textarea用のスクロールバー */
.sql-terminal-input::-webkit-scrollbar {
    width: 8px;
}

.sql-terminal-input::-webkit-scrollbar-track {
    background: #000000;
}

.sql-terminal-input::-webkit-scrollbar-thumb {
    background: #00ff00;
    border-radius: 4px;
}

.sql-terminal-input::-webkit-scrollbar-thumb:hover {
    background: #00cc00;
}

/* モバイル対応 */
@media (max-width: 768px) {
    .sql-terminal-container {
        width: 95%;
        height: 80vh;
    }

    .sql-terminal-header h3 {
        font-size: 16px;
    }

    .sql-terminal-output {
        font-size: 12px;
        padding: 15px;
    }

    .sql-terminal-input {
        font-size: 12px;
        padding: 8px 12px;
    }

    .sql-terminal-prompt {
        font-size: 12px;
    }

    .terminal-table th,
    .terminal-table td {
        padding: 6px 8px;
        font-size: 11px;
    }
}
