/* LINE エアコンコントローラー設定画面 スタイル */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

h1 {
    background: linear-gradient(135deg, #00C300, #00B900);
    color: white;
    padding: 20px;
    text-align: center;
    margin: 0;
    font-size: 24px;
}

.section {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.section:last-child {
    border-bottom: none;
}

.section h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
    border-left: 4px solid #00C300;
    padding-left: 10px;
}

.section h3 {
    color: #666;
    margin: 15px 0 10px 0;
    font-size: 16px;
}

/* フォームスタイル */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

input[type="text"],
input[type="password"],
input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #00C300;
    box-shadow: 0 0 0 2px rgba(0, 195, 0, 0.1);
}

input[readonly] {
    background-color: #f8f9fa;
    color: #666;
}

button {
    background: #00C300;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s;
}

button:hover {
    background: #00B900;
}

button:active {
    transform: translateY(1px);
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ステータス表示 */
#status-display {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
}

#status-display div {
    margin-bottom: 8px;
    font-size: 14px;
}

#wifi-state,
#ir-count,
#line-state {
    font-weight: 600;
    color: #00C300;
}

#refresh-status {
    margin-top: 10px;
    padding: 8px 15px;
    font-size: 12px;
}

/* ボタングループ */
.learn-btn,
.test-btn {
    margin: 5px;
    padding: 8px 15px;
    font-size: 13px;
}

.learn-btn {
    background: #17a2b8;
}

.learn-btn:hover {
    background: #138496;
}

.test-btn {
    background: #6f42c1;
}

.test-btn:hover {
    background: #5a32a3;
}

/* 温度コントロール */
.temp-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.temp-control label {
    margin: 0;
    white-space: nowrap;
}

.temp-control input {
    width: 80px;
}

/* メッセージ表示 */
.status-message {
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    font-weight: 500;
}

.status-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Webhook URL */
#webhook-url {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
}

#webhook-url-display {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

#copy-url {
    font-size: 12px;
    padding: 6px 12px;
}

/* 学習済み信号リスト */
#signals-list {
    list-style: none;
    padding: 0;
}

#signals-list li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#signals-list li:last-child {
    border-bottom: none;
}

#signals-list button {
    padding: 4px 8px;
    font-size: 11px;
    background: #6c757d;
}

#signals-list button:hover {
    background: #5a6268;
}

/* レスポンシブ対応 */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .container {
        margin: 0;
    }
    
    h1 {
        font-size: 20px;
        padding: 15px;
    }
    
    .section {
        padding: 15px;
    }
    
    .temp-control {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }
    
    .temp-control input {
        width: 100%;
    }
    
    button {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .learn-btn,
    .test-btn {
        width: calc(50% - 2.5px);
        margin: 2.5px;
    }
}

/* アニメーション */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.status-message.info {
    animation: pulse 1.5s infinite;
}

/* ローディング状態 */
button.loading {
    position: relative;
    color: transparent;
}

button.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}