/**
 * Instagram Image Splitter & Grid Maker - CreatorFlow Free Tool
 * Brand Colors: #000000 (black), #d1fe17 (lime green)
 * NO box-shadows, NO gradients
 */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Stack Sans Headline', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #374151;
    background: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Headings use Stack Sans Headline per brand guidelines */
h1, h2, h3, h4, h5, h6,
.tool-hero__title,
.tool-card__title,
.tool-info__title,
.tool-info__subtitle,
.info-step__title,
.info-step__number,
.grid-preview__title,
.download-section__title,
.posting-guide__title,
.tool-tab,
.tool-tab__text {
    font-family: 'Stack Sans Headline', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Tool Container */
.tool-container {
    min-height: 100vh;
}

/* ============================================
   HERO SECTION
   ============================================ */

.tool-hero {
    background: #ffffff;
    padding: 3rem 1.5rem 2rem;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.tool-hero__container {
    max-width: 800px;
    margin: 0 auto;
}

.tool-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #f9fafb;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    margin-bottom: 1.5rem;
}

.instagram-icon {
    color: #E1306C; /* Instagram brand color */
}

.tool-hero__title {
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    font-weight: 800;
    color: #000000;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.tool-hero__description {
    font-size: 1.0625rem;
    color: #374151;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ============================================
   TOOL SECTION
   ============================================ */

.tool-section {
    padding: 3rem 1.5rem;
    background: #ffffff;
}

.tool-section__container {
    max-width: 900px;
    margin: 0 auto;
}

/* Tabs */
.tool-tabs {
    display: flex;
    gap: 1rem;
    margin: 0 auto 2rem;
    border-bottom: 2px solid #e5e7eb;
    max-width: 700px;
}

.tool-tab {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: transparent;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tool-tab:hover:not(:disabled) {
    color: #000000;
}

.tool-tab--active {
    color: #000000;
    border-bottom-color: #d1fe17;
}

.tool-tab:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tool-tab__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #f9fafb;
    color: #6b7280;
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 700;
}

.tool-tab--active .tool-tab__number {
    background: #d1fe17;
    color: #000000;
}

/* Tab Content */
.tool-content {
    display: none;
}

.tool-content--active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tool Card */
.tool-card {
    background: #ffffff;
    padding: 2rem 1.5rem;
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
    max-width: 700px;
    margin: 0 auto;
}

.tool-card__title {
    font-size: clamp(1.375rem, 3.5vw, 1.75rem);
    font-weight: 700;
    color: #000000;
    margin-bottom: 1.5rem;
    text-align: center;
    line-height: 1.3;
}

/* ============================================
   UPLOAD AREA (Drag & Drop)
   ============================================ */

.upload-area {
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.upload-area:hover {
    background: #ffffff;
    border-color: #d1fe17;
}

.upload-area.dragover {
    background: #ffffff;
    border-color: #d1fe17;
    border-style: solid;
}

.upload-area__icon {
    margin-bottom: 1.5rem;
}

.upload-area__icon svg {
    width: 48px;
    height: 48px;
    color: #9ca3af;
}

.upload-area__text {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.upload-area__text strong {
    font-size: 1.125rem;
    font-weight: 700;
    color: #000000;
}

.upload-area__text span {
    font-size: 1rem;
    color: #6b7280;
}

.upload-area__hint {
    font-size: 0.875rem;
    color: #9ca3af;
}

#imageInput {
    display: none;
}

/* Upload Info - Free & unlimited badges */
.upload-info {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 2rem;
}

.upload-info__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
}

.upload-info__item svg {
    width: 18px;
    height: 18px;
    color: #10b981;
}

/* ============================================
   GRID PREVIEW SECTION
   ============================================ */

.grid-preview-section {
    margin-bottom: 3rem;
}

.grid-preview__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #000000;
    margin-bottom: 1rem;
    text-align: center;
}

.grid-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-width: 500px;
    margin: 0 auto 1rem;
    background: #f9fafb;
    padding: 1rem;
    border-radius: 0.75rem;
    border: 2px solid #e5e7eb;
}

.grid-cell {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.grid-cell::after {
    content: attr(data-cell);
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.grid-hint {
    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
    margin: 0;
}

/* ============================================
   DOWNLOAD SECTION
   ============================================ */

.download-section {
    margin-top: 2rem;
}

.download-section__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #000000;
    margin-bottom: 1rem;
    text-align: center;
}

.download-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 500px;
    margin: 0 auto 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: inherit;
    width: 100%;
}

.btn--primary {
    background: #000000;
    color: #ffffff;
}

.btn--primary:hover {
    background: #d1fe17;
    color: #000000;
}

.btn--primary:focus {
    outline: none;
    /* NO box-shadow per brand guidelines */
}

.btn--outline {
    background: transparent;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.btn--outline:hover {
    border-color: #d1fe17;
    color: #000000;
}

.btn svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   POSTING GUIDE
   ============================================ */

.posting-guide {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 0.75rem;
    padding: 1.5rem;
    max-width: 500px;
    margin: 0 auto;
}

.posting-guide__title {
    font-size: 1rem;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 0.75rem;
}

.posting-guide__steps {
    margin: 0;
    padding-left: 1.25rem;
}

.posting-guide__steps li {
    font-size: 0.9375rem;
    color: #78350f;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.posting-guide__steps li:last-child {
    margin-bottom: 0;
}

/* ============================================
   SEO INFO SECTION
   ============================================ */

.tool-info {
    background: #ffffff;
    padding: 3rem 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.tool-info__container {
    max-width: 800px;
    margin: 0 auto;
}

.tool-info__title {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 800;
    color: #000000;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    text-align: center;
    line-height: 1.2;
}

.tool-info__content p {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: #374151;
    margin-bottom: 1.25rem;
}

.tool-info__subtitle {
    font-size: clamp(1.125rem, 2.5vw, 1.375rem);
    font-weight: 700;
    color: #000000;
    margin: 2.5rem 0 1.25rem;
    text-align: left;
    line-height: 1.3;
}

.tool-info__steps {
    margin: 2rem 0;
}

.info-step {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 2rem;
    align-items: flex-start;
    background: #ffffff;
    padding: 1.25rem;
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.info-step:hover {
    border-color: #d1fe17;
    transform: translateX(4px);
}

.info-step:last-child {
    margin-bottom: 0;
}

.info-step__number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: #d1fe17;
    color: #000000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 800;
}

.info-step__content {
    flex: 1;
}

.info-step__title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #000000;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.info-step__description {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #374151;
    margin: 0;
}

.tool-info__closing {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: #374151;
    margin-top: 2rem;
    padding: 1.25rem;
    background: #f9fafb;
    border-radius: 0.75rem;
    border-left: 4px solid #d1fe17;
}

.tool-info__closing strong {
    color: #000000;
}

/* ============================================
   FINAL CTA SECTION
   ============================================ */

.final-cta-section-new {
    background: #000000;
    padding: 50px 0;
    text-align: center;
    border-radius: 28px;
    margin: 30px auto;
    max-width: 1400px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.container-lg {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
}

.final-cta-new-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

.final-cta-new-content {
    max-width: 600px;
    text-align: center;
}

.final-cta-new-content h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.final-cta-new-content p {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.btn-cta-primary-black {
    background: #d1fe17;
    color: #000000;
    padding: 1rem 2rem;
    font-size: 1.0625rem;
    font-weight: 700;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-cta-primary-black:hover {
    background: #ffffff;
    color: #000000;
}

.final-cta-microcopy {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cta-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.final-cta-new-visual {
    max-width: 500px;
}

.final-cta-mockup {
    width: 100%;
    height: auto;
    border-radius: 1rem;
}

/* ============================================
   TABLET: 640px and up
   ============================================ */

@media (min-width: 640px) {
    .tool-hero {
        padding: 4rem 2rem 2.5rem;
    }

    .tool-hero__title {
        font-size: clamp(2rem, 5vw, 2.75rem);
    }

    .tool-hero__description {
        font-size: 1.125rem;
    }

    .tool-section {
        padding: 4rem 2rem;
    }

    .tool-card {
        padding: 2.5rem 2rem;
    }

    .upload-area {
        padding: 3.5rem 2.5rem;
    }

    .upload-area__icon svg {
        width: 56px;
        height: 56px;
    }

    .grid-preview {
        max-width: 550px;
        gap: 10px;
        padding: 1.25rem;
    }

    .download-actions {
        flex-direction: row;
        max-width: 600px;
    }

    .posting-guide {
        padding: 2rem;
    }

    .tool-info {
        padding: 3.5rem 2rem;
    }

    .info-step {
        padding: 1.5rem;
        gap: 1.5rem;
    }

    .info-step__number {
        width: 48px;
        height: 48px;
        font-size: 1.375rem;
    }

    .final-cta-section-new {
        padding: 60px 0;
        border-radius: 32px;
        margin: 40px auto;
    }

    .final-cta-new-wrapper {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }

    .final-cta-new-content {
        text-align: left;
        max-width: 550px;
    }
}

/* ============================================
   DESKTOP: 1024px and up
   ============================================ */

@media (min-width: 1024px) {
    .tool-hero {
        padding: 5rem 2rem 3rem;
    }

    .tool-section {
        padding: 5rem 2rem;
    }

    .tool-card {
        padding: 3rem;
    }

    .upload-area {
        padding: 4rem 3rem;
    }

    .upload-area__icon svg {
        width: 64px;
        height: 64px;
    }

    .grid-preview {
        max-width: 600px;
        gap: 12px;
        padding: 1.5rem;
    }

    .tool-info {
        padding: 4rem 2rem;
    }

    .info-step {
        padding: 2rem;
        gap: 2rem;
        margin-bottom: 2.5rem;
    }

    .info-step__number {
        width: 52px;
        height: 52px;
        font-size: 1.5rem;
    }

    .info-step__title {
        font-size: 1.125rem;
    }

    .info-step__description {
        font-size: 1rem;
    }
}

/* ============================================
   MOBILE OPTIMIZATION: Max 640px
   ============================================ */

@media (max-width: 640px) {
    .tool-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .tool-tabs::-webkit-scrollbar {
        display: none;
    }

    .tool-tab {
        padding: 0.875rem 1rem;
        font-size: 0.9375rem;
        flex-shrink: 0;
    }

    .tool-tab__text {
        display: none;
    }

    .tool-tab--active .tool-tab__text {
        display: inline;
    }

    .grid-preview {
        gap: 6px;
        padding: 0.75rem;
    }

    .grid-cell::after {
        font-size: 0.5625rem;
        padding: 1px 4px;
        bottom: 2px;
        right: 2px;
    }

    .download-actions {
        gap: 0.625rem;
    }

    .final-cta-section-new {
        margin: 20px;
        max-width: calc(100% - 40px);
        border-radius: 20px;
        padding: 35px 0;
    }

    .container-lg {
        padding: 0 20px;
    }

    .final-cta-microcopy {
        flex-direction: column;
        gap: 0.25rem;
    }
}
