/* =========================================
   TEMPLATECRAFT PRO - CREATE PROJECT CSS
========================================= */

* {
    font-family: 'Cairo', sans-serif;
    box-sizing: border-box;
}

body {
    background: #f8fafc;
}

/* =========================================
   TEMPLATE CARD
========================================= */

.template-card {
    position: relative;
    transition:
        transform .35s ease,
        box-shadow .35s ease,
        background .35s ease;
    cursor: pointer;
    overflow: hidden;
    isolation: isolate;
}

.template-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, .12);
}

.template-card.selected {
    border-color: transparent !important;

    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(
            120deg,
            #22c55e,
            #06b6d4,
            #3b82f6,
            #8b5cf6,
            #a855f7,
            #22c55e
        ) border-box;

    background-size:
        100% 100%,
        300% 300%;

    animation: selectedGradient 5s ease infinite;

    box-shadow:
        0 0 0 3px rgba(59, 130, 246, .08),
        0 12px 35px rgba(59, 130, 246, .12),
        0 0 35px rgba(139, 92, 246, .12);
}

.template-card.selected::before {
    content: "";
    position: absolute;
    inset: -3px;
    z-index: -1;
    border-radius: 1rem;

    background: linear-gradient(
        120deg,
        #22c55e,
        #06b6d4,
        #3b82f6,
        #8b5cf6,
        #a855f7,
        #22c55e
    );

    background-size: 300% 300%;
    filter: blur(8px);
    opacity: .55;

    animation: selectedGradient 5s ease infinite;
}

@keyframes selectedGradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Light line inside selected template */

.template-card.selected .selectedGlowLine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 70%;
    height: 2px;

    background: linear-gradient(
        90deg,
        transparent,
        #22c55e,
        #3b82f6,
        #a855f7,
        transparent
    );

    animation: glowLine 3s linear infinite;
    z-index: 10;
}

@keyframes glowLine {
    0% {
        left: -100%;
    }

    100% {
        left: 150%;
    }
}

.preview-frame {
    width: 100%;
    height: 190px;
    border: 0;
    background: white;
    pointer-events: none;
}

.modal-frame {
    width: 100%;
    height: 70vh;
    border: 0;
    background: white;
}

button:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.modal {
    display: none;
}

.modal.active {
    display: flex;
}

/* =========================================
   BASIC LOADER
========================================= */

.loader {
    width: 30px;
    height: 30px;

    border: 3px solid #e9d5ff;
    border-top-color: #9333ea;

    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================
   CREATE CONFIRMATION MODAL
========================================= */

.create-modal-backdrop {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.create-modal-card {
    animation: modalIn .35s cubic-bezier(.2, .8, .2, 1);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(25px) scale(.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.feature-card {
    transition:
        transform .25s ease,
        box-shadow .25s ease,
        border-color .25s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(15, 23, 42, .06);
    border-color: #c4b5fd;
}

/* =========================================
   NETLIFY CONNECTION CARD
========================================= */

.netlify-card {
    position: relative;
    overflow: hidden;

    border: 1px solid #e2e8f0;

    background: linear-gradient(
        135deg,
        #ffffff,
        #f8fafc
    );

    transition: all .3s ease;
}

.netlify-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 35px rgba(15, 23, 42, .08);
}

.netlify-icon {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 15px;

    color: white;
    font-size: 23px;
    font-weight: 900;

    background: linear-gradient(
        135deg,
        #0f172a,
        #334155
    );

    box-shadow: 0 8px 20px rgba(15, 23, 42, .18);
}

.netlify-status-dot {
    width: 9px;
    height: 9px;

    border-radius: 50%;

    background: #94a3b8;
    display: inline-block;
}

.netlify-status-dot.connected {
    background: #22c55e;

    box-shadow:
        0 0 0 4px rgba(34, 197, 94, .12);

    animation: netlifyPulse 2s infinite;
}

@keyframes netlifyPulse {
    0%,
    100% {
        box-shadow: 0 0 0 4px rgba(34, 197, 94, .12);
    }

    50% {
        box-shadow: 0 0 0 7px rgba(34, 197, 94, .04);
    }
}

.netlify-team-box {
    animation: modalIn .3s ease;
}

.netlify-connect-btn {
    transition: all .25s ease;
}

.netlify-connect-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, .15);
}

/* Netlify messages */

#netlifyConnectionMessage {
    min-height: 0;
    line-height: 1.8;
}

#netlifyConnectionMessage:empty {
    display: none;
}

/* Confirmation Team box */

#confirmNetlifyTeamBox {
    animation: modalIn .3s ease;
}

/* =========================================
   DEPLOYMENT FULL SCREEN OVERLAY
========================================= */

.deploy-overlay {
    display: none;
}

.deploy-overlay.active {
    display: flex;
}

.deploy-bg {
    position: absolute;
    inset: 0;

    background:
        radial-gradient(
            circle at 15% 20%,
            rgba(34, 197, 94, .28),
            transparent 30%
        ),
        radial-gradient(
            circle at 85% 25%,
            rgba(59, 130, 246, .30),
            transparent 32%
        ),
        radial-gradient(
            circle at 50% 90%,
            rgba(139, 92, 246, .30),
            transparent 35%
        ),
        linear-gradient(
            135deg,
            #111827,
            #374151,
            #172554,
            #312e81,
            #111827
        );

    background-size:
        auto,
        auto,
        auto,
        400% 400%;

    animation: deployBackground 9s ease infinite;
}

@keyframes deployBackground {
    0% {
        background-position:
            0 0,
            0 0,
            0 0,
            0% 50%;
    }

    50% {
        background-position:
            15% 20%,
            85% 25%,
            50% 90%,
            100% 50%;
    }

    100% {
        background-position:
            0 0,
            0 0,
            0 0,
            0% 50%;
    }
}

.deploy-panel {
    position: relative;
    z-index: 5;

    width: min(94%, 620px);

    background: rgba(15, 23, 42, .78);
    border: 1px solid rgba(255, 255, 255, .15);

    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);

    box-shadow:
        0 30px 100px rgba(0, 0, 0, .45),
        0 0 80px rgba(59, 130, 246, .10);

    border-radius: 28px;
    padding: 32px;

    animation: deployPanelIn .45s ease;
}

@keyframes deployPanelIn {
    from {
        opacity: 0;
        transform: scale(.94) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.deploy-logo {
    width: 74px;
    height: 74px;

    border-radius: 22px;

    background: linear-gradient(
        135deg,
        #22c55e,
        #06b6d4,
        #3b82f6,
        #8b5cf6
    );

    background-size: 250% 250%;
    animation: logoGradient 4s ease infinite;

    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow:
        0 0 35px rgba(59, 130, 246, .30),
        0 0 60px rgba(139, 92, 246, .20);
}

@keyframes logoGradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.deploy-spinner {
    width: 52px;
    height: 52px;

    border-radius: 50%;

    border: 4px solid rgba(255,255,255,.15);
    border-top-color: #22c55e;
    border-right-color: #3b82f6;
    border-bottom-color: #a855f7;

    animation: deploySpin 1s linear infinite;

    box-shadow:
        0 0 25px rgba(59, 130, 246, .25);
}

@keyframes deploySpin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================
   DEPLOY PROGRESS
========================================= */

.deploy-progress {
    width: 100%;
    height: 5px;

    border-radius: 999px;
    background: rgba(255,255,255,.10);

    overflow: hidden;
}

.deploy-progress-bar {
    width: 10%;
    height: 100%;

    border-radius: inherit;

    background: linear-gradient(
        90deg,
        #22c55e,
        #06b6d4,
        #3b82f6,
        #8b5cf6
    );

    background-size: 300% 100%;

    animation:
        progressGradient 2s linear infinite,
        progressMove 18s ease-out forwards;
}

@keyframes progressGradient {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 300% 50%;
    }
}

@keyframes progressMove {
    0% {
        width: 8%;
    }

    20% {
        width: 28%;
    }

    45% {
        width: 50%;
    }

    65% {
        width: 68%;
    }

    82% {
        width: 82%;
    }

    100% {
        width: 94%;
    }
}

/* =========================================
   DEPLOY STAGES
========================================= */

.deploy-stage {
    transition: all .3s ease;
}

.deploy-stage.active {
    color: white;
}

.deploy-stage.done {
    color: #86efac;
}

.deploy-stage.pending {
    color: rgba(255,255,255,.38);
}

.stage-icon {
    width: 34px;
    height: 34px;

    border-radius: 10px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(255,255,255,.07);

    transition: all .3s ease;
}

.deploy-stage.active .stage-icon {
    background: rgba(59,130,246,.20);
    box-shadow: 0 0 18px rgba(59,130,246,.20);
}

.deploy-stage.done .stage-icon {
    background: rgba(34,197,94,.18);
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 640px) {
    .deploy-panel {
        padding: 22px;
        border-radius: 22px;
    }

    .deploy-logo {
        width: 64px;
        height: 64px;
    }

    .modal-frame {
        height: 65vh;
    }

    .netlify-card {
        padding: 16px;
    }
}

/* =========================================
   REDUCED MOTION
========================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
