/* ============================================
   AlwaysViral Tools – Find Instagram User ID
   Design System & Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ---------- CSS Variables ---------- */
:root {
    --bg-body: #fff0f5;
    --bg-card: #ffffff;
    --bg-input: #fce7f3;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --border-focus: #db2777;
    --accent-purple: #833ab4;
    --accent-red: #fd1d1d;
    --accent-orange: #fcb045;
    --success-bg: #ecfdf5;
    --success-border: #6ee7b7;
    --success-text: #065f46;
    --success-icon: #10b981;
    --error-bg: #fef2f2;
    --error-border: #fca5a5;
    --error-text: #991b1b;
    --warning-bg: #fffbeb;
    --warning-border: #fcd34d;
    --warning-text: #92400e;
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 40px -5px rgba(0,0,0,0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Tool Section Container ---------- */
.tool-section { max-width: 640px; margin: 60px auto; padding: 0 20px; }
@media (max-width: 768px) { .tool-section { margin: 30px auto; padding: 0 16px; } }

/* ---------- Tool Header ---------- */
.tool-header { text-align: center; margin-bottom: 32px; }

.tool-header__icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 64px; height: 64px; border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #405de6, #5851db, #833ab4, #c13584, #e1306c, #fd1d1d);
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(64, 93, 230, 0.25);
    animation: pulse-glow 3s ease-in-out infinite;
}
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 8px 24px rgba(64, 93, 230, 0.25); }
    50% { box-shadow: 0 8px 32px rgba(64, 93, 230, 0.4); }
}
.tool-header__icon svg { width: 32px; height: 32px; fill: #ffffff; }

.tool-header__title {
    font-size: 26px; font-weight: 800; color: var(--text-primary);
    margin-bottom: 8px; letter-spacing: -0.5px;
}
.tool-header__subtitle {
    font-size: 15px; color: var(--text-secondary);
    max-width: 440px; margin: 0 auto; line-height: 1.5;
}

/* ---------- Tool Card ---------- */
.tool-card {
    background: var(--bg-card); border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg); padding: 40px;
    border: 1px solid var(--border-color); transition: var(--transition);
    position: relative; overflow: hidden;
}
.tool-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #405de6, #fd1d1d);
    opacity: 0; transition: var(--transition);
}
.tool-card:hover::before { opacity: 1; }
@media (max-width: 768px) { .tool-card { padding: 24px; border-radius: var(--radius-lg); } }

/* ---------- Form Elements ---------- */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block; font-size: 13px; font-weight: 600; color: var(--text-primary);
    margin-bottom: 8px; letter-spacing: 0.3px; text-transform: uppercase;
}
.input-wrapper { position: relative; display: flex; align-items: center; }
.input-wrapper__prefix {
    position: absolute; left: 16px; color: var(--text-muted);
    font-size: 15px; font-weight: 500; pointer-events: none; transition: var(--transition);
}
.input-wrapper__field {
    width: 100%; padding: 14px 16px; font-size: 15px;
    font-family: 'Inter', sans-serif; font-weight: 500; color: var(--text-primary);
    background: var(--bg-input); border: 2px solid var(--border-color);
    border-radius: var(--radius-md); outline: none; transition: var(--transition);
}
.input-wrapper__field--with-prefix { padding-left: 38px; }
.input-wrapper__field::placeholder { color: var(--text-muted); font-weight: 400; }
.input-wrapper__field:focus {
    border-color: var(--border-focus); background: var(--bg-card);
    box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.08);
}
.input-wrapper__field:focus + .input-wrapper__prefix,
.input-wrapper__field:not(:placeholder-shown) + .input-wrapper__prefix { color: var(--text-primary); }

/* ---------- Submit Button ---------- */
.btn-submit {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 15px 24px; font-size: 15px; font-weight: 600;
    font-family: 'Inter', sans-serif; color: #ffffff; background: var(--text-primary);
    border: none; border-radius: var(--radius-md); cursor: pointer;
    transition: var(--transition); letter-spacing: 0.3px; position: relative; overflow: hidden;
}
.btn-submit:hover:not(:disabled) {
    background: #1f2937; transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(17, 24, 39, 0.3);
}
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; background: #9ca3af; }
.btn-submit svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }

/* ---------- Loading Spinner ---------- */
.spinner {
    display: none; width: 20px; height: 20px;
    border: 2.5px solid rgba(255,255,255,0.3); border-top-color: #ffffff;
    border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-submit.loading .spinner { display: block; }
.btn-submit.loading .btn-text, .btn-submit.loading .btn-icon { display: none; }

/* ---------- Result Styles ---------- */
.result-container { margin-top: 28px; animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ID Display Card */
.id-result-card {
    background: #fff; border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); overflow: hidden;
    box-shadow: var(--shadow-md);
}

.id-hero {
    padding: 32px 24px; background: linear-gradient(135deg, #111827, #1f2937);
    color: #fff; text-align: center;
}
.id-hero__label {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1.5px; color: rgba(255,255,255,0.5); margin-bottom: 8px;
}
.id-hero__value {
    font-size: 42px; font-weight: 800; letter-spacing: -1.5px; margin-bottom: 12px;
    background: linear-gradient(to right, #fff, #9ca3af);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    cursor: pointer; position: relative; transition: var(--transition);
}
.id-hero__value:hover { transform: scale(1.02); }
.id-hero__hint { font-size: 12px; color: rgba(255,255,255,0.4); }

.profile-summary {
    padding: 24px; border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; gap: 20px;
}
.profile-summary__avatar {
    width: 80px; height: 80px; border-radius: 50%;
    border: 3px solid #fff; box-shadow: var(--shadow-md);
    object-fit: cover;
}
.profile-summary__info h3 { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.profile-summary__info p { font-size: 14px; color: var(--text-secondary); }

.stats-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
    background: var(--border-color);
}
.stat-item { background: #fff; padding: 20px 16px; text-align: center; }
.stat-item__value { display: block; font-size: 18px; font-weight: 800; color: var(--text-primary); }
.stat-item__label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }

.profile-details { padding: 24px; }
.detail-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 14px; }
.detail-row:last-child { margin-bottom: 0; }
.detail-row__label { font-weight: 600; color: var(--text-secondary); }
.detail-row__value { color: var(--text-primary); text-align: right; }

.bio-box { padding: 16px 24px; background: #f9fafb; border-top: 1px solid var(--border-color); font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

/* Copy Toast */
.copy-toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(100px);
    background: #111827; color: #fff; padding: 12px 24px; border-radius: var(--radius-full);
    font-size: 14px; font-weight: 600; transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    z-index: 9999; box-shadow: var(--shadow-xl);
}
.copy-toast.show { transform: translateX(-50%) translateY(0); }

/* Premium Growth CTA */
.premium-cta {
    margin-top: 32px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: var(--radius-lg);
    padding: 32px;
    color: #fff;
    text-align: center;
    box-shadow: 0 20px 40px rgba(79, 70, 229, 0.2);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.premium-cta__title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 24px;
    line-height: 1.3;
}

.premium-benefits {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.benefit-pill {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.benefit-pill svg { 
    width: 16px !important; 
    height: 16px !important; 
    min-width: 16px;
    fill: #10b981; 
    flex-shrink: 0;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.service-btn {
    background: #fff;
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.service-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    background: #f8fafc;
}

.service-btn svg { 
    width: 18px !important; 
    height: 18px !important; 
    min-width: 18px;
    fill: var(--accent-purple); 
    flex-shrink: 0;
}

/* ---------- Other Components ---------- */
.analyzing-state {
    margin-top: 24px; padding: 32px 24px; text-align: center;
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.analyzing-state__dots { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 16px; }
.analyzing-state__dots span {
    width: 10px; height: 10px; border-radius: 50%;
    background: linear-gradient(135deg, #405de6, #fd1d1d);
    animation: dot-bounce 1.4s ease-in-out infinite;
}
.analyzing-state__dots span:nth-child(2) { animation-delay: 0.2s; }
.analyzing-state__dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-bounce { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }

.attempts-badge { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 16px; padding: 8px 16px; font-size: 13px; font-weight: 500; color: var(--text-secondary); background: var(--bg-input); border-radius: var(--radius-full); border: 1px solid var(--border-color); }
.attempts-badge__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success-icon); }
.attempts-badge__dot.warning { background: #f59e0b; }
.attempts-badge__dot.danger { background: #ef4444; }

.result-error { display: flex; align-items: center; gap: 14px; padding: 20px 24px; background: var(--error-bg); border: 1px solid var(--error-border); border-radius: var(--radius-md); }
.result-error__icon { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-width: 44px; border-radius: 50%; background: #ef4444; color: #fff; font-size: 20px; }
.result-error__text h3 { font-size: 16px; font-weight: 700; color: var(--error-text); margin-bottom: 2px; }
.result-error__text p { font-size: 13px; color: #b91c1c; }

.limit-overlay { margin-top: 24px; padding: 28px 24px; background: var(--warning-bg); border: 1px solid var(--warning-border); border-radius: var(--radius-md); text-align: center; }
.limit-overlay__icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: #f59e0b; color: #fff; font-size: 28px; margin-bottom: 14px; }

/* ---------- Carousel & Footer ---------- */
.tool-footer { text-align: center; margin-top: 40px; padding: 24px; }
.cta-carousel { width: 100%; overflow: hidden; position: relative; padding: 10px 0; margin-top: 20px; }
.cta-track { display: flex; gap: 20px; width: max-content; animation: scroll 60s linear infinite; }
.cta-card { flex: 0 0 280px; background: var(--bg-card); padding: 24px; border-radius: var(--radius-xl); border: 1px solid var(--border-color); box-shadow: var(--shadow-md); text-decoration: none; display: flex; flex-direction: column; align-items: center; text-align: center; transition: var(--transition); }
.cta-card:hover { transform: translateY(-5px); border-color: var(--accent-purple); box-shadow: var(--shadow-lg); }
.cta-card__title { font-size: 15px; font-weight: 800; color: var(--text-primary); margin-bottom: 8px; }
.cta-card__btn { font-size: 12px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #405de6, #fd1d1d); padding: 8px 18px; border-radius: var(--radius-full); margin-top: auto; }
@keyframes scroll { 0% { transform: translateX(0); } 100% { transform: translateX(calc(-300px * 8)); } }
