/* style.css for qr-code-maker */

.qr-container {
    max-width: 1000px;
    margin: 40px auto;
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    color: #333;
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

/* 共通パネルスタイル */
.panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    padding: 30px;
    box-sizing: border-box;
}

/* 左側：入力＆設定エリア */
.config-panel {
    flex: 1 1 500px;
}

.config-panel h3 {
    margin-top: 0;
    font-size: 1.25rem;
    color: #444;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-group {
    margin-bottom: 25px;
}

.input-label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #555;
    font-size: 0.95rem;
}

.qr-textarea {
    width: 100%;
    height: 120px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.qr-textarea:focus {
    border-color: #4facfe;
    outline: none;
}

.helper-text {
    font-size: 0.8rem;
    color: #888;
    margin-top: 4px;
}

/* Tabs Styling */
.qr-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0;
    flex-wrap: wrap;
    /* Prevent mobile layout breaking */
}

.qr-tab-btn {
    background: #f5f5f5;
    border: none;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: bold;
    color: #666;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #ddd;
    border-bottom: none;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-grow: 1;
    /* Stretch on mobile */
    justify-content: center;
}

.qr-tab-btn:hover {
    background: #e9e9e9;
}

.qr-tab-btn.active {
    background: #fff;
    color: #4facfe;
    border-top: 3px solid #4facfe;
    margin-bottom: -2px;
    /* overlap border */
    z-index: 1;
    position: relative;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.02);
}

.qr-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.qr-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.qr-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.2s;
    margin-bottom: 10px;
}

.qr-input:focus {
    border-color: #4facfe;
    outline: none;
}

/* カスタマイズコントロール */
.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.color-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}

select.qr-select,
input[type="number"].qr-number {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
}

.checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 0.9rem;
    cursor: pointer;
}

.checkbox-wrap input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 右側：プレビュー＆ダウンロードエリア */
.preview-panel {
    flex: 1 1 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.preview-panel h3 {
    width: 100%;
    margin-top: 0;
    font-size: 1.25rem;
    color: #444;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    margin-bottom: 20px;
    text-align: left;
}

.qr-preview-box {
    background: #fdfdfd;
    border: 2px dashed #ccc;
    border-radius: 12px;
    width: 100%;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    padding: 20px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

/* This will hold the actual canvas */
#qrcode-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

#qrcode-container canvas,
#qrcode-container img {
    max-width: 100%;
    height: auto !important;
    /* Keep aspect ratio in preview */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.placeholder-text {
    color: #999;
    font-size: 0.9rem;
}

.btn-download {
    background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 114, 255, 0.3);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 114, 255, 0.4);
}

.btn-download:disabled {
    background: #ccc;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* 透過背景用チェッカーパターン */
.transparent-bg {
    background-image:
        linear-gradient(45deg, #eee 25%, transparent 25%),
        linear-gradient(-45deg, #eee 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #eee 75%),
        linear-gradient(-45deg, transparent 75%, #eee 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* Responsive */
@media (max-width: 768px) {
    .qr-container {
        flex-direction: column;
    }
}