/* 基本スタイル */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 20px;
}

header {
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
}

#auth-status {
    font-size: 0.9em;
}

main {
    margin-bottom: 30px;
}

section {
    margin-bottom: 30px;
}

h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

h3 {
    margin-bottom: 15px;
    color: #3498db;
}

h4 {
    margin: 15px 0 10px;
    color: #2c3e50;
}

.card {
    background-color: white;
    border-radius: 5px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

/* ボタンスタイル */
button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.primary-button {
    background-color: #3498db;
    color: white;
}

.primary-button:hover {
    background-color: #2980b9;
}

.secondary-button {
    background-color: #95a5a6;
    color: white;
}

.secondary-button:hover {
    background-color: #7f8c8d;
}

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

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

.small-button {
    padding: 5px 10px;
    font-size: 12px;
}

button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

/* リソース状態表示 */
.status-info {
    margin-bottom: 15px;
}

.status-row {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.status-label {
    font-weight: bold;
    width: 100px;
}

.resource-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* ステータスバッジ */
.status-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    color: white;
}

.status-initiated {
    background-color: #3498db;
}

.status-creating_nat_gateway, .status-creating_endpoints {
    background-color: #f39c12;
}

.status-nat_gateway_created, .status-endpoints_created, .status-available {
    background-color: #2ecc71;
}

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

.status-cleanup_initiated, .status-endpoints_deleting, .status-nat_gateway_deleting {
    background-color: #9b59b6;
}

.status-endpoints_deleted, .status-nat_gateway_deleted, .status-cleaned_up {
    background-color: #34495e;
}

.status-cleanup_error {
    background-color: #c0392b;
}

/* 詳細表示 */
.detail-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.detail-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-row {
    margin-bottom: 8px;
    display: flex;
}

.detail-label {
    font-weight: bold;
    width: 180px;
}

.endpoints-container {
    margin-top: 10px;
}

.endpoints-list {
    list-style-type: none;
    padding-left: 10px;
}

.endpoints-list li {
    margin-bottom: 5px;
    font-family: monospace;
    background-color: #f8f9fa;
    padding: 3px 6px;
    border-radius: 3px;
    display: inline-block;
    margin-right: 5px;
}

/* ローディング表示 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #7f8c8d;
}

.loading::after {
    content: "";
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid #ddd;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 5px;
    width: 80%;
    max-width: 500px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    position: relative;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
}

.modal-footer {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

#modal-body {
    margin: 15px 0;
}

/* フッター */
footer {
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9em;
    margin-top: 30px;
}

/* エラーメッセージ */
.error-message {
    color: #e74c3c;
    padding: 10px;
    background-color: #fadbd8;
    border-radius: 4px;
}

/* 環境バナー */
.env-banner {
    background-color: #e74c3c;
    color: white;
    padding: 5px 10px;
    text-align: center;
    font-weight: bold;
    margin-bottom: 10px;
    border-radius: 3px;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
    }
    
    #auth-status {
        margin-top: 10px;
    }
    
    .detail-row {
        flex-direction: column;
    }
    
    .detail-label {
        width: 100%;
        margin-bottom: 3px;
    }
    
    .resource-actions {
        flex-direction: column;
    }
    
    .resource-actions button {
        width: 100%;
        margin-bottom: 5px;
    }
}