/* ----- RESET & BASE ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0b0e14;
    color: #eef2f8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ----- APP CONTAINER ----- */
.app {
    max-width: 780px;
    width: 100%;
    background: #141a24;
    border-radius: 36px;
    padding: 32px 28px 28px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.04);
    transition: 0.2s;
}

@media (max-width: 520px) {
    .app {
        padding: 22px 18px 20px;
        border-radius: 28px;
    }
}

/* ----- HEADER ----- */
.header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
}

.header .brand-icon {
    font-size: 34px;
    color: #4f9eff;
    background: linear-gradient(135deg, #4f9eff, #7c5cfc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.4px;
    background: linear-gradient(135deg, #f0f5ff, #b0c9ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header h1 span {
    font-weight: 400;
    -webkit-text-fill-color: #6a7fa0;
    background: none;
    color: #6a7fa0;
}

.header .badge {
    margin-left: auto;
    background: #1f2a3a;
    padding: 4px 14px;
    border-radius: 40px;
    font-size: 11px;
    font-weight: 600;
    color: #8aa3cc;
    border: 1px solid #2c3a50;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .header .badge {
        display: none;
    }
}

/* ----- ADS SLOT ----- */
.ad-slot {
    background: #1a212d;
    border-radius: 20px;
    padding: 14px 16px;
    margin-bottom: 24px;
    border: 1px dashed #2f3f57;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 70px;
    text-align: center;
    color: #5f78a0;
    font-size: 13px;
    letter-spacing: 0.2px;
    transition: 0.2s;
}

.ad-slot .material-icons-round {
    font-size: 28px;
    color: #3e5a7a;
}

.ad-slot .ad-label {
    background: #1f2a3a;
    padding: 2px 12px;
    border-radius: 40px;
    font-size: 10px;
    font-weight: 600;
    color: #5f78a0;
    border: 1px solid #2c3a50;
}

.ad-slot.real-ad {
    border: 1px solid #3a5070;
    background: #0f1620;
    padding: 8px 12px;
}

.ad-slot.real-ad img,
.ad-slot.real-ad iframe {
    max-width: 100%;
    border-radius: 12px;
}

/* ----- URL CARD ----- */
.url-card {
    background: #0f151f;
    border-radius: 24px;
    padding: 20px 22px 18px;
    border: 1px solid #212d3f;
    margin-bottom: 22px;
    transition: 0.2s;
}

.url-card .label-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6f8bb0;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.url-card .label-row .material-icons-round {
    font-size: 20px;
    color: #4f9eff;
}

.url-card .label-row .status {
    margin-left: auto;
    background: #1a2332;
    padding: 2px 14px;
    border-radius: 40px;
    font-size: 11px;
    font-weight: 500;
    color: #7e9bc9;
    border: 1px solid #26334a;
}

.url-card .url-display {
    background: #0b1019;
    border-radius: 16px;
    padding: 14px 18px;
    border: 1px solid #1f2b3d;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    word-break: break-all;
    font-size: 14px;
    line-height: 1.5;
    color: #c8daf5;
    font-family: 'Inter', monospace;
    letter-spacing: 0.1px;
}

.url-card .url-display .material-icons-round {
    font-size: 22px;
    color: #4f9eff;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ----- RESULT CARD (direct url) ----- */
.result-card {
    border-color: #1f3a5a;
    background: #0f1a2a;
}

.result-card .label-row .material-icons-round {
    color: #34c759;
}

.result-card .url-display {
    border-color: #1f3a5a;
    color: #b0d4ff;
}

/* ----- DOWNLOAD SECTION ----- */
.download-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin: 8px 0 18px;
}

#downloadBtn {
    width: 100%;
    max-width: 400px;
    padding: 16px 20px;
    border: none;
    border-radius: 60px;
    background: linear-gradient(135deg, #4f9eff, #7c5cfc);
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.25s ease;
    box-shadow: 0 8px 24px -4px rgba(79, 158, 255, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-family: 'Inter', sans-serif;
}

#downloadBtn .material-icons-round {
    font-size: 26px;
}

#downloadBtn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px -4px rgba(79, 158, 255, 0.5);
}

#downloadBtn:active:not(:disabled) {
    transform: scale(0.97);
}

#downloadBtn:disabled {
    background: #1f2a3a;
    color: #5f78a0;
    box-shadow: none;
    cursor: not-allowed;
    border-color: #2c3a50;
}

#downloadBtn:disabled .material-icons-round {
    color: #5f78a0;
}

.loader {
    width: 32px;
    height: 32px;
    border: 3px solid #1f2a3a;
    border-top: 3px solid #4f9eff;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    display: none;
}

.loader.active {
    display: block;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ----- FOOTER ----- */
.footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #1a2332;
    color: #4f6a8f;
    font-size: 12px;
    letter-spacing: 0.2px;
}

.footer .material-icons-round {
    font-size: 18px;
    color: #4f6a8f;
}

/* ----- TOAST NOTIFICATION ----- */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #1a2332;
    backdrop-filter: blur(12px);
    color: #eef2f8;
    padding: 12px 28px;
    border-radius: 60px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #2c3a50;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
    pointer-events: none;
    z-index: 999;
    font-family: 'Inter', sans-serif;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ----- RESPONSIVE ----- */
@media (max-width: 520px) {
    .url-card .url-display {
        font-size: 12px;
        padding: 12px 14px;
    }
    #downloadBtn {
        font-size: 16px;
        padding: 14px 16px;
    }
    .ad-slot {
        font-size: 12px;
        min-height: 60px;
        padding: 12px;
    }
    .toast {
        font-size: 13px;
        padding: 10px 20px;
        bottom: 20px;
    }
}

@media (max-width: 400px) {
    .app {
        padding: 16px 12px 16px;
        border-radius: 22px;
    }
    .header h1 {
        font-size: 20px;
    }
    .header .brand-icon {
        font-size: 28px;
    }
}