/* /var/www/html/pylist/style.css */

/* 基本スタイル */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; /* モダンなフォント */
    background-color: #f8f9fa; /* 明るいグレーの背景 */
    color: #343a40; /* 濃いめのテキストカラー */
    margin: 0;
    padding: 20px;
    line-height: 1.6;
}

h1 {
    text-align: center;
    color: #495057; /* 少し落ち着いた見出し色 */
    margin-bottom: 40px; /* 見出し下の余白を増やす */
    font-weight: 300; /* 少し細めのフォントウェイト */
}

.container {
    max-width: 960px; /* コンテンツの最大幅 */
    margin: 0 auto; /* 中央寄せ */
    background-color: #ffffff; /* コンテンツエリアの背景色 */
    padding: 30px 40px; /* パディングを調整 */
    border-radius: 8px; /* 角丸 */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08); /* 少し濃い影 */
    overflow: hidden; /* 子要素のはみ出し防止 */
}

/* ディレクトリ選択 */
.directory-selector {
    margin-bottom: 30px; /* 下の要素との間隔 */
    display: flex;
    align-items: center;
    gap: 15px; /* ラベルとセレクトボックスの間隔 */
}

.directory-selector label {
    font-weight: 600; /* 少し太字 */
    color: #495057;
    white-space: nowrap; /* ラベルが折り返さないように */
}

.directory-selector select {
    padding: 10px 15px; /* パディングを調整 */
    border: 1px solid #ced4da; /* ボーダー色 */
    border-radius: 6px; /* 角丸 */
    flex-grow: 1; /* 幅を親要素に合わせる */
    background-color: #fff;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.directory-selector select:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}


/* スクリプトテーブル */
.table-container {
    margin-bottom: 25px;
    overflow-x: auto; /* テーブルがはみ出す場合にスクロール */
}

.script-table {
    width: 100%;
    border-collapse: collapse; /* ボーダーを重ねる */
    border: 1px solid #dee2e6; /* テーブル全体のボーダー */
    border-radius: 6px; /* テーブルの角丸（overflow:hiddenが必要な場合あり） */
    overflow: hidden; /* 角丸を有効にする */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.script-table th,
.script-table td {
    padding: 12px 15px; /* セルの余白 */
    text-align: left;
    vertical-align: middle; /* 上下中央揃え */
    border-bottom: 1px solid #dee2e6; /* 行間の線 */
}
.script-table tbody tr:last-child td {
    border-bottom: none; /* 最後の行の下線は消す */
}

.script-table th {
    background-color: #e9ecef; /* ヘッダーの背景色 */
    font-weight: 600; /* ヘッダーの文字を太く */
    color: #495057;
    font-size: 0.9em;
    text-transform: uppercase; /* 大文字に */
    letter-spacing: 0.5px; /* 文字間隔 */
}

.script-table tbody tr {
    transition: background-color 0.15s ease; /* ホバー効果を滑らかに */
}

.script-table tbody tr:hover {
    background-color: #f1f3f5; /* ホバー時の背景色 */
}

.script-table td:first-child { /* 選択チェックボックスの列 */
    width: 8%;
    text-align: center;
}
.script-table td:nth-child(2) { /* ファイル名の列 */
    width: 62%;
    font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 等幅フォント */
    color: #0056b3; /* ファイル名を少し目立たせる */
}
.script-table td:last-child { /* ステータスの列 */
    width: 30%;
}

/* ステータス表示 */
.status-cell {
    text-align: center; /* ステータスを中央揃え */
}
.status-badge {
    padding: 5px 12px; /* パディング調整 */
    border-radius: 15px; /* より丸いバッジ */
    font-size: 0.85em;
    font-weight: 600; /* 少し太字 */
    color: #fff;
    display: inline-block;
    min-width: 80px; /* 最小幅 */
    text-align: center;
    text-transform: uppercase; /* 大文字 */
    letter-spacing: 0.5px;
}

.running .status-badge { background-color: #28a745; } /* 緑 */
.stopped .status-badge { background-color: #dc3545; } /* 赤 */
.unknown .status-badge,
.failed .status-badge { background-color: #6c757d; } /* グレー */

.loading-row td {
    text-align: center;
    color: #868e96; /* 少し薄いグレー */
    padding: 30px 15px; /* ローディング表示の余白 */
    font-style: italic;
}


/* ボタン */
.action-buttons {
    display: flex;
    justify-content: flex-end; /* 右寄せ */
    gap: 12px; /* ボタン間のスペース */
    margin-top: 20px; /* テーブルとの間隔 */
}

button,
input[type="submit"] {
    padding: 10px 25px; /* ボタンのパディング */
    border: none;
    border-radius: 6px; /* 角丸 */
    cursor: pointer;
    font-weight: 600; /* ボタンの文字を太く */
    font-size: 0.95rem;
    transition: background-color 0.2s ease, transform 0.1s ease; /* ホバー効果 */
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button:hover,
input[type="submit"]:hover {
    opacity: 0.9;
}
button:active,
input[type="submit"]:active {
    transform: translateY(1px); /* クリック時に少し沈む効果 */
}

.start-button { background-color: #007bff; } /* 青 */
.start-button:hover { background-color: #0056b3; }

.stop-button { background-color: #dc3545; } /* 赤 */
.stop-button:hover { background-color: #c82333; }

.setting-button { background-color: #28a745; } /* 緑 */
.setting-button:hover { background-color: #218838; }


/* スケジュール設定 */
.schedule-section {
    margin-top: 40px; /* 上の要素との間隔 */
    padding: 25px 30px; /* パディング */
    background-color: #f8f9fa; /* 背景色 */
    border-radius: 8px; /* 角丸 */
    border: 1px solid #e9ecef; /* ボーダー */
}

.schedule-display {
    margin-bottom: 20px; /* スケジュール表示とフォームの間隔 */
    color: #495057;
    font-size: 1rem;
}

#currentSchedule {
    font-weight: 600;
    color: #007bff; /* スケジュール時刻を青色に */
    background-color: #e9ecef;
    padding: 4px 10px;
    border-radius: 4px;
    margin-left: 5px; /* ラベルとの間隔 */
}

.schedule-form {
    display: flex;
    flex-wrap: wrap; /* 折り返し */
    align-items: center;
    gap: 15px; /* 要素間のスペース */
}

.schedule-form label {
    font-size: 0.95em;
    color: #495057;
    margin-right: -5px; /* selectとの間隔調整 */
}

.schedule-form select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background-color: #fff;
    font-size: 0.95rem;
}
.schedule-form select:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.schedule-form .setting-button {
    margin-left: 10px; /* 設定ボタンの左マージン */
}

/* エラーメッセージ */
.error-message {
    color: #721c24; /* 暗めの赤 */
    background-color: #f8d7da; /* 薄い赤 */
    border: 1px solid #f5c6cb; /* 赤系のボーダー */
    padding: 12px 20px; /* パディング */
    border-radius: 6px; /* 角丸 */
    margin-top: 20px; /* 上の要素との間隔 */
}
