* {
    box-sizing: border-box;
}

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;

    --background: #f6f7fb;
    --card: #ffffff;

    --text: #111827;
    --muted: #6b7280;

    --border: #e5e7eb;
    --border-light: #f1f5f9;
}

body {
    margin: 0;

    min-height: 100vh;

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;

    background: var(--background);

    color: var(--text);
}

button,
input {
    font-family: inherit;
}

button {
    border: 0;
}


/*
|--------------------------------------------------------------------------
| APP
|--------------------------------------------------------------------------
*/

.app {
    width: 100%;

    max-width: 1050px;

    margin: 0 auto;

    padding:
        32px 24px
        50px;
}


/*
|--------------------------------------------------------------------------
| HEADER
|--------------------------------------------------------------------------
*/

.header {
    display: flex;

    align-items: center;

    gap: 14px;

    margin-bottom: 22px;
}

.header-icon {
    width: 48px;
    height: 48px;

    min-width: 48px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 13px;

    background:
        linear-gradient(
            135deg,
            #4f46e5,
            #7c3aed
        );

    color: white;

    font-size: 22px;

    box-shadow:
        0 8px 20px
        rgba(79, 70, 229, .22);
}

.header h1 {
    margin: 0 0 3px;

    font-size: 23px;

    line-height: 1.3;

    letter-spacing: -.3px;
}

.header p {
    margin: 0;

    color: var(--muted);

    font-size: 14px;
}


/*
|--------------------------------------------------------------------------
| PANEL
|--------------------------------------------------------------------------
*/

.panel {
    background: var(--card);

    border:
        1px solid
        var(--border);

    border-radius: 16px;

    padding: 22px;

    box-shadow:
        0 4px 20px
        rgba(15, 23, 42, .04);
}


/*
|--------------------------------------------------------------------------
| UPLOAD
|--------------------------------------------------------------------------
*/

.upload-area {
    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    min-height: 180px;

    padding: 25px;

    border:
        1.5px dashed
        #c7cbd4;

    border-radius: 13px;

    background: #fafbfc;

    text-align: center;

    cursor: pointer;

    transition:
        border-color .2s,
        background .2s;
}

.upload-area:hover,
.upload-area.dragover {
    border-color:
        var(--primary);

    background: #f5f3ff;
}

.upload-icon {
    width: 46px;
    height: 46px;

    display: flex;

    align-items: center;
    justify-content: center;

    margin-bottom: 12px;

    border-radius: 12px;

    background: #ede9fe;

    font-size: 22px;
}

.upload-area h3 {
    margin: 0 0 5px;

    font-size: 16px;
}

.upload-area p {
    margin: 0 0 5px;

    color: var(--muted);

    font-size: 13px;
}

.upload-area span {
    color: #9ca3af;

    font-size: 11px;
}


/*
|--------------------------------------------------------------------------
| SETTINGS
|--------------------------------------------------------------------------
*/

.settings {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-top: 16px;

    padding:
        14px 16px;

    border:
        1px solid
        var(--border);

    border-radius: 12px;

    background: #ffffff;
}

.setting-info label {
    display: block;

    margin-bottom: 3px;

    font-size: 14px;

    font-weight: 650;
}

.setting-info p {
    margin: 0;

    color: var(--muted);

    font-size: 12px;
}

.color-control {
    display: flex;

    align-items: center;

    gap: 14px;
}


/*
|--------------------------------------------------------------------------
| QUICK COLOR
|--------------------------------------------------------------------------
*/

.quick-colors {
    display: flex;

    align-items: center;

    gap: 7px;
}

.color-button {
    width: 28px;
    height: 28px;

    padding: 0;

    border:
        2px solid
        white;

    border-radius: 8px;

    background: var(--color);

    box-shadow:
        0 0 0 1px
        #d1d5db;

    cursor: pointer;

    transition:
        transform .15s,
        box-shadow .15s;
}

.color-button:hover {
    transform:
        translateY(-1px);
}

.color-button.active {
    box-shadow:
        0 0 0 2px
        var(--primary);
}


/*
|--------------------------------------------------------------------------
| CUSTOM COLOR
|--------------------------------------------------------------------------
*/

.custom-color {
    display: flex;

    align-items: center;

    gap: 7px;
}

#backgroundColor {
    width: 36px;
    height: 34px;

    padding: 3px;

    border:
        1px solid
        var(--border);

    border-radius: 8px;

    background: white;

    cursor: pointer;
}

#colorCode {
    width: 90px;

    height: 34px;

    padding:
        0 10px;

    border:
        1px solid
        var(--border);

    border-radius: 8px;

    outline: none;

    color: var(--text);

    font-size: 12px;

    font-weight: 600;

    text-transform: uppercase;
}

#colorCode:focus {
    border-color:
        var(--primary);

    box-shadow:
        0 0 0 3px
        rgba(79, 70, 229, .08);
}


/*
|--------------------------------------------------------------------------
| PHOTO SECTION
|--------------------------------------------------------------------------
*/

.photo-section {
    display: none;

    margin-top: 22px;
}

.photo-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 12px;
}

.photo-header h3 {
    margin: 0 0 2px;

    font-size: 15px;
}

.photo-header p {
    margin: 0;

    color: var(--muted);

    font-size: 12px;
}

.clear-button {
    padding:
        7px 11px;

    border-radius: 7px;

    background: #fef2f2;

    color: #dc2626;

    font-size: 11px;

    font-weight: 600;

    cursor: pointer;
}

.clear-button:hover {
    background: #fee2e2;
}


/*
|--------------------------------------------------------------------------
| PHOTO GRID
|--------------------------------------------------------------------------
*/

.photo-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            130px
        );

    gap: 12px;

    align-items: start;
}


/*
|--------------------------------------------------------------------------
| PHOTO CARD
|--------------------------------------------------------------------------
*/

.photo-card {
    position: relative;

    width: 130px;

    overflow: hidden;

    border:
        1px solid
        var(--border);

    border-radius: 10px;

    background: white;

    transition:
        transform .18s,
        box-shadow .18s;
}

.photo-card:hover {
    transform:
        translateY(-2px);

    box-shadow:
        0 8px 18px
        rgba(15, 23, 42, .08);
}


/*
|--------------------------------------------------------------------------
| PHOTO PREVIEW
|--------------------------------------------------------------------------
*/

.photo-preview {
    width: 100%;

    height: 145px;

    display: block;

    object-fit: contain;

    background: #f3f4f6;
}


/*
|--------------------------------------------------------------------------
| PHOTO INFO
|--------------------------------------------------------------------------
*/

.photo-info {
    padding:
        8px 9px;
}

.photo-name {
    overflow: hidden;

    color: #374151;

    font-size: 11px;

    font-weight: 600;

    text-overflow: ellipsis;

    white-space: nowrap;
}

.photo-size {
    margin-top: 2px;

    color: #9ca3af;

    font-size: 10px;
}


/*
|--------------------------------------------------------------------------
| REMOVE PHOTO
|--------------------------------------------------------------------------
*/

.remove-photo {
    position: absolute;

    top: 6px;
    right: 6px;

    width: 24px;
    height: 24px;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 0;

    border-radius: 7px;

    background:
        rgba(17, 24, 39, .7);

    color: white;

    font-size: 11px;

    cursor: pointer;

    opacity: 0;

    transition:
        opacity .15s,
        background .15s;
}

.photo-card:hover
.remove-photo {
    opacity: 1;
}

.remove-photo:hover {
    background: #dc2626;
}


/*
|--------------------------------------------------------------------------
| ACTION
|--------------------------------------------------------------------------
*/

.action {
    display: flex;

    justify-content: flex-end;

    margin-top: 22px;

    padding-top: 18px;

    border-top:
        1px solid
        var(--border-light);
}

.generate-button {
    width: auto;

    min-width: 230px;

    padding:
        11px 20px;

    border-radius: 9px;

    background:
        var(--primary);

    color: white;

    font-size: 13px;

    font-weight: 650;

    cursor: pointer;

    transition:
        background .2s,
        transform .15s;

    box-shadow:
        0 5px 14px
        rgba(79, 70, 229, .2);
}

.generate-button:hover {
    background:
        var(--primary-hover);

    transform:
        translateY(-1px);
}

.generate-button:disabled {
    opacity: .55;

    cursor: not-allowed;

    transform: none;
}


/*
|--------------------------------------------------------------------------
| PROGRESS
|--------------------------------------------------------------------------
*/

.progress-container {
    display: none;

    margin-top: 15px;

    padding: 13px 15px;

    border:
        1px solid
        var(--border);

    border-radius: 10px;

    background: #fafafa;
}

.progress-info {
    display: flex;

    justify-content: space-between;

    margin-bottom: 8px;

    color: #4b5563;

    font-size: 11px;

    font-weight: 600;
}

.progress {
    height: 6px;

    overflow: hidden;

    border-radius: 10px;

    background: #e5e7eb;
}

.progress-bar {
    width: 0%;
    height: 100%;

    border-radius: 10px;

    background:
        var(--primary);

    transition:
        width .2s;
}


/*
|--------------------------------------------------------------------------
| FOOTER
|--------------------------------------------------------------------------
*/

.footer {
    margin-top: 16px;

    text-align: center;

    color: #9ca3af;

    font-size: 11px;
}


/*
|--------------------------------------------------------------------------
| TABLET
|--------------------------------------------------------------------------
*/

@media (
    max-width: 700px
) {

    .app {
        padding:
            20px 14px
            35px;
    }

    .header {
        margin-bottom: 16px;
    }

    .header-icon {
        width: 42px;
        height: 42px;

        min-width: 42px;

        font-size: 19px;
    }

    .header h1 {
        font-size: 19px;
    }

    .header p {
        font-size: 12px;
    }

    .panel {
        padding: 15px;

        border-radius: 13px;
    }

    .upload-area {
        min-height: 150px;

        padding: 20px;
    }

    .settings {
        flex-direction: column;

        align-items: flex-start;

        gap: 14px;
    }

    .color-control {
        width: 100%;

        justify-content:
            space-between;
    }

    .photo-grid {
        grid-template-columns:
            repeat(
                auto-fill,
                minmax(
                    105px,
                    1fr
                )
            );

        gap: 9px;
    }

    .photo-card {
        width: 100%;
    }

    .photo-preview {
        height: 125px;
    }

    .remove-photo {
        opacity: 1;
    }

    .action {
        display: block;
    }

    .generate-button {
        width: 100%;

        min-width: 0;
    }

}


/*
|--------------------------------------------------------------------------
| SMALL MOBILE
|--------------------------------------------------------------------------
*/

@media (
    max-width: 400px
) {

    .color-control {
        flex-direction: column;

        align-items: flex-start;
    }

    .photo-grid {
        grid-template-columns:
            repeat(
                3,
                1fr
            );
    }

    .photo-preview {
        height: 110px;
    }

}