/* Modern Subscription Calculator - CSS */

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

:root {
    /* Modern Color Palette */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #ec4899;
    --accent: #14b8a6;
    --success: #10b981;
    --danger: #dc2626;
    --warning: #f59e0b;
    --info: #3b82f6;

    /* Neutrals */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Text Colors */
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-tertiary: #6b7280;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-success: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md:
        0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg:
        0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl:
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Glass Effect */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.18);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;

    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-elevated: rgba(255, 255, 255, 0.95);
    --border-color: rgba(0, 0, 0, 0.1);
}

body {
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Roboto",
        "Oxygen",
        "Ubuntu",
        "Cantarell",
        "Fira Sans",
        "Droid Sans",
        "Helvetica Neue",
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--gradient-primary);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--gray-900);
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: 70px; /* Space for sticky nav */
}

/* Sticky Navigation */
.sticky-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all var(--transition-base);
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    position: relative;
    z-index: 1001;
    pointer-events: none;
}

.nav-content > * {
    pointer-events: auto;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--gray-900);
    font-weight: 700;
    font-size: 1.125rem;
    transition: all var(--transition-base);
}

.nav-brand:hover {
    color: var(--primary);
}

.nav-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.nav-brand:hover .nav-logo {
    transform: scale(1.1);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

/* Hamburger Menu Button */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    padding: 12px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    z-index: 9999 !important;
    position: relative !important;
    transition: all 0.3s ease;
    pointer-events: auto !important;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation !important;
    isolation: isolate;
}

.hamburger span {
    width: 100%;
    height: 3px;
    background-color: var(--gray-900);
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
    pointer-events: none;
}

.hamburger:hover span {
    background-color: var(--primary);
}

.hamburger.active span:nth-child(1) {
    transform: translateY(10.5px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-10.5px) rotate(-45deg);
}

@media (max-width: 768px) {
    .hamburger {
        display: flex !important;
        z-index: 9999 !important;
        pointer-events: auto !important;
    }

    .nav-links {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        max-height: calc(100vh - 72px);
        overflow-y: auto;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-link {
        width: 100%;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        text-align: left;
        font-size: 1rem;
    }

    .nav-link:last-child {
        border-bottom: none;
    }

    .nav-link::after {
        display: none;
    }

    .nav-link:hover,
    .nav-link.active {
        background-color: rgba(59, 130, 246, 0.05);
        color: var(--primary);
    }

    body.menu-open {
        overflow: hidden;
    }
}

.nav-link {
    text-decoration: none;
    color: var(--gray-700);
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all var(--transition-base);
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width var(--transition-base);
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link.active {
    color: var(--primary);
}

.nav-link.active::after {
    width: 100%;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-base);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
}

/* Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing-outer);
    width: 100%;
    overflow-x: hidden;
}

@media (max-width: 640px) {
    .container {
        padding: 0 var(--spacing-gutter);
    }
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 0 2rem;
    animation: fadeInDown 0.8s ease-out;
}

.logo-wrapper {
    margin-bottom: 1.5rem;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.logo-wrapper:hover {
    transform: scale(1.1);
}

.logo-wrapper:active {
    transform: scale(0.95);
}

.logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.15));
    will-change: transform;
}

.hero-title {
    font-size: clamp(1.5rem, 5vw, 3rem);
    font-weight: 800;
    color: white;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }
}

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

.hero-subtitle {
    font-size: clamp(1rem, 3vw, 1.25rem);
    color: rgba(255, 255, 255, 0.95);
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.8;
    font-weight: 400;
    padding: 0 1rem;
}

/* Main Container */
.main-container {
    padding: 2rem 0 4rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

/* Stats grid inside form */
.modern-form .stats-grid {
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    animation: none;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    min-height: 100px;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-2xl);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-primary::before {
    background: var(--gradient-primary);
}
.stat-secondary::before {
    background: var(--gradient-secondary);
}
.stat-accent::before {
    background: var(--gradient-accent);
}
.stat-info::before {
    background: var(--gradient-success);
}

.stat-icon {
    font-size: clamp(2rem, 4vw, 2.5rem);
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: #4b5563;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    color: #111827;
    line-height: 1;
    word-break: break-word;
}

/* Card Styles */
.card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
    overflow: hidden;
    transition: all var(--transition-base);
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.card-elevated {
    box-shadow: var(--shadow-xl);
}

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

.card-header {
    padding: 2rem 2rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Modern Header Styles */
.card-header-modern {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f3f4f6;
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 1.25rem 1.25rem 0 0;
    gap: 1rem;
    transition: all 0.2s ease;
}

.card-header-modern:hover {
    background: rgba(99, 102, 241, 0.02);
    border-bottom-color: #e0e7ff;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.header-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-header-modern:hover .header-icon {
    transform: scale(1.1) rotate(90deg);
}

.card-header-modern:hover .header-icon path {
    stroke: #4f46e5;
}

.header-title {
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
    line-height: 1.5;
    transition: color 0.2s ease;
}

.card-header-modern:hover .header-title {
    color: #4f46e5;
}

.header-right {
    display: flex;
    align-items: center;
}

.tracked-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: #eef2ff;
    color: #4f46e5;
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    border: 1px solid #c7d2fe;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    line-height: 1;
    min-height: 24px;
}

.tracked-badge::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    flex-shrink: 0;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    50% {
        opacity: 0.8;
        box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
    }
}

.tracked-badge:hover {
    background: #e0e7ff;
    border-color: #a5b4fc;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.15);
}

.tracked-badge:hover::before {
    animation: none;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.3);
}

/* Optional: Gradient Badge Variant */
.tracked-badge.gradient {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.tracked-badge.gradient::before {
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.tracked-badge.gradient:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.tracked-badge.gradient:hover::before {
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3);
}

/* Optional: Minimal Badge Variant (dot + number) */
.tracked-badge.minimal {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0.125rem 0.5rem;
    gap: 0.375rem;
}

.tracked-badge.minimal::before {
    width: 8px;
    height: 8px;
    background: #6366f1;
    animation: none;
}

.tracked-badge.minimal:hover {
    background: rgba(99, 102, 241, 0.05);
    transform: none;
    box-shadow: none;
}

.tracked-badge.minimal:hover::before {
    background: #4f46e5;
    box-shadow: none;
}

/* Badge animations */
@keyframes badgeBounce {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes badgeFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.tracked-badge.updated {
    animation: badgeBounce 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-title {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    word-break: break-word;
}

.title-icon {
    font-size: clamp(1.5rem, 3vw, 1.75rem);
    flex-shrink: 0;
}

.card-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

@media (max-width: 768px) {
    .card-actions {
        gap: 0.5rem;
    }
}

@media (max-width: 640px) {
    .card-actions {
        width: 100%;
        gap: 0.5rem;
    }

    .card-actions .btn {
        flex: 1;
        padding: 0.625rem 0.75rem;
        font-size: 0.8125rem;
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    .card-actions {
        gap: 0.375rem;
    }

    .card-actions .btn {
        padding: 0.5rem 0.625rem;
        font-size: 0.75rem;
        min-height: 42px;
    }
}

@media (max-width: 375px) {
    .card-actions {
        gap: 0.375rem;
        flex-direction: column;
        width: 100%;
    }

    .card-actions .btn {
        width: 100%;
        padding: 0.625rem 0.875rem;
        font-size: 0.8125rem;
        justify-content: center;
    }
}

.card-body {
    padding: 2rem;
}

/* Form Styles */
.modern-form {
    width: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        margin-bottom: 1.25rem;
    }
}

@media (max-width: 480px) {
    .form-grid {
        gap: 1rem;
        margin-bottom: 1rem;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.625rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    letter-spacing: -0.01em;
}

.label-required {
    color: var(--danger);
    font-size: 1.125rem;
    line-height: 1;
}

.form-input,
.form-select {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.98) 0%,
        rgba(249, 250, 251, 0.95) 100%
    );
    color: var(--gray-900);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.04),
        0 1px 3px rgba(0, 0, 0, 0.02),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.form-input:hover,
.form-select:hover {
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.06),
        0 2px 4px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow:
        0 0 0 4px rgba(99, 102, 241, 0.12),
        0 4px 16px rgba(99, 102, 241, 0.15),
        0 2px 6px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 1);
    transform: translateY(-1px);
}

/* Mobile Form Input Optimizations */
@media (max-width: 640px) {
    .form-input,
    .form-select {
        font-size: 16px; /* Prevents iOS zoom on focus */
        padding: 0.75rem 0.875rem;
        min-height: 44px; /* Touch-friendly */
    }

    .form-label {
        font-size: 14px;
        margin-bottom: 0.5rem;
    }

    .label-hint {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .form-input,
    .form-select {
        font-size: 16px;
        padding: 0.625rem 0.75rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .input-with-prefix {
        padding-left: 2.25rem;
    }

    .input-icon {
        left: 0.75rem;
        font-size: 14px;
    }
}

@media (max-width: 375px) {
    .form-input,
    .form-select {
        padding: 0.5rem 0.625rem;
        font-size: 15px;
    }
}

.form-input::placeholder {
    color: var(--gray-400);
    font-weight: 400;
    letter-spacing: -0.01em;
}

.input-with-icon {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-500);
    font-weight: 600;
    pointer-events: none;
}

.input-with-prefix {
    padding-left: 2.5rem;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M7 7l3 3 3-3' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

@media (max-width: 480px) {
    .form-select {
        padding-right: 2.25rem;
        background-position: right 0.625rem center;
        background-size: 18px;
    }
}

/* Currency Selector - Special Styling */
#currency-selector {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.5;
    padding: 0.875rem 2.75rem 0.875rem 1rem;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(249, 250, 251, 0.98) 100%
    );
    border: 2px solid rgba(99, 102, 241, 0.2);
    box-shadow:
        0 2px 8px rgba(99, 102, 241, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all var(--transition-base);
    max-height: 300px;
}

@media (max-width: 640px) {
    #currency-selector {
        font-size: 16px; /* Prevents iOS zoom */
        padding: 0.75rem 2.5rem 0.75rem 0.875rem;
    }
}

@media (max-width: 480px) {
    #currency-selector {
        font-size: 15px;
        padding: 0.625rem 2.25rem 0.625rem 0.75rem;
    }
}

#currency-selector option {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    background: white;
    color: var(--gray-800);
    line-height: 1.6;
}

#currency-selector option:hover,
#currency-selector option:checked {
    background: linear-gradient(
        135deg,
        rgba(99, 102, 241, 0.1) 0%,
        rgba(99, 102, 241, 0.05) 100%
    );
    font-weight: 600;
}

#currency-selector optgroup {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--primary);
    background: linear-gradient(
        135deg,
        rgba(99, 102, 241, 0.05) 0%,
        rgba(99, 102, 241, 0.02) 100%
    );
    padding: 0.5rem 0.75rem;
    margin-top: 0.25rem;
    border-top: 1px solid rgba(99, 102, 241, 0.1);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#currency-selector optgroup:first-child {
    margin-top: 0;
    border-top: none;
}

#currency-selector:hover {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow:
        0 4px 12px rgba(99, 102, 241, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

#currency-selector:focus {
    border-color: var(--primary);
    box-shadow:
        0 0 0 3px rgba(99, 102, 241, 0.1),
        0 4px 12px rgba(99, 102, 241, 0.2);
    transform: translateY(-1px);
    outline: none;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Autocomplete Dropdown Styles */
.autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.autocomplete-wrapper input {
    padding-right: 2.75rem;
}

.autocomplete-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
    transition: all 0.3s ease;
}

.autocomplete-wrapper input:focus ~ .autocomplete-icon {
    color: var(--primary);
}

.autocomplete-wrapper.dropdown-active .autocomplete-icon {
    transform: translateY(-50%) rotate(180deg);
}

.autocomplete-wrapper input:focus {
    border-radius: 12px 12px 0 0;
    border-bottom-color: rgba(99, 102, 241, 0.2);
}

.autocomplete-wrapper input:focus + .autocomplete-dropdown.show {
    border-top: 1px solid rgba(99, 102, 241, 0.2);
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.1),
        0 4px 8px rgba(0, 0, 0, 0.06);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: -1px;
}

.autocomplete-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.autocomplete-item {
    padding: 0.875rem 1.125rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.9375rem;
    color: var(--gray-800);
}

.autocomplete-item:last-child {
    border-bottom: none;
    border-radius: 0 0 12px 12px;
}

.autocomplete-item:hover {
    background: linear-gradient(
        135deg,
        rgba(99, 102, 241, 0.08) 0%,
        rgba(99, 102, 241, 0.04) 100%
    );
    color: var(--primary);
    padding-left: 1.25rem;
}

.autocomplete-item.active {
    background: linear-gradient(
        135deg,
        rgba(99, 102, 241, 0.12) 0%,
        rgba(99, 102, 241, 0.08) 100%
    );
    color: var(--primary);
    font-weight: 600;
}

.autocomplete-dropdown::-webkit-scrollbar {
    width: 8px;
}

.autocomplete-dropdown::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 0 0 12px 0;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 4px;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

.autocomplete-no-results {
    padding: 1rem 1.125rem;
    color: var(--gray-500);
    text-align: center;
    font-size: 0.875rem;
    font-style: italic;
}

/* Autocomplete Add Item */
.autocomplete-add-item {
    color: var(--primary);
    font-weight: 500;
    border-top: 1px solid var(--gray-100);
    background: linear-gradient(
        135deg,
        rgba(99, 102, 241, 0.02),
        rgba(168, 85, 247, 0.02)
    );
}

.autocomplete-add-item:hover {
    background: linear-gradient(
        135deg,
        rgba(99, 102, 241, 0.08),
        rgba(168, 85, 247, 0.08)
    );
    color: var(--primary-dark);
}

.autocomplete-add-item strong {
    color: var(--primary);
}

/* Added Services Hints */
.added-services-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem 0;
    animation: slideDown 0.3s ease-out;
}

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

.service-hint-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4375rem 0.625rem;
    background: linear-gradient(
        135deg,
        rgba(99, 102, 241, 0.08),
        rgba(168, 85, 247, 0.06)
    );
    color: var(--gray-700);
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.15);
    transition: all 0.2s ease;
    animation: tagFadeIn 0.3s ease-out;
    user-select: none;
    pointer-events: auto;
}

@keyframes tagFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.service-hint-tag:hover {
    background: linear-gradient(
        135deg,
        rgba(99, 102, 241, 0.12),
        rgba(168, 85, 247, 0.1)
    );
    border-color: rgba(99, 102, 241, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

.hint-tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    margin: 0;
    background: rgba(239, 68, 68, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--danger);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    pointer-events: auto;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.hint-tag-remove:hover {
    background: var(--danger);
    color: white;
    transform: scale(1.1);
}

.hint-tag-remove:active {
    transform: scale(0.95);
}

.hint-tag-remove svg {
    width: 14px;
    height: 14px;
    display: block;
}

/* Responsive Autocomplete Styles */
@media (max-width: 768px) {
    .autocomplete-dropdown {
        max-height: 250px;
        border-radius: 0 0 10px 10px;
        font-size: 0.875rem;
    }

    .autocomplete-item {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .autocomplete-icon {
        width: 18px;
        height: 18px;
        right: 0.875rem;
    }

    .autocomplete-wrapper input {
        padding-right: 2.5rem;
    }

    .autocomplete-add-item {
        font-size: 0.875rem;
    }

    .added-services-hints {
        gap: 0.4375rem;
        margin-top: 0.625rem;
        padding: 0.625rem 0;
    }

    .service-hint-tag {
        font-size: 0.8125rem;
        padding: 0.375rem 0.5625rem;
    }

    .hint-tag-remove {
        width: 17px;
        height: 17px;
    }

    .hint-tag-remove svg {
        width: 13px;
        height: 13px;
    }
}

@media (max-width: 480px) {
    .autocomplete-dropdown {
        max-height: 200px;
        border-radius: 0 0 8px 8px;
    }

    .autocomplete-item {
        padding: 0.625rem 0.875rem;
        font-size: 0.8125rem;
    }

    .autocomplete-no-results {
        padding: 0.875rem 1rem;
        font-size: 0.8125rem;
    }

    .autocomplete-add-item {
        font-size: 0.8125rem;
    }

    .added-services-hints {
        gap: 0.375rem;
        margin-top: 0.5rem;
        padding: 0.5rem 0;
    }

    .service-hint-tag {
        font-size: 0.75rem;
        padding: 0.3125rem 0.5rem;
        border-radius: 10px;
    }

    .hint-tag-remove {
        width: 16px;
        height: 16px;
    }

    .hint-tag-remove svg {
        width: 12px;
        height: 12px;
    }

    .autocomplete-icon {
        width: 16px;
        height: 16px;
        right: 0.75rem;
    }

    .autocomplete-wrapper input {
        padding-right: 2.25rem;
    }

    .modern-form .stats-grid {
        grid-template-columns: 1fr;
        margin-top: 1.25rem;
        margin-bottom: 1rem;
    }

    .label-hint {
        display: none !important;
    }
}

/* Enhanced Empty State Styles */
.stats-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: linear-gradient(
        135deg,
        rgba(99, 102, 241, 0.03),
        rgba(99, 102, 241, 0.01)
    );
    border-radius: 20px;
    border: 2px dashed rgba(99, 102, 241, 0.15);
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.6s ease-out;
}

.stats-empty-state::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle,
        rgba(99, 102, 241, 0.05) 0%,
        transparent 70%
    );
    animation: rotate 20s linear infinite;
    opacity: 0.6;
}

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

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

.empty-state-icon-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.empty-state-icon {
    font-size: 4rem;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
    filter: grayscale(0.3);
    position: relative;
    z-index: 2;
}

.empty-state-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.1);
    animation: pulse 2s ease-out infinite;
    z-index: 1;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.8;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.4;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 0.75rem 0;
    letter-spacing: -0.02em;
}

.empty-state-description {
    font-size: 1rem;
    color: var(--gray-600);
    margin: 0 auto 2rem auto;
    max-width: 500px;
    line-height: 1.6;
}

.empty-state-steps {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.empty-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: white;
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.empty-step::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(99, 102, 241, 0.1),
        transparent
    );
    transition: left 0.6s ease;
}

.empty-step:hover::before {
    left: 100%;
}

.empty-step:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.step-text {
    font-size: 0.9375rem;
    color: var(--gray-700);
    font-weight: 600;
    white-space: nowrap;
}

.empty-state-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: linear-gradient(
        135deg,
        rgba(99, 102, 241, 0.08),
        rgba(99, 102, 241, 0.04)
    );
    border-radius: 50px;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.875rem;
    animation: bounce 2s ease-in-out infinite;
    transition: all 0.3s ease;
}

.empty-state-arrow:hover {
    background: linear-gradient(
        135deg,
        rgba(99, 102, 241, 0.15),
        rgba(99, 102, 241, 0.08)
    );
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.empty-state-arrow:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.15);
    transition: all 0.1s ease;
}

@keyframes bounce {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.empty-state-arrow svg {
    animation: arrowPulse 2s ease-in-out infinite;
}

@keyframes arrowPulse {
    0%,
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateY(-3px) scale(1.1);
        opacity: 0.7;
    }
}

/* Stats appearance animation */
.stats-grid.show-stats {
    animation: slideInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.stat-card {
    animation: scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.stat-card:nth-child(1) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(2) {
    animation-delay: 0.2s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.3s;
}

.stat-card:nth-child(4) {
    animation-delay: 0.4s;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Empty State */
@media (max-width: 768px) {
    .stats-empty-state {
        padding: 2.5rem 1.25rem;
    }

    .empty-state-title {
        font-size: 1.25rem;
    }

    .empty-state-description {
        font-size: 0.9375rem;
    }

    .empty-state-steps {
        gap: 1rem;
    }

    .empty-step {
        padding: 0.625rem 1rem;
    }

    .step-number {
        width: 24px;
        height: 24px;
        font-size: 0.8125rem;
    }

    .step-text {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .stats-empty-state {
        padding: 2rem 1rem;
    }

    .empty-state-icon {
        font-size: 3rem;
    }

    .empty-state-title {
        font-size: 1.125rem;
    }

    .empty-state-description {
        font-size: 0.875rem;
    }

    .empty-state-steps {
        flex-direction: column;
        gap: 0.75rem;
    }

    .empty-step {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }

    .empty-state-arrow {
        font-size: 0.8125rem;
    }
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: inherit;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.98);
}

/* Responsive Button Styles */
@media (max-width: 640px) {
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 15px;
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 0.5rem 1rem;
        font-size: 14px;
        gap: 0.375rem;
    }

    .btn-icon {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 375px) {
    .btn {
        padding: 0.5rem 0.875rem;
        font-size: 13px;
    }
}

/* Shake Animation for Validation Errors */
@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-8px);
    }
    20%,
    40%,
    60%,
    80% {
        transform: translateX(8px);
    }
}

.shake-error {
    animation: shake 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97);
    border-color: #ef4444 !important;
}

/* Add Subscription Button in Form */
.form-group .btn-large {
    font-size: 1.0625rem;
    padding: 1rem 2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-group .btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
}

.form-group .btn-primary:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.5);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition:
        width 0.6s,
        height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.6);
    animation: buttonPulse 1.5s ease-in-out infinite;
}

.btn-primary:hover .btn-icon {
    animation: rotateIcon 0.6s ease-in-out;
}

@keyframes rotateIcon {
    0% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(180deg) scale(1.2);
    }
    100% {
        transform: rotate(360deg);
    }
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

@keyframes buttonPulse {
    0%,
    100% {
        box-shadow: 0 8px 24px rgba(99, 102, 241, 0.6);
    }
    50% {
        box-shadow: 0 8px 32px rgba(99, 102, 241, 0.8);
    }
}

/* Highlight New Subscription Animation */
@keyframes highlightNew {
    0% {
        background: rgba(99, 102, 241, 0.15);
        transform: scale(1.02);
    }
    50% {
        background: rgba(99, 102, 241, 0.08);
    }
    100% {
        background: transparent;
        transform: scale(1);
    }
}

/* Helpful Tips Section */
.helpful-tips {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin-top: 2rem;
    background: linear-gradient(
        135deg,
        rgba(99, 102, 241, 0.06),
        rgba(99, 102, 241, 0.02)
    );
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    animation: slideInRight 0.6s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.tip-icon {
    font-size: 1.5rem;
    animation: tipPulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes tipPulse {
    0%,
    100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.1);
        filter: brightness(1.2);
    }
}

.tip-content {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tip-label {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tip-text {
    color: var(--gray-700);
    font-size: 0.9375rem;
    line-height: 1.5;
    animation: fadeIn 0.6s ease-out;
}

@media (max-width: 768px) {
    .helpful-tips {
        padding: 0.875rem 1rem;
        gap: 0.75rem;
    }

    .tip-icon {
        font-size: 1.25rem;
    }

    .tip-label {
        font-size: 0.8125rem;
    }

    .tip-text {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .helpful-tips {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .tip-content {
        width: 100%;
    }

    .form-group .btn-large {
        font-size: 0.9375rem;
        padding: 0.875rem 1.5rem;
    }
}

/* Helpful Tips Section */
.btn-secondary {
    background: #e5e7eb;
    color: #111827;
    font-weight: 600;
}

.btn-secondary:hover {
    background: #d1d5db;
    color: #111827;
}

.btn-danger {
    background: #dc2626;
    color: white;
    font-weight: 700;
    border: 1px solid #b91c1c;
}

.btn-danger:hover {
    background: #b91c1c;
    border-color: #991b1b;
}

.btn-danger:active {
    background: #991b1b;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .btn-sm {
        padding: 0.5rem 0.625rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 375px) {
    .btn-sm {
        padding: 0.4375rem 0.5rem;
        font-size: 0.6875rem;
    }
}

.btn-icon {
    font-size: 1.125rem;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    flex-wrap: wrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.filter-tab {
    flex: 1 1 auto;
    min-width: 80px;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: #4b5563;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: inherit;
    white-space: nowrap;
}

.filter-tab:hover {
    color: #111827;
    background: rgba(255, 255, 255, 0.7);
}

.filter-tab.active {
    background: white;
    color: #4f46e5;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Subscriptions Grid */
.subscriptions-grid {
    display: grid;
    gap: 1rem;
}

.subscription-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 1.25rem;
    padding: 1.5rem 1.75rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideIn 0.4s ease-out;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.subscription-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px);
    border-color: #d1d5db;
}

.subscription-card:active {
    transform: translateY(-2px);
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.card-title-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.card-service-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.card-category-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
    flex-shrink: 0;
}

.category-entertainment {
    background: #fef3c7;
    color: #92400e;
}
.category-music {
    background: #fce7f3;
    color: #9d174d;
}
.category-productivity {
    background: #e0e7ff;
    color: #3730a3;
}
.category-education {
    background: #fef3c7;
    color: #92400e;
}
.category-software {
    background: #e0e7ff;
    color: #3730a3;
}
.category-gaming {
    background: #ddd6fe;
    color: #5b21b6;
}
.category-fitness {
    background: #fed7aa;
    color: #9a3412;
}
.category-news {
    background: #e5e7eb;
    color: #374151;
}
.category-utilities {
    background: #ccfbf1;
    color: #115e59;
}
.category-other {
    background: #f3f4f6;
    color: #4b5563;
}

/* Card Actions */
.card-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Filter Dropdown Mobile */
.filter-dropdown-mobile {
    display: none;
}

.filter-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    background: #ffffff;
    color: #374151;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M7 7l3 3 3-3' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.filter-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

@media (max-width: 768px) {
    .filter-tabs-desktop {
        display: none;
    }

    .filter-dropdown-mobile {
        display: block;
        margin-bottom: 1rem;
        padding: 0 var(--spacing-outer);
    }
}

@media (max-width: 480px) {
    .filter-select {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
        border-radius: 0.625rem;
        padding-right: 2.25rem;
    }

    .filter-dropdown-mobile {
        padding: 0 var(--spacing-gutter);
        margin-bottom: 0.75rem;
    }
}

@media (max-width: 375px) {
    .filter-select {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
}

.card-action-btn {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.card-action-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.card-action-btn:active {
    transform: translateY(0);
}

.card-action-delete:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

/* Card Pricing */
.card-pricing {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.card-price-display {
    display: flex;
    align-items: baseline;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.price-main {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    line-height: 1;
    letter-spacing: -0.02em;
}

.price-period {
    font-size: 1rem;
    font-weight: 500;
    color: #6b7280;
}

.price-divider {
    font-size: 1rem;
    color: #d1d5db;
    margin: 0 0.25rem;
}

.price-yearly {
    font-size: 1rem;
    font-weight: 600;
    color: #9ca3af;
}

.card-frequency-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.625rem 1.5rem;
    border-radius: 2rem;
    font-size: 0.9375rem;
    font-weight: 600;
    text-transform: capitalize;
    color: white;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
    transition: all 0.2s ease;
}

.card-frequency-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.frequency-monthly {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

.frequency-yearly {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.frequency-weekly {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.frequency-daily {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

/* Category Breakdown */
.category-item {
    margin-bottom: 1.5rem;
}

.category-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.category-name {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.category-cost {
    font-weight: 700;
    color: #4f46e5;
    font-size: 1.125rem;
}

.progress-bar {
    height: 10px;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 0.5rem;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    transition: width var(--transition-slow);
    border-radius: var(--radius-full);
}

/* Spacing between subscription list and category breakdown */
#category-breakdown {
    margin-top: 0;
}

.card-elevated:has(#category-breakdown) {
    margin-top: 2rem;
}

@keyframes progressFill {
    from {
        width: 0 !important;
    }
}

.category-percentage {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    font-size: 5rem;
    line-height: 1;
    margin-bottom: 1.5rem;
    opacity: 0.6;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}

.empty-state-text {
    font-size: 1rem;
    color: #4b5563;
    font-weight: 500;
    max-width: 400px;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.empty-state-text[onclick] {
    cursor: pointer;
    font-weight: 600;
}

.empty-state-text[onclick]:hover {
    color: #4f46e5;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 2px;
    transform: scale(1.02);
}

.empty-state-text[onclick]:active {
    transform: translateY(0) scale(0.98);
    transition: all 0.1s ease;
}

.empty-message {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--gray-500);
}

.empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* FAQ Section */
.faq-section {
    margin-top: 2rem;
    padding: 2rem 0;
}

.faq-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    text-align: center;
    color: white;
    margin-bottom: 2rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 0 1rem;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.faq-item {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
}

.faq-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-2xl);
}

.faq-question {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.faq-icon {
    font-size: 2rem;
    line-height: 1;
}

.faq-question h3 {
    font-size: clamp(1rem, 2.5vw, 1.125rem);
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.4;
    word-break: break-word;
}

.faq-answer {
    color: var(--gray-700);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* Legal Section */
.about-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 4rem 0 2rem;
    margin-top: 3rem;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.about-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.about-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.about-card h3 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.about-card p {
    color: var(--gray-700);
    line-height: 1.8;
    font-size: 1rem;
}

.about-card strong {
    color: var(--gray-900);
    font-weight: 600;
}

/* Legacy class support */
.legal-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 4rem 0 2rem;
    margin-top: 3rem;
}

.legal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.legal-item {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.legal-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.legal-text {
    color: var(--gray-700);
    line-height: 1.8;
    font-size: 1rem;
}

.legal-divider {
    color: var(--gray-400);
    font-size: 0.875rem;
}

/* Footer */
.footer {
    background: rgba(102, 94, 162, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1.5rem 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-text {
    color: white;
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.footer-subtext {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 400;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toast {
    background: white;
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-2xl);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
    animation: slideInRight 0.3s ease-out;
    border-left: 4px solid var(--primary);
}

.toast-success {
    border-left-color: var(--success);
}
.toast-error {
    border-left-color: var(--danger);
}
.toast-warning {
    border-left-color: var(--warning);
}
.toast-info {
    border-left-color: var(--info);
}

.toast-icon {
    font-size: 1.5rem;
}

.toast-message {
    flex: 1;
    font-weight: 600;
    color: var(--gray-900);
}

.toast-close {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    color: var(--gray-600);
}

/* Custom Confirmation Modal */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease-out;
}

.confirm-modal.show {
    display: flex;
}

.confirm-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

.confirm-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 420px;
    width: 100%;
    padding: 0;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

.confirm-modal-header {
    padding: 2rem 2rem 0;
    display: flex;
    justify-content: center;
}

.confirm-modal-icon {
    animation: iconBounce 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes iconBounce {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.confirm-modal-body {
    padding: 1.5rem 2rem;
    text-align: center;
}

.confirm-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.75rem 0;
    line-height: 1.5;
}

.confirm-modal-message {
    font-size: 0.9375rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.6;
}

.confirm-modal-actions {
    display: flex;
    gap: 0.75rem;
    padding: 0 2rem 2rem;
}

.confirm-modal-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    min-height: 44px;
}

.confirm-modal-cancel {
    background: #f3f4f6;
    color: #374151;
}

.confirm-modal-cancel:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

.confirm-modal-cancel:active {
    transform: translateY(0);
}

.confirm-modal-confirm {
    background: #6366f1;
    color: white;
}

.confirm-modal-confirm:hover {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.confirm-modal-confirm:active {
    transform: translateY(0);
}

/* Responsive Confirm Modal */
@media (max-width: 480px) {
    .confirm-modal {
        padding: 0.75rem;
    }

    .confirm-modal-content {
        border-radius: 12px;
        max-width: 100%;
    }

    .confirm-modal-header {
        padding: 1.5rem 1.5rem 0;
    }

    .confirm-modal-icon {
        width: 40px;
        height: 40px;
    }

    .confirm-modal-body {
        padding: 1.25rem 1.5rem;
    }

    .confirm-modal-title {
        font-size: 1.125rem;
    }

    .confirm-modal-message {
        font-size: 0.875rem;
    }

    .confirm-modal-actions {
        padding: 0 1.5rem 1.5rem;
        gap: 0.625rem;
    }

    .confirm-modal-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
        border-radius: 8px;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .main-container {
        padding: 1.5rem 1rem;
    }
}

/* Tablet Styles (768px and below) */
@media (max-width: 768px) {
    body {
        font-size: 0.9375rem;
        padding-top: 60px;
    }

    .nav-content {
        padding: 0;
    }

    .nav-brand {
        font-size: 16px;
    }

    .nav-logo {
        width: 24px;
        height: 24px;
    }

    .nav-links {
        gap: 1rem;
    }

    .nav-link {
        font-size: 0.875rem;
    }

    .hero {
        padding: 1.5rem 0 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 0 var(--spacing-gutter);
    }

    .modern-form .stats-grid {
        margin-top: 1rem;
        margin-bottom: 0.75rem;
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 1rem;
        min-height: auto;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.8125rem;
    }

    .label-hint {
        display: none !important;
    }

    .about-section,
    .legal-section {
        padding: 3rem 0 1.5rem;
    }

    .about-grid,
    .legal-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .about-card {
        padding: 2rem;
    }

    .legal-item {
        padding: 1.5rem;
    }

    .stat-card {
        padding: 1.25rem;
        gap: 0.875rem;
        min-height: 90px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.5rem;
        gap: 0.75rem;
    }

    .card-body {
        padding: 1.5rem;
    }

    .card {
        margin-bottom: 1.5rem;
    }

    .subscription-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.875rem;
    }

    .subscription-costs {
        grid-template-columns: 1fr;
        gap: 0.875rem;
    }

    .faq-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .faq-item {
        padding: 1.25rem;
    }

    #toast-container {
        left: 0.5rem;
        right: 0.5rem;
        top: 1rem;
    }

    .toast {
        min-width: auto;
        padding: 0.875rem 1rem;
    }

    .filter-tabs {
        gap: 0.375rem;
        padding: 0.375rem;
        margin-bottom: 1.25rem;
    }

    .btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 60px;
        padding-bottom: 80px; /* Space for bottom action bar */
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .container {
        padding: 0 1rem;
        max-width: 100%;
    }

    .sticky-nav {
        padding: 0;
    }

    .nav-content {
        padding: 0.5rem 0;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .nav-brand {
        font-size: 0.9375rem;
    }

    .nav-logo {
        width: 28px;
        height: 28px;
    }

    .nav-links {
        width: 100%;
        justify-content: space-between;
        gap: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.25rem;
    }

    .nav-link {
        font-size: 0.8125rem;
        white-space: nowrap;
        padding: 0.25rem 0.5rem;
    }

    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 1.5rem;
        right: 1.5rem;
    }

    .back-to-top svg {
        width: 20px;
        height: 20px;
    }

    .hero {
        padding: 1.5rem 0 1rem;
        margin-bottom: 0.5rem;
    }

    .logo {
        width: 56px;
        height: 56px;
    }

    .logo-wrapper {
        margin-bottom: 0.75rem;
    }

    .card-header,
    .card-body {
        padding: 1rem;
    }

    .stat-card {
        padding: 1.25rem 1rem;
        gap: 0.5rem;
        flex-direction: column;
        min-height: unset;
        align-items: center;
        text-align: center;
    }

    .stat-icon {
        font-size: 2rem;
        margin-bottom: 0.25rem;
    }

    .stat-content {
        width: 100%;
    }

    .stat-label {
        font-size: 0.6875rem;
        font-weight: 700;
        color: #4b5563;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 0.25rem;
    }

    .stat-value {
        font-size: 1.75rem;
        font-weight: 800;
        color: #111827;
    }

    .btn-large {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        min-height: 52px; /* Better touch target */
        font-weight: 600;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .filter-tabs {
        gap: 0.5rem;
        padding: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .filter-tabs::-webkit-scrollbar {
        display: none;
    }

    .filter-tab {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        min-width: 80px;
        white-space: nowrap;
        min-height: 44px; /* Touch target */
    }

    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1.5rem;
    }

    .form-actions .btn {
        width: 100%;
        min-height: 48px;
    }

    .card-actions {
        width: 100%;
        gap: 0.375rem;
    }

    .card-actions .btn {
        min-height: 44px;
    }

    .subscription-card {
        padding: 1.25rem 1.5rem;
        margin-bottom: 0.75rem;
        gap: 1rem;
    }

    .subscription-card::after {
        content: "← Swipe";
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        opacity: 0.3;
        font-size: 0.75rem;
        color: var(--text-secondary);
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .subscription-card:hover::after,
    .subscription-card:active::after {
        opacity: 0;
    }

    .subscription-card:active {
        transform: scale(0.99);
    }

    .faq-section {
        margin-top: 1.5rem;
        padding: 1.5rem 0;
    }

    .faq-item {
        padding: 1rem;
    }

    .faq-icon {
        font-size: 1.5rem;
    }

    .main-container {
        padding: 1rem 0 1rem;
    }

    .modern-form {
        margin-bottom: 0;
    }

    .about-section,
    .legal-section {
        padding: 2rem 0 1rem;
    }

    .about-card {
        padding: 1.5rem;
    }

    .about-card h3 {
        font-size: 1.25rem;
    }

    .about-card p {
        font-size: 0.95rem;
    }

    .legal-item {
        padding: 1.25rem;
    }

    .legal-title {
        font-size: 1.125rem;
    }

    .legal-text {
        font-size: 0.875rem;
    }

    .legal-links {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .legal-divider {
        display: none;
    }

    /* Mobile-specific form improvements */
    .form-input,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.875rem 1rem;
        min-height: 48px;
    }

    .form-label {
        font-size: 0.875rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
    }

    .form-grid {
        gap: 1rem;
    }

    .modern-form .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin: 1.25rem 0;
    }

    /* Card improvements */
    .card {
        border-radius: 16px;
        margin-bottom: 1.25rem;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    }

    .card-header {
        padding: 1.25rem 1.25rem 0.75rem;
    }

    .card-title {
        font-size: 1.125rem;
        font-weight: 700;
    }

    .card-body {
        padding: 1rem 1.25rem 1.25rem;
    }

    /* Subscription card touch improvements */
    .card-service-name {
        font-size: 1.25rem;
    }

    .card-pricing {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .price-main {
        font-size: 1.5rem;
    }

    .price-period {
        font-size: 0.875rem;
    }

    .price-yearly {
        font-size: 0.875rem;
    }

    .card-category-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.625rem;
    }

    .card-frequency-badge {
        font-size: 0.8125rem;
        padding: 0.5rem 1.25rem;
    }

    .card-action-btn {
        width: 2.5rem;
        height: 2.5rem;
    }

    /* Button icon improvements */
    .btn-icon-only {
        min-width: 44px;
        min-height: 44px;
        padding: 0.625rem;
    }

    .btn-icon-only svg {
        width: 20px;
        height: 20px;
    }

    /* Autocomplete mobile optimization */
    .autocomplete-dropdown {
        max-height: 50vh;
        border-radius: 12px;
    }

    .autocomplete-item {
        padding: 1rem;
        font-size: 0.9375rem;
        min-height: 52px;
    }

    /* Empty state mobile */
    .empty-state {
        padding: 2rem 1rem;
    }

    .empty-state-icon {
        font-size: 3rem;
        margin-bottom: 1rem;
    }

    .empty-state-title {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }

    .empty-state-text {
        font-size: 0.9375rem;
        font-weight: 500;
        color: #4b5563;
        line-height: 1.6;
    }

    /* Hero section mobile */
    .hero-title {
        font-size: 1.875rem;
        line-height: 1.3;
        font-weight: 700;
        letter-spacing: -0.5px;
    }

    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.5;
        opacity: 0.9;
    }

    /* Toast mobile positioning */
    #toast-container {
        bottom: 90px; /* Above bottom action bar */
        top: auto;
    }

    .toast {
        border-radius: 12px;
        padding: 1rem 1.25rem;
    }
}

/* Sticky bottom action bar for mobile */
.mobile-action-bar {
    display: none;
}

@media (max-width: 768px) {
    .mobile-action-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-elevated);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--border-color);
        padding: 0.75rem 1rem;
        display: flex;
        gap: 0.5rem;
        align-items: center;
        z-index: 900;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .mobile-action-bar.visible {
        transform: translateY(0);
    }

    .mobile-action-bar .btn {
        flex: 1;
        margin: 0;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        font-weight: 600;
        min-height: 44px;
        white-space: nowrap;
    }

    .mobile-action-bar .btn-danger {
        background: #dc2626;
        color: white;
        font-weight: 700;
    }

    .mobile-action-bar .btn-danger:hover,
    .mobile-action-bar .btn-danger:active {
        background: #b91c1c;
    }

    .mobile-action-bar .btn-secondary {
        background: #e5e7eb;
        color: #111827;
        font-weight: 600;
    }

    .mobile-action-bar .btn-secondary:hover,
    .mobile-action-bar .btn-secondary:active {
        background: #d1d5db;
        color: #111827;
    }

    .mobile-action-bar .btn-sm {
        flex: 0 0 auto;
        padding: 0.625rem 1rem;
    }

    .mobile-action-bar .btn svg {
        width: 18px;
        height: 18px;
    }
}

/* Pull to refresh indicator */
.pull-to-refresh {
    display: none;
}

@media (max-width: 768px) {
    .pull-to-refresh {
        display: flex;
        position: fixed;
        top: 60px;
        left: 50%;
        transform: translateX(-50%) translateY(-100%);
        background: var(--bg-elevated);
        padding: 0.5rem 1rem;
        border-radius: 20px;
        box-shadow: var(--shadow-lg);
        z-index: 1000;
        opacity: 0;
        transition: all 0.3s ease;
        align-items: center;
        gap: 0.5rem;
        font-size: 0.875rem;
        color: var(--text-secondary);
    }

    .pull-to-refresh.active {
        transform: translateX(-50%) translateY(10px);
        opacity: 1;
    }

    .pull-to-refresh .spinner {
        width: 16px;
        height: 16px;
        border: 2px solid var(--border-color);
        border-top-color: var(--primary-color);
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
    }

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

/* Improved touch feedback */
@media (max-width: 768px) {
    .btn:active,
    .filter-tab:active,
    .subscription-card:active,
    .nav-link:active {
        transform: scale(0.98);
    }

    .btn-icon-only:active {
        transform: scale(0.95);
    }

    /* Ripple effect for cards */
    .subscription-card {
        overflow: hidden;
        position: relative;
    }

    .subscription-card::before {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.1);
        transform: translate(-50%, -50%);
        transition:
            width 0.6s,
            height 0.6s;
    }

    .subscription-card:active::before {
        width: 300px;
        height: 300px;
    }
}

/* Horizontal scroll hint for filters */
@media (max-width: 480px) {
    .filter-tabs::after {
        content: "";
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 40px;
        background: linear-gradient(to right, transparent, var(--bg-primary));
        pointer-events: none;
        opacity: 1;
        transition: opacity 0.3s ease;
    }

    .filter-tabs.scrolled-end::after {
        opacity: 0;
    }
}

/* Landscape mobile optimization */
@media (max-width: 900px) and (max-height: 500px) {
    body {
        padding-top: 50px;
    }

    .sticky-nav {
        padding: 0.5rem 0;
    }

    .hero {
        padding: 1rem 0;
    }

    .logo-wrapper {
        margin-bottom: 0.5rem;
    }

    .logo {
        width: 40px;
        height: 40px;
    }

    .hero-title {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }

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

    .stat-card {
        min-height: 70px;
        padding: 0.75rem;
    }

    .card-header,
    .card-body {
        padding: 1rem;
    }
}

/* Enhanced visual hierarchy for mobile */
@media (max-width: 480px) {
    /* Section headers */
    h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
        font-weight: 700;
        letter-spacing: -0.3px;
    }

    h3 {
        font-size: 1.125rem;
        font-weight: 600;
    }

    /* Increase contrast for better readability */
    .stat-value {
        color: #111827;
        text-shadow: none;
        letter-spacing: -0.5px;
    }

    /* Better visual separation */
    section {
        margin-bottom: 2rem;
    }

    /* Floating action button style for primary action */
    .form-group .btn-primary.btn-large {
        position: relative;
        box-shadow: 0 4px 16px rgba(126, 87, 194, 0.35);
        font-weight: 700;
        letter-spacing: 0.3px;
        transform: translateZ(0);
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .form-group .btn-primary.btn-large:active {
        transform: scale(0.98) translateZ(0);
        box-shadow: 0 2px 8px rgba(126, 87, 194, 0.3);
    }

    /* Progress indicators more visible */
    .progress-bar {
        height: 8px;
        border-radius: 4px;
    }

    /* Category breakdown mobile optimization */
    .category-item {
        padding: 1rem;
        border-radius: 12px;
        margin-bottom: 0.75rem;
    }

    .category-name {
        font-size: 0.9375rem;
        font-weight: 600;
        letter-spacing: 0.2px;
    }

    .category-cost {
        font-size: 1.25rem;
        font-weight: 700;
        letter-spacing: -0.3px;
        color: #4f46e5;
    }

    .category-percentage {
        font-size: 0.8125rem;
        font-weight: 600;
        color: #6b7280;
    }
}

/* Legacy Count Badge Styling (kept for backward compatibility) */
.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.75rem;
    padding: 0.375rem 0.75rem;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: white;
    font-size: 0.875rem;
    font-weight: 700;
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    animation: badgePulse 2s ease-in-out infinite;
    min-width: 32px;
    height: 32px;
    line-height: 1;
    transition: all 0.3s ease;
}

.count-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

@keyframes badgePulse {
    0%,
    100% {
        box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 2px 12px rgba(99, 102, 241, 0.5);
        transform: scale(1.05);
    }
}

/* Responsive Styles for Modern Header */
@media (max-width: 768px) {
    .card-header-modern {
        padding: 0.875rem 1rem;
        gap: 0.75rem;
    }

    .header-icon {
        width: 17px;
        height: 17px;
    }

    .header-title {
        font-size: 0.9375rem;
    }

    .tracked-badge {
        font-size: 0.6875rem;
        padding: 0.1875rem 0.5rem;
        min-height: 22px;
        gap: 0.3125rem;
    }

    .tracked-badge::before {
        width: 5px;
        height: 5px;
    }
}

@media (max-width: 480px) {
    .card-header-modern {
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    .header-icon {
        width: 16px;
        height: 16px;
    }

    .header-title {
        font-size: 0.875rem;
    }

    .tracked-badge {
        font-size: 0.625rem;
        padding: 0.1875rem 0.4375rem;
        min-height: 20px;
        gap: 0.25rem;
    }

    .tracked-badge::before {
        width: 4px;
        height: 4px;
    }
}

@media (max-width: 375px) {
    .card-header-modern {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }

    .header-left {
        width: 100%;
    }

    .header-right {
        width: 100%;
        justify-content: flex-start;
    }

    .tracked-badge {
        margin-left: 1.625rem;
    }
}

/* Legacy responsive styles */
@media (max-width: 768px) {
    .count-badge {
        margin-left: 0.5rem;
        padding: 0.375rem 0.625rem;
        font-size: 0.8125rem;
        min-width: 30px;
        height: 30px;
        box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
    }
}

@media (max-width: 480px) {
    .count-badge {
        position: absolute;
        top: 1rem;
        right: 1rem;
        margin-left: 0;
        padding: 0.375rem 0.625rem;
        font-size: 0.8125rem;
        font-weight: 800;
        min-width: 36px;
        height: 36px;
        background: linear-gradient(135deg, #6366f1, #818cf8);
        border: 3px solid white;
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
        z-index: 10;
    }

    /* Make card header relative for badge positioning */
    .card-header {
        position: relative;
        padding-right: 4rem;
    }

    /* Animation is more subtle on mobile */
    @keyframes badgePulse {
        0%,
        100% {
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
        }
        50% {
            box-shadow: 0 4px 16px rgba(99, 102, 241, 0.6);
        }
    }
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        body {
            padding-bottom: max(80px, env(safe-area-inset-bottom));
        }

        .mobile-action-bar {
            padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
        }

        .sticky-nav {
            padding-top: max(0, env(safe-area-inset-top));
        }
    }
}

/* Performance optimizations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Touch device optimizations */
/* Extra Small Devices - 375px and below */
@media (max-width: 375px) {
    .nav-brand {
        font-size: 16px;
    }

    .nav-logo {
        width: 22px;
        height: 22px;
    }

    .subscription-card {
        padding: 1rem 1.25rem;
        border-radius: 1rem;
        gap: 0.875rem;
    }

    .card-service-name {
        font-size: 1.125rem;
    }

    .price-main {
        font-size: 1.25rem;
    }

    .price-period {
        font-size: 0.8125rem;
    }

    .price-yearly {
        font-size: 0.8125rem;
    }

    .card-category-badge {
        font-size: 0.6875rem;
        padding: 0.25rem 0.5rem;
    }

    .card-action-btn {
        width: 2rem;
        height: 2rem;
    }

    .card-action-btn svg {
        width: 16px;
        height: 16px;
    }

    .card-frequency-badge {
        font-size: 0.75rem;
        padding: 0.375rem 1rem;
    }

    .filter-tab {
        font-size: 12px;
        padding: 6px 12px;
    }

    .total-summary-bar {
        padding: 8px 10px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .summary-label,
    .summary-amounts {
        font-size: 13px;
    }

    .summary-amounts {
        font-size: 12px;
    }

    .hero {
        padding: 1rem 0 0.75rem;
    }

    .container {
        padding: 0 12px;
    }

    .modern-form {
        padding: 1rem 0.75rem;
        margin: 0.75rem 0;
    }

    .section-header {
        padding: 0 12px;
    }

    .filter-tabs-container {
        padding: 0 12px;
    }
}

/* Large Mobile Devices - iPhone Plus, Samsung Galaxy */
@media (min-width: 414px) and (max-width: 480px) {
    .subscription-card {
        padding: 1.125rem 1.375rem;
    }

    .card-service-name {
        font-size: 1.375rem;
    }

    .price-main {
        font-size: 1.625rem;
    }
}

/* Landscape Mobile Optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 1rem 0 0.75rem;
    }

    .logo {
        width: 50px;
        height: 50px;
        margin: 0 auto 0.5rem;
    }

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

    .modern-form {
        padding: 1rem;
    }
}

/* Tablet Landscape Optimization */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .subscriptions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .hero {
        padding: 1.5rem 0;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .filter-tab,
    .btn-icon-only,
    .btn-icon-minimal {
        min-height: 44px;
        min-width: 44px;
    }

    /* Prevent text selection on touch */
    .subscription-card,
    .btn,
    .filter-tab,
    .action-btn {
        -webkit-tap-highlight-color: transparent;
        user-select: none;
    }

    .filter-tab {
        padding: 0.75rem 1rem;
    }

    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .back-to-top {
        min-width: 50px;
        min-height: 50px;
    }
}

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Hide back-to-top on very small screens when keyboard is visible */
@media (max-height: 500px) {
    .back-to-top {
        display: none;
    }
}
