/* QR Code生成器樣式 */
.tool-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* 模板選擇 */
.template-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.template-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.template-btn {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    background: #ffffff;
    color: #333333;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    text-align: center;
}

.template-btn:hover {
    border-color: #F7931A;
    background: linear-gradient(135deg, #F7931A 0%, #627EEA 100%);
    color: white;
    transform: translateY(-2px);
}

.template-btn.active {
    border-color: #F7931A;
    background: linear-gradient(135deg, #F7931A 0%, #627EEA 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(247, 147, 26, 0.3);
}

/* 輸入區域 */
.input-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.input-panel {
    display: none;
}

.input-panel.active {
    display: block;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.form-control:focus {
    outline: none;
    border-color: #F7931A;
    box-shadow: 0 0 0 3px rgba(247, 147, 26, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* WiFi 和聯絡資訊表單 */
.wifi-fields,
.contact-fields,
.sms-fields,
.email-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.field-group {
    display: flex;
    flex-direction: column;
}

.field-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333333;
}

.checkbox-label {
    flex-direction: row !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* 設定區域 */
.settings-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.setting-group {
    display: flex;
    flex-direction: column;
}

.setting-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333333;
}

.size-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e9ecef;
    outline: none;
    cursor: pointer;
}

.size-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F7931A 0%, #627EEA 100%);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.size-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F7931A 0%, #627EEA 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.color-picker {
    width: 60px;
    height: 40px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
}

/* QR Code顯示區 */
.qr-display {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.qr-output {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.qr-preview {
    width: 300px;
    height: 300px;
    border: 2px dashed #e9ecef;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    position: relative;
}

.qr-preview.has-qr {
    border: 2px solid #28a745;
    background: white;
}

.qr-preview canvas {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
}

.placeholder {
    text-align: center;
    color: #6c757d;
}

.placeholder p {
    margin: 0;
    font-size: 16px;
}

.qr-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

/* QR Code資訊 */
.qr-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #e9ecef;
}

.info-item .label {
    font-weight: 600;
    color: #333333;
}

.info-item .value {
    color: #627EEA;
    font-weight: 500;
}

/* 批量生成 */
.batch-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.batch-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.batch-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.batch-results {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.batch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.batch-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.batch-item canvas {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 8px;
}

.batch-item .item-info {
    font-size: 12px;
    color: #6c757d;
    word-break: break-all;
}

/* 按鈕樣式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, #F7931A 0%, #627EEA 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(247, 147, 26, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(247, 147, 26, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-icon {
    padding: 8px 12px;
    font-size: 16px;
}

/* 功能特色 */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.feature-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.feature-card h3 {
    color: #F7931A;
    margin-bottom: 15px;
    font-size: 18px;
}

.feature-card p {
    color: #333333;
    line-height: 1.6;
    margin: 0;
}

/* 教學和FAQ */
.tutorial,
.faq {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    margin: 30px 0;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tutorial h2,
.faq h2 {
    color: #F7931A;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f8f9fa;
}

.tutorial h3,
.tutorial h4 {
    color: #333333;
    margin-top: 25px;
    margin-bottom: 15px;
}

.tutorial ol,
.tutorial ul {
    padding-left: 20px;
    line-height: 1.8;
}

.tutorial li {
    margin-bottom: 8px;
}

.format-guide {
    margin-top: 20px;
}

.format-guide h4 {
    color: #627EEA;
    margin-top: 20px;
    margin-bottom: 10px;
}

.faq-item {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #F7931A;
}

.faq-item h3 {
    color: #333333;
    margin-bottom: 10px;
    font-size: 16px;
}

.faq-item p {
    color: #333333;
    line-height: 1.6;
    margin: 0;
}

/* 工具資訊 */
.tool-info {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-top: 30px;
}

.tool-info p {
    margin: 0;
    color: #333333;
}

.tool-info a {
    color: #F7931A;
    text-decoration: none;
    font-weight: 600;
}

.tool-info a:hover {
    color: #627EEA;
    text-decoration: underline;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .tool-container {
        padding: 15px;
    }
    
    .template-buttons {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .template-btn {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .wifi-fields,
    .contact-fields,
    .sms-fields,
    .email-fields {
        grid-template-columns: 1fr;
    }
    
    .qr-preview {
        width: 250px;
        height: 250px;
    }
    
    .qr-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .batch-actions {
        flex-direction: column;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .batch-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
}

@media (max-width: 480px) {
    .qr-preview {
        width: 200px;
        height: 200px;
    }
    
    .template-buttons {
        grid-template-columns: 1fr;
    }
    
    .batch-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
}

/* 隱藏類 */
.hidden {
    display: none !important;
}

/* 載入動畫 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #F7931A;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 列印樣式 */
@media print {
    .tool-container {
        max-width: none;
        padding: 0;
    }
    
    .template-section,
    .input-section,
    .settings-section,
    .batch-section,
    .features,
    .tutorial,
    .faq,
    .tool-info {
        display: none !important;
    }
    
    .qr-display {
        box-shadow: none;
        border: none;
        background: white;
    }
    
    .qr-actions {
        display: none !important;
    }
    
    .qr-preview {
        border: none;
        background: white;
        width: auto;
        height: auto;
    }
}