/* ============================================
   ShortURL App - Premium Design
   ============================================ */

:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-light: #818cf8;
    --secondary: #0ea5e9;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #0f172a;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    backdrop-filter: blur(10px);
    background: rgba(15, 23, 42, 0.95) !important;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 12px 0;
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
}

.navbar-brand i {
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    font-weight: 500;
    transition: color 0.2s;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    background: linear-gradient(160deg, #0f172a 0%, #1e1b4b 40%, #312e81 70%, #4338ca 100%);
    padding: 100px 0 120px;
    position: relative;
}

.hero-bg-shapes .shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--primary-light);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--secondary);
    bottom: -50px;
    left: -80px;
    animation-delay: -5s;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: #a78bfa;
    top: 30%;
    left: 10%;
    animation-delay: -10s;
}

.shape-4 {
    width: 150px;
    height: 150px;
    background: var(--success);
    bottom: 20%;
    right: 15%;
    animation-delay: -15s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(30px, -30px) rotate(5deg); }
    50% { transform: translate(-20px, 20px) rotate(-5deg); }
    75% { transform: translate(20px, 30px) rotate(3deg); }
}

.hero-badge .badge {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.15);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: white;
    line-height: 1.1;
    letter-spacing: -1.5px;
}

.gradient-text {
    background: linear-gradient(135deg, #818cf8, #06b6d4, #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.65);
    max-width: 550px;
    line-height: 1.7;
}

/* ============================================
   SHORTEN CARD (Main Input)
   ============================================ */
.shorten-card {
    max-width: 680px;
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-xl), 0 0 80px rgba(79, 70, 229, 0.15);
}

.shorten-input-group {
    border-radius: 50px;
    overflow: hidden;
    border: 2px solid var(--gray-200);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.shorten-input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.shorten-input-group .input-group-text {
    padding-left: 20px;
    font-size: 1.2rem;
}

.shorten-input-group .form-control {
    font-size: 1rem;
    padding: 14px 12px;
}

.shorten-input-group .form-control::placeholder {
    color: var(--gray-400);
}

.btn-shorten {
    border-radius: 0 50px 50px 0 !important;
    font-weight: 700;
    font-size: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    padding: 14px 28px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-shorten:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.advanced-toggle {
    color: var(--gray-500);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.advanced-toggle:hover {
    color: var(--primary);
}

/* ============================================
   RESULT BOX
   ============================================ */
.result-box {
    display: none;
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
    border: 1px solid #86efac;
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    animation: slideUp 0.3s ease;
}

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

.result-header {
    font-size: 0.9rem;
}

.short-url-display {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    word-break: break-all;
}

.btn-copy {
    font-weight: 600;
    border-radius: 8px;
}

.btn-qr-result {
    border-radius: 8px;
}

/* ============================================
   TRUST INDICATORS
   ============================================ */
.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 50px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
}

/* ============================================
   COUNTER SECTION
   ============================================ */
.counter-item {
    padding: 20px;
}

.counter-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.counter-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -1px;
}

.counter-label {
    color: var(--gray-500);
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
}

/* ============================================
   SECTION COMMON
   ============================================ */
.section-badge {
    display: inline-block;
    background: linear-gradient(135deg, rgba(79,70,229,0.1), rgba(14,165,233,0.1));
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -1px;
}

.section-subtitle {
    color: var(--gray-500);
    font-size: 1.05rem;
    max-width: 500px;
    margin: 8px auto 0;
}

/* ============================================
   FEATURES SECTION
   ============================================ */
.features-section {
    background: var(--gray-50);
}

.feature-card {
    background: white;
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
    border: 1px solid var(--gray-100);
    transition: all 0.3s ease;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.feature-icon-wrap {
    margin-bottom: 20px;
}

.feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.feature-icon.bg-primary { background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.feature-icon.bg-success { background: linear-gradient(135deg, #10b981, #059669); }
.feature-icon.bg-info { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.feature-icon.bg-warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
.feature-icon.bg-danger { background: linear-gradient(135deg, #ef4444, #dc2626); }
.feature-icon.bg-secondary { background: linear-gradient(135deg, #64748b, #475569); }

.feature-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.feature-desc {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.6;
}

/* ============================================
   HOW IT WORKS (STEPS)
   ============================================ */
.step-item {
    position: relative;
    padding: 24px;
}

.step-number {
    position: absolute;
    top: 10px;
    right: 30%;
    font-size: 4rem;
    font-weight: 900;
    color: var(--gray-100);
    line-height: 1;
    z-index: 0;
}

.step-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    position: relative;
    z-index: 1;
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.3);
}

/* ============================================
   CTA SECTION
   ============================================ */
.cta-section {
    padding: 40px 0 80px;
}

.cta-card {
    background: linear-gradient(135deg, var(--primary), #7c3aed, var(--secondary));
    border-radius: 24px;
    padding: 60px 40px;
    position: relative;
    overflow: hidden;
}

.cta-card::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    top: -100px;
    right: -50px;
}

.cta-card::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    bottom: -50px;
    left: -30px;
}

.cta-card .btn-light {
    font-weight: 700;
    color: var(--primary);
    transition: transform 0.2s;
}

.cta-card .btn-light:hover {
    transform: scale(1.05);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--dark);
    color: var(--gray-400);
    padding: 40px 0;
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* ============================================
   CARDS (General)
   ============================================ */
.card {
    border: 1px solid var(--gray-100);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

/* ============================================
   DASHBOARD STATS
   ============================================ */
.stat-card {
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
}

.stat-card.success { border-left-color: var(--success); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.danger { border-left-color: var(--danger); }

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -1px;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    min-height: calc(100vh - 56px);
    background: var(--dark);
    padding-top: 20px;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.6);
    padding: 11px 18px;
    border-radius: 10px;
    margin: 2px 10px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar .nav-link i {
    width: 22px;
    margin-right: 10px;
    font-size: 1rem;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    font-weight: 600;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* ============================================
   TABLE
   ============================================ */
.table th {
    background: var(--gray-800);
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: none;
}

/* ============================================
   QR CODE
   ============================================ */
.qr-container img {
    max-width: 250px;
    border: 3px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 10px;
    background: white;
}

/* ============================================
   TOAST
   ============================================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .hero-section {
        padding: 60px 0 80px;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .shorten-card {
        padding: 16px;
    }

    .section-title {
        font-size: 1.7rem;
    }

    .cta-card {
        padding: 40px 24px;
    }

    .sidebar {
        min-height: auto;
    }

    .counter-number {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 1.8rem;
    }

    .shorten-input-group {
        border-radius: 12px;
    }

    .shorten-input-group .btn {
        border-radius: 0 12px 12px 0 !important;
        padding: 12px 16px;
    }

    .trust-indicators {
        display: none;
    }
}

/* ============================================
   BADGE STATUS
   ============================================ */
.badge-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ============================================
   LOADING
   ============================================ */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    display: none;
}
