/* ============================================
   QR Generator PRO - CSS
   ============================================ */

:root {
    /* Instagram グラデーションカラー */
    --ig-purple: #833AB4;
    --ig-pink: #C13584;
    --ig-red: #FD1D1D;
    --ig-orange: #F77737;
    --ig-yellow: #FCB045;

    /* 背景・テキスト */
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-card: #1f1f1f;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;

    /* グラデーション */
    --gradient-instagram: linear-gradient(45deg, #833AB4, #FD1D1D, #FCB045);
    --gradient-glow: linear-gradient(135deg, rgba(131, 58, 180, 0.5), rgba(253, 29, 29, 0.5), rgba(252, 176, 69, 0.5));
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
}

/* 背景エフェクト */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 20%, rgba(131, 58, 180, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(253, 29, 29, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(252, 176, 69, 0.08) 0%, transparent 50%);
    animation: backgroundPulse 15s ease-in-out infinite;
    z-index: -1;
}

@keyframes backgroundPulse {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    50% {
        transform: scale(1.1) rotate(5deg);
    }
}

/* アプリコンテナ */
.app-container {
    max-width: 520px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ヘッダー */
.header {
    text-align: center;
    padding: 20px 0 15px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.logo h1 {
    font-size: 26px;
    font-weight: 700;
    background: var(--gradient-instagram);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pro-badge {
    font-size: 11px;
    background: var(--gradient-instagram);
    -webkit-background-clip: unset;
    -webkit-text-fill-color: white;
    background-clip: unset;
    color: white;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: 1px;
}

.subtitle {
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* メインコンテンツ */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* セクションラベル */
.section-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 入力セクション */
.input-section {
    padding: 0;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border-radius: 14px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: var(--ig-purple);
    box-shadow: 0 0 20px rgba(131, 58, 180, 0.3);
}

.input-icon {
    width: 20px;
    height: 20px;
    margin-left: 14px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

#urlInput {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
}

#urlInput::placeholder {
    color: var(--text-secondary);
}

/* オプショングループ */
.option-group {
    background: var(--bg-secondary);
    border-radius: 14px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.option-group .section-label {
    margin-bottom: 12px;
}

/* スタイルオプション */
.style-options {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.style-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.style-btn span {
    font-size: 9px;
    white-space: nowrap;
}

.style-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.style-btn.active {
    background: var(--gradient-instagram);
    border-color: transparent;
    color: white;
}

/* スタイルプレビュー */
.style-preview {
    width: 24px;
    height: 24px;
    position: relative;
}

.dots-large-preview::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, currentColor 30%, transparent 30%);
    background-size: 8px 8px;
}

.dots-fine-preview::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, currentColor 20%, transparent 20%);
    background-size: 6px 6px;
}

.classic-preview::before {
    content: '';
    position: absolute;
    inset: 2px;
    background: linear-gradient(90deg, currentColor 50%, transparent 50%),
        linear-gradient(0deg, currentColor 50%, transparent 50%);
    background-size: 6px 6px;
}

.rounded-preview::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 4px 4px, currentColor 3px, transparent 3px),
        radial-gradient(circle at 12px 4px, currentColor 3px, transparent 3px),
        radial-gradient(circle at 4px 12px, currentColor 3px, transparent 3px),
        radial-gradient(circle at 12px 12px, currentColor 3px, transparent 3px),
        radial-gradient(circle at 20px 12px, currentColor 3px, transparent 3px);
}

.diamond-preview::before {
    content: '◆';
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.star-preview::before {
    content: '★';
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.heart-preview::before {
    content: '♥';
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* カスタマイズセクション */
.customization-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* カラーオプション */
.color-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    background: var(--btn-color);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-btn.gradient {
    background: var(--gradient-instagram);
}

.color-btn:hover {
    transform: scale(1.1);
}

.color-btn.active {
    border-color: white;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}

.color-check {
    color: white;
    font-size: 14px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.color-btn.active .color-check {
    opacity: 1;
}

/* アイコンオプション */
.icon-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.icon-btn.active {
    background: var(--gradient-instagram);
    border-color: transparent;
    color: white;
}

.icon-none {
    font-size: 16px;
    font-weight: bold;
}

/* アイコン色グループ */
.icon-color-group {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 詳細設定 */
.advanced-settings {
    background: var(--bg-secondary);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.settings-toggle {
    width: 100%;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
}

.settings-toggle:hover {
    color: var(--text-primary);
}

.settings-toggle .chevron {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.settings-toggle.open .chevron {
    transform: rotate(180deg);
}

.settings-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.settings-panel.open {
    max-height: 400px;
}

.setting-item {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.setting-item label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* スライダー */
.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--gradient-instagram);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--gradient-instagram);
    cursor: pointer;
    border: none;
}

/* ラジオグループ */
.radio-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}

.radio-label:hover {
    background: rgba(255, 255, 255, 0.1);
}

.radio-label input[type="radio"] {
    accent-color: var(--ig-purple);
}

.radio-label:has(input:checked) {
    background: var(--ig-purple);
    color: white;
}

/* 背景オプション */
.bg-options {
    display: flex;
    gap: 10px;
}

.bg-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-btn:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

.bg-btn.active {
    border-color: var(--ig-purple);
    box-shadow: 0 0 10px rgba(131, 58, 180, 0.4);
}

.bg-preview {
    width: 100%;
    height: 100%;
}

.bg-preview.white {
    background: white;
}

.bg-preview.transparent {
    background: repeating-conic-gradient(#808080 0% 25%, #404040 0% 50%) 50% / 10px 10px;
}

.color-picker-input {
    width: 34px;
    height: 34px;
    border: none;
    cursor: pointer;
    background: transparent;
    padding: 0;
}

.color-picker-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-input::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

/* QRコード用カラーピッカー */
.custom-color-btn {
    background: repeating-conic-gradient(#ff6b6b 0deg 45deg,
            #feca57 45deg 90deg,
            #48dbfb 90deg 135deg,
            #ff9ff3 135deg 180deg,
            #54a0ff 180deg 225deg,
            #5f27cd 225deg 270deg,
            #00d2d3 270deg 315deg,
            #1dd1a1 315deg 360deg);
}

.qr-color-picker {
    width: 28px;
    height: 28px;
    border: none;
    cursor: pointer;
    background: transparent;
    padding: 0;
    border-radius: 50%;
}

.qr-color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.qr-color-picker::-webkit-color-swatch {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
}

/* Goボタン */
.go-button {
    background: var(--gradient-instagram);
    border: none;
    padding: 14px 28px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.go-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(253, 29, 29, 0.4);
}

.go-button:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.go-button:hover .btn-icon {
    transform: translateX(5px);
}

.button-shine {
    position: absolute;
    top: -50%;
    left: -100%;
    width: 50%;
    height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: skewX(-25deg);
    transition: left 0.6s ease;
}

.go-button:hover .button-shine {
    left: 150%;
}

/* QRコードセクション */
.qr-section {
    display: none;
    animation: fadeInUp 0.5s ease;
}

.qr-section.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.qr-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* QRコード グラデーションボーダー */
.qr-gradient-border {
    display: inline-block;
    padding: 4px;
    background: var(--gradient-instagram);
    border-radius: 20px;
    position: relative;
    animation: borderGlow 3s ease-in-out infinite;
}

@keyframes borderGlow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(131, 58, 180, 0.5),
            0 0 40px rgba(253, 29, 29, 0.3),
            0 0 60px rgba(252, 176, 69, 0.2);
    }

    50% {
        box-shadow: 0 0 30px rgba(131, 58, 180, 0.7),
            0 0 60px rgba(253, 29, 29, 0.5),
            0 0 90px rgba(252, 176, 69, 0.3);
    }
}

.qr-inner {
    background: white;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#finalCanvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.qr-url {
    margin-top: 16px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    word-break: break-all;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* アクションボタン */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn svg {
    width: 18px;
    height: 18px;
}

.download-btn {
    background: var(--gradient-instagram);
    color: white;
    flex: 1;
    justify-content: center;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(131, 58, 180, 0.4);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    flex: 1;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* Toast通知 */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--gradient-instagram);
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* フッター */
.footer {
    text-align: center;
    padding: 20px 0;
    color: var(--text-secondary);
    font-size: 13px;
}

/* レスポンシブ */
@media (max-width: 480px) {
    .app-container {
        padding: 12px;
    }

    .logo h1 {
        font-size: 22px;
    }

    .style-options {
        grid-template-columns: repeat(4, 1fr);
    }

    .style-btn span {
        font-size: 8px;
    }

    .go-button {
        padding: 12px;
    }

    .qr-card {
        padding: 16px;
    }

    .color-btn {
        width: 32px;
        height: 32px;
    }

    .icon-btn {
        width: 36px;
        height: 36px;
    }

    .icon-btn svg {
        width: 18px;
        height: 18px;
    }

    .action-buttons {
        flex-direction: column;
    }
}

/* アニメーション追加 */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.generating {
    animation: pulse 1s ease-in-out infinite;
}

.generating .btn-text,
.generating .btn-icon {
    display: none;
}

.generating::after {
    content: '生成中...';
}