/* Instagram Post 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: #dd2a7b; }
.breadcrumb .separator { margin: 0 10px; color: #ddd; }
.breadcrumb .current { color: #333; font-weight: 600; }

.tool-header {
    background: linear-gradient(135deg, #f58529 0%, #dd2a7b 50%, #8134af 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.tool-header::before {
    content: '📸';
    position: absolute;
    font-size: 300px;
    opacity: 0.06;
    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; }
.igpost-root { max-width: 1240px; margin: 0 auto; }

/* ---------- Mode tabs ---------- */
.mode-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.mode-tab {
    border: 2px solid rgba(0,0,0,0.08);
    background: #fff;
    color: #374151;
    padding: 14px 28px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
    transition: all .25s;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}
.mode-tab:hover { border-color: #dd2a7b; color: #dd2a7b; }
.mode-tab.active {
    background: linear-gradient(135deg, #f58529 0%, #dd2a7b 55%, #8134af 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 8px 22px rgba(221, 42, 123, 0.35);
}

/* ---------- Layout ---------- */
.ig-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}
.ig-preview-col { position: sticky; top: 16px; }

.ig-preview-card {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
.ig-preview-stage {
    background:
        linear-gradient(45deg, #eef0f3 25%, transparent 25%) 0 0 / 20px 20px,
        linear-gradient(-45deg, #eef0f3 25%, transparent 25%) 0 10px / 20px 20px,
        linear-gradient(45deg, transparent 75%, #eef0f3 75%) 10px -10px / 20px 20px,
        linear-gradient(-45deg, transparent 75%, #eef0f3 75%) -10px 0 / 20px 20px,
        #fafbfc;
    border-radius: 14px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 80vh;
    overflow: auto;
}
#previewCanvas {
    display: block;
    max-width: 100%;
    max-height: 72vh;
    width: auto;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.15);
}
.ig-preview-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 12px 2px 14px;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    flex-wrap: wrap;
}
.muted { color: #6b7280; font-weight: 500; }

.export-row { margin-bottom: 12px; }
.export-scale { font-size: 13px; font-weight: 700; color: #374151; display: flex; align-items: center; gap: 10px; }
.export-scale select { padding: 8px 10px; border-radius: 8px; border: 2px solid #e5e7eb; font-weight: 600; }
.export-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.export-actions .btn-primary { flex: 1 1 150px; }
.btn-block { width: 100%; }

/* ---------- Control groups ---------- */
.ig-controls-col { display: flex; flex-direction: column; gap: 14px; }
.ctl-group {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    overflow: hidden;
    margin-bottom: 14px;
}
.ig-controls-col > .panel-mock,
.ig-controls-col > .panel-design { display: block; }
.ctl-group > summary {
    cursor: pointer;
    list-style: none;
    padding: 16px 20px;
    font-weight: 800;
    font-size: 16px;
    color: #1f2937;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ctl-group > summary::-webkit-details-marker { display: none; }
.ctl-group > summary::after { content: '▾'; color: #9ca3af; transition: transform .2s; }
.ctl-group[open] > summary::after { transform: rotate(180deg); }
.ctl-group[open] > summary { border-bottom: 1px solid #f1f5f9; }
.ctl-body { padding: 16px 20px 20px; }

.row { margin-bottom: 14px; }
.row > label { display: block; font-size: 13px; font-weight: 700; color: #374151; margin-bottom: 6px; }
.row > label b { float: right; color: #dd2a7b; font-weight: 800; }
.row input[type="text"], .row textarea, .row select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: #111827;
    transition: border-color .2s;
    box-sizing: border-box;
}
.row textarea { resize: vertical; line-height: 1.5; }
.row input:focus, .row textarea:focus, .row select:focus { outline: none; border-color: #dd2a7b; }
.row input[type="range"] { width: 100%; accent-color: #dd2a7b; }
.row input[type="color"] {
    width: 46px; height: 34px; padding: 2px; border: 2px solid #e5e7eb; border-radius: 8px; background: #fff; cursor: pointer; vertical-align: middle;
}

.check-row { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.check { display: inline-flex !important; align-items: center; gap: 8px; font-size: 13px !important; font-weight: 600 !important; color: #374151; cursor: pointer; margin: 0 !important; }
.check input { width: 17px; height: 17px; accent-color: #dd2a7b; cursor: pointer; }

.inline-colors { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; }
.inline-colors > label { display: inline-flex !important; align-items: center; gap: 10px; margin: 0 !important; }

.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

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

/* Gradient swatches */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.swatch {
    width: 42px; height: 42px; border-radius: 12px; border: 3px solid transparent; cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15); transition: transform .15s;
}
.swatch:hover { transform: scale(1.08); }
.swatch.active { border-color: #111827; }

/* Templates */
.tpl-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 800; color: #374151; margin: 4px 0 10px; }
.tpl-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tpl-btn {
    border: 2px solid rgba(0,0,0,0.06);
    border-radius: 12px;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; padding: 4px;
    transition: transform .15s, box-shadow .15s;
}
.tpl-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(0,0,0,0.18); }
.tpl-btn span { font-size: 24px; font-weight: 800; line-height: 1; text-shadow: 0 1px 3px rgba(0,0,0,0.25); }
.tpl-btn small { font-size: 10px; font-weight: 700; opacity: 0.9; }

/* Comments grid */
.comment-grid { margin-bottom: 14px; }
.cg-head { font-size: 13px; font-weight: 700; color: #374151; margin-bottom: 8px; }
.cg-row { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; margin-bottom: 8px; }
.cg-row input {
    width: 100%; padding: 9px 10px; border: 2px solid #e5e7eb; border-radius: 10px; font-size: 13px; box-sizing: border-box; font-family: inherit;
}
.cg-row input:focus { outline: none; border-color: #dd2a7b; }

/* Slides */
.slides-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
    min-width: 36px; height: 36px; border-radius: 10px; border: 2px solid #e5e7eb; background: #fff;
    font-weight: 800; color: #4b5563; cursor: pointer; transition: all .2s;
}
.chip:hover { border-color: #dd2a7b; color: #dd2a7b; }
.chip.active { background: linear-gradient(135deg, #f58529, #dd2a7b); color: #fff; border-color: transparent; }
.slide-count { font-size: 13px; font-weight: 800; color: #6b7280; white-space: nowrap; }
.slide-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }

/* ---------- Buttons ---------- */
.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);
}
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.15); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(135deg, #f58529 0%, #dd2a7b 55%, #8134af 100%); color: white; }
.btn-success { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; }
.btn-ghost { background: white; border: 2px solid rgba(0,0,0,0.1); color: #1f2937; }
.btn-ghost:hover { border-color: #dd2a7b; color: #dd2a7b; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ---------- Toast ---------- */
.ig-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;
}
.ig-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Info box ---------- */
.info-box { background: white; border-radius: 20px; padding: 30px; margin-top: 36px; 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: #fdf2f8; border-left: 4px solid #dd2a7b; padding: 16px; border-radius: 10px; font-size: 14px; line-height: 1.6; color: #374151; }
.fair-note { margin-top: 18px; font-size: 13px; color: #6b7280; line-height: 1.6; }

/* ---------- SEO content ---------- */
.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; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .ig-layout { grid-template-columns: 1fr; }
    .ig-preview-col { position: static; }
    #previewCanvas { max-height: 60vh; }
}
@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; }
    .mode-tab { padding: 12px 16px; font-size: 14px; flex: 1 1 100%; }
    .tpl-grid { grid-template-columns: repeat(3, 1fr); }
    .cg-row { grid-template-columns: 1fr; }
    .content-article h2 { font-size: 22px; }
}
