/* CSS Background Pattern Generator - Complete Styling */

.tool-page { padding-top: 0; }

.breadcrumb { padding: 20px 0; font-size: 14px; color: #666; }
.breadcrumb a { color: #666; transition: all 0.3s; }
.breadcrumb a:hover { color: #6366f1; }
.breadcrumb .separator { margin: 0 10px; color: #ddd; }
.breadcrumb .current { color: #333; font-weight: 600; }

.tool-header {
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 50%, #a855f7 100%);
    color: white; padding: 60px 20px; text-align: center; position: relative; overflow: hidden;
}
.tool-header::before { content: '🔳'; position: absolute; font-size: 300px; opacity: 0.07; top: -50px; right: -50px; animation: rotate 20s linear infinite; }
@keyframes rotate { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.tool-header-content { max-width: 800px; margin: 0 auto; position: relative; z-index: 1; }
.tool-icon-large { font-size: 72px; margin-bottom: 20px; animation: bounce 2s ease-in-out infinite; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.tool-header h1 { font-size: 48px; font-weight: 900; margin-bottom: 15px; text-shadow: 2px 2px 4px rgba(0,0,0,0.2); }
.tool-subtitle { font-size: 20px; opacity: 0.95; margin-bottom: 25px; line-height: 1.6; }
.tool-meta { display: flex; justify-content: center; align-items: center; gap: 15px; flex-wrap: wrap; font-size: 16px; }
.meta-separator { opacity: 0.5; }

.tool-content { padding: 50px 20px 60px; background: #f8f9fa; }
.bp-root { max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }

.card { background: #fff; border-radius: 20px; padding: 22px; box-shadow: 0 10px 30px rgba(0,0,0,0.08); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card-head h3 { font-size: 19px; color: #1f2937; margin: 0; }
.card-head h3 small { font-size: 12px; color: #6b7280; font-weight: 600; margin-left: 8px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.muted { color: #6b7280; font-weight: 500; font-size: 12px; }
.lbl { display: block; font-size: 13px; font-weight: 700; color: #374151; margin-bottom: 8px; }
.txt { width: 100%; box-sizing: border-box; padding: 11px 12px; border: 2px solid #e5e7eb; border-radius: 10px; font-size: 14px; font-weight: 600; background: #fff; font-family: inherit; }
.txt:focus { outline: none; border-color: #6366f1; }

.seg { display: inline-flex; background: #f3f4f6; border-radius: 10px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg button { flex: 1 1 auto; border: none; background: transparent; padding: 8px 14px; border-radius: 8px; font-weight: 700; font-size: 13px; color: #4b5563; cursor: pointer; transition: all .2s; white-space: nowrap; }
.seg button:hover { color: #6366f1; }
.seg button.active { background: #fff; color: #6366f1; box-shadow: 0 2px 8px rgba(0,0,0,0.12); }

.code-tabs { display: flex; gap: 4px; flex-wrap: wrap; background: #f3f4f6; padding: 3px; border-radius: 10px; }
.code-tabs button { border: none; background: transparent; padding: 8px 14px; border-radius: 8px; font-weight: 700; font-size: 13px; color: #4b5563; cursor: pointer; }
.code-tabs button.active { background: #fff; color: #6366f1; box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.code-box { width: 100%; box-sizing: border-box; background: #0f172a; color: #e2e8f0; border: none; border-radius: 12px; padding: 16px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.6; resize: vertical; white-space: pre; overflow: auto; }
.code-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }

.btn { padding: 12px 24px; border-radius: 10px; border: none; cursor: pointer; font-weight: 700; font-size: 14px; transition: all 0.3s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); font-family: inherit; }
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.15); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, #0ea5e9 0%, #4338ca 100%); color: white; }
.btn-ghost { background: white; border: 2px solid rgba(0,0,0,0.1); color: #1f2937; }
.btn-ghost:hover:not(:disabled) { border-color: #6366f1; color: #6366f1; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-xs { padding: 6px 10px; font-size: 12px; border-radius: 8px; box-shadow: none; }
.link-btn { border: none; background: none; color: #6366f1; font-weight: 700; font-size: 13px; cursor: pointer; padding: 0; font-family: inherit; }
.link-btn:hover { text-decoration: underline; }

.bp-toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); background: #111827; color: #fff; padding: 12px 22px; border-radius: 12px; font-weight: 700; font-size: 14px; opacity: 0; pointer-events: none; transition: all .3s; z-index: 9999; max-width: 90vw; text-align: center; }
.bp-toast.show { opacity: 1; transform: translate(-50%, 0); }

.info-box { background: white; border-radius: 20px; padding: 30px; box-shadow: 0 10px 30px rgba(0,0,0,0.08); }
.info-box h4 { font-size: 20px; margin-bottom: 20px; color: #1f2937; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.info-item { background: #eef2ff; border-left: 4px solid #6366f1; padding: 16px; border-radius: 10px; font-size: 14px; line-height: 1.6; color: #374151; }
.seo-content { padding: 50px 20px; background: #fff; }
.content-article { max-width: 900px; margin: 0 auto; }
.content-article h2 { font-size: 28px; margin: 32px 0 14px; color: #1f2937; }
.content-article p { font-size: 16px; line-height: 1.8; color: #4b5563; margin-bottom: 14px; }
.content-article code { background: #f1f5f9; padding: 2px 6px; border-radius: 6px; font-size: 14px; }

@media (max-width: 600px) {
    .tool-header { padding: 40px 16px; }
    .tool-header h1 { font-size: 32px; }
    .tool-subtitle { font-size: 16px; }
    .tool-icon-large { font-size: 56px; }
    .tool-content { padding: 30px 12px 40px; }
    .content-article h2 { font-size: 22px; }
}

.mt { margin-top: 16px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.code-card { position: sticky; top: 16px; }
.code-box.tall { min-height: 360px; }
.preview-wrap { position: relative; height: 340px; border-radius: 16px; border: 2px solid #e5e7eb; overflow: hidden; background: #fff; }
.preview-wrap:fullscreen { height: 100vh; border: none; border-radius: 0; }
.preview-wrap.checker { background-color: #fff; background-image: linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%); background-size: 20px 20px; background-position: 0 0, 10px 10px; }
.preview { position: absolute; inset: 0; }
.sample-box { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(255,255,255,.92); color: #111827; padding: 22px 30px; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.2); text-align: center; max-width: 80%; }
.sample-box h4 { margin: 0 0 6px; font-size: 20px; }
.sample-box p { margin: 0 0 12px; font-size: 14px; color: #4b5563; }
.sample-btn { display: inline-block; background: #6366f1; color: #fff; padding: 8px 18px; border-radius: 8px; font-weight: 700; font-size: 13px; }
.looks, .palettes { display: flex; flex-wrap: wrap; gap: 8px; }
.look { border: 2px solid #f1f5f9; background: #f9fafb; color: #374151; font-weight: 800; font-size: 12.5px; padding: 7px 14px; border-radius: 999px; cursor: pointer; font-family: inherit; transition: all .15s; }
.look:hover { border-color: #6366f1; color: #4338ca; background: #eef2ff; }
.pal { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 2px #e5e7eb; cursor: pointer; padding: 0; transition: transform .15s; }
.pal:hover { transform: scale(1.15); box-shadow: 0 0 0 2px #6366f1; }
.layer-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.layer-tabs button { flex: 1; border: 2px solid #e5e7eb; background: #fff; border-radius: 10px; padding: 9px; font-weight: 800; font-size: 13px; color: #4b5563; cursor: pointer; font-family: inherit; }
.layer-tabs button.active { border-color: #6366f1; background: #eef2ff; color: #4338ca; }
.layer-tabs button.off:not(.active) { opacity: .5; border-style: dashed; }
.pattern-grid { max-height: 330px; overflow-y: auto; padding-right: 6px; border: 2px solid #f1f5f9; border-radius: 12px; padding: 12px; }
.pg-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; font-weight: 800; color: #6b7280; margin: 4px 0 8px; }
.pg-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; margin-bottom: 14px; }
.pat { border: 2px solid #e5e7eb; background: #fff; border-radius: 12px; padding: 5px; cursor: pointer; font-family: inherit; display: flex; flex-direction: column; gap: 5px; align-items: stretch; transition: all .15s; }
.pat:hover { border-color: #a5b4fc; transform: translateY(-1px); }
.pat.active { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.2); }
.pat-sw { display: block; height: 46px; border-radius: 8px; background: #f8fafc; border: 1px solid #eef2f7; }
.pat-name { font-size: 11px; font-weight: 700; color: #374151; text-align: center; line-height: 1.2; }
.grp { margin: 22px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: #4338ca; border-top: 2px dashed #f1f5f9; padding-top: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.frow { margin-bottom: 12px; }
.frow .lbl b { float: right; color: #6366f1; font-weight: 800; }
.frow input[type="range"] { width: 100%; accent-color: #6366f1; }
.clr { width: 56px; height: 38px; padding: 2px; border: 2px solid #e5e7eb; border-radius: 10px; background: #fff; cursor: pointer; }
.color-line { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: #374151; margin: 10px 0; cursor: pointer; }
.chk input { accent-color: #6366f1; width: 16px; height: 16px; }
.seg-wrap { display: flex; }
.png-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.png-row .lbl { margin: 0; }
.png-row .num { width: 96px; }
.dl-row { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 960px) {
    .two-col { grid-template-columns: 1fr; }
    .code-card { position: static; }
}
@media (max-width: 600px) {
    .grid2 { grid-template-columns: 1fr; }
    .preview-wrap { height: 260px; }
}
