/* Service Workers サンプル用スタイル */

body {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    background-color: #f5f7fa;
    color: #333;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2.5em;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
}

h2 {
    color: #34495e;
    border-left: 5px solid #3498db;
    padding-left: 15px;
    margin-top: 30px;
    margin-bottom: 20px;
}

h3 {
    color: #2c3e50;
    margin-top: 25px;
    margin-bottom: 15px;
}

.container {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

/* 情報セクション */
.info-section {
    background-color: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
}

.info-section ul {
    margin: 10px 0;
    padding-left: 20px;
}

.info-section li {
    margin-bottom: 5px;
}

/* 警告表示 */
.warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    border-radius: 5px;
    margin-top: 15px;
}

/* ステータスセクション */
.status-section,
.cache-section,
.network-section,
.sync-section,
.notification-section,
.debug-section {
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
    background-color: #fafafa;
}

/* ステータスグリッド */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.status-item {
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    text-align: center;
}

.status-label {
    font-weight: bold;
    color: #555;
    margin-bottom: 8px;
    font-size: 14px;
}

.status-value {
    font-size: 16px;
    font-weight: bold;
}

.status-value.supported {
    color: #27ae60;
}

.status-value.unsupported {
    color: #e74c3c;
}

.status-value.active {
    color: #27ae60;
}

.status-value.installing {
    color: #f39c12;
}

.status-value.waiting {
    color: #3498db;
}

/* フォーム要素 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.form-group textarea {
    resize: vertical;
    font-family: 'Courier New', monospace;
}

/* ボタングループ */
.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    min-width: 130px;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

button:not(.danger) {
    background-color: #3498db;
    color: white;
}

button:not(.danger):hover {
    background-color: #2980b9;
}

button.danger {
    background-color: #e74c3c;
    color: white;
}

button.danger:hover {
    background-color: #c0392b;
}

/* キャッシュ関連 */
.cache-contents {
    margin-top: 20px;
    border: 1px solid #d0d0d0;
    border-radius: 5px;
    background-color: white;
}

.cache-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
}

.cache-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    margin-bottom: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #3498db;
}

.cache-url {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    word-break: break-all;
    margin-right: 10px;
}

.cache-method {
    background-color: #3498db;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    margin-right: 10px;
}

.cache-delete {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    min-width: auto;
}

.cache-delete:hover {
    background-color: #c0392b;
}

/* ネットワーク状態 */
.network-status {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    padding: 10px;
    background-color: white;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.network-status span {
    font-weight: bold;
}

.network-status .online {
    color: #27ae60;
}

.network-status .offline {
    color: #e74c3c;
}

/* 出力セクション */
.output-section {
    margin-top: 20px;
    border: 1px solid #d0d0d0;
    border-radius: 5px;
    background-color: white;
}

.output-display {
    max-height: 250px;
    overflow-y: auto;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
}

.output-item {
    margin-bottom: 8px;
    padding: 8px 12px;
    background-color: white;
    border-radius: 3px;
    border-left: 3px solid #3498db;
}

.output-item.error {
    border-left-color: #e74c3c;
    background-color: #ffebee;
    color: #c62828;
}

.timestamp {
    color: #666;
    font-weight: bold;
}

/* 同期・通知セクション */
.sync-status,
.notification-status {
    margin-top: 15px;
    padding: 10px;
    background-color: white;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.status-display {
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    min-height: 50px;
}

/* デバッグセクション */
.debug-output {
    margin-top: 20px;
    border: 1px solid #d0d0d0;
    border-radius: 5px;
    background-color: white;
}

/* ステータスメッセージ */
.status {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    font-weight: bold;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    max-width: 350px;
    word-wrap: break-word;
}

.status.success {
    background-color: #27ae60;
    color: white;
    opacity: 1;
}

.status.error {
    background-color: #e74c3c;
    color: white;
    opacity: 1;
}

/* アニメーション効果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.output-item {
    animation: fadeIn 0.3s ease;
}

.cache-item {
    animation: fadeIn 0.3s ease;
}

.status-item {
    animation: fadeIn 0.3s ease;
}

/* スクロールバーのスタイリング */
.output-display::-webkit-scrollbar,
.cache-list::-webkit-scrollbar {
    width: 6px;
}

.output-display::-webkit-scrollbar-track,
.cache-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.output-display::-webkit-scrollbar-thumb,
.cache-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.output-display::-webkit-scrollbar-thumb:hover,
.cache-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 2em;
    }

    .container {
        padding: 15px;
    }

    .button-group {
        flex-direction: column;
    }

    button {
        width: 100%;
        margin-bottom: 5px;
        min-width: unset;
    }

    .status-grid {
        grid-template-columns: 1fr;
    }

    .cache-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .cache-url {
        margin-right: 0;
    }

    .network-status {
        flex-direction: column;
        gap: 10px;
    }

    .status {
        position: relative;
        top: auto;
        right: auto;
        margin: 20px 0;
    }
}


/* アクセシビリティ */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* 空の状態スタイル */
.output-display:empty::before,
.cache-list:empty::before,
.status-display:empty::before {
    content: '情報はここに表示されます...';
    color: #999;
    font-style: italic;
    display: block;
    text-align: center;
    padding: 20px;
}

/* プログレスバー（必要に応じて） */
.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* 状態インジケーター */
.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-indicator.active {
    background-color: #27ae60;
    animation: pulse 2s infinite;
}

.status-indicator.inactive {
    background-color: #95a5a6;
}

.status-indicator.error {
    background-color: #e74c3c;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}