:root {
    /* Apple Color Palette */
    --apple-blue: #007aff;
    --apple-green: #34c759;
    --apple-red: #ff3b30;
    --apple-gray-1: #8e8e93;
    --apple-gray-2: #aeaeb2;
    --apple-gray-3: #c7c7cc;
    --apple-gray-4: #d1d1d6;
    --apple-gray-5: #e5e5ea;
    --apple-gray-6: #f2f2f7;

    --text-primary: #1d1d1f;
    --text-secondary: #86868b;

    /* Apple Glass Settings */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-blur: blur(40px) saturate(200%);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);

    /* Apple Corner Radii */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 30px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Apple's proprietary font stack */
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Custom Modern Scrollbar --- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
    border: 2px solid transparent;
    background-clip: padding-box;
}

/* --- Global Native Cursor --- */
body {
    cursor: default;
}

/* Force specific pointer cursor on clickables */
a,
button,
input[type="submit"],
input[type="radio"],
input[type="checkbox"],
select,
.filter-badge,
.clear-btn {
    cursor: pointer !important;
}

body {
    background-color: #f5f5f7;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    letter-spacing: -0.015em;
}

/* Stunning Abstract Wallpaper like macOS Sonoma/Ventura */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at 10% 20%, rgba(240, 240, 245, 1) 0%, rgba(220, 230, 245, 1) 100%);
}

/* Beautiful Animated Blurs simulating Apple abstract wallpapers */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.8;
    animation: drift 30s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.shape-1 {
    width: 60vw;
    height: 60vw;
    background: #FFB8E0;
    /* Soft Pink */
    top: -20vh;
    left: -10vw;
}

.shape-2 {
    width: 50vw;
    height: 50vw;
    background: #87C1FF;
    /* Apple Blueish */
    bottom: -10vh;
    right: -10vw;
    animation-delay: -10s;
}

.shape-3 {
    width: 40vw;
    height: 40vw;
    background: #C4A5FF;
    /* Soft Purple */
    top: 40vh;
    left: 30vw;
    animation-delay: -5s;
    animation-duration: 40s;
}

@keyframes drift {
    0% {
        transform: translate(0, 0) scale(1.0);
    }

    50% {
        transform: translate(10vw, -10vh) scale(1.2);
    }

    100% {
        transform: translate(-15vw, 15vh) scale(0.9);
    }
}

/* Layout Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 10;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3.5rem;
    animation: fadeDown 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-container {
    width: 80px;
    height: 80px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: var(--glass-shadow);
}

.logo-icon {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--apple-blue), #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.1;
    letter-spacing: -0.03em;
    /* Apple typography trait for large headers */
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Search Section - The Glass Mac OS Window */
.search-section {
    width: 100%;
    margin-bottom: 3rem;
    animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main iOS / macOS style frosted glass panel */
.search-glass-panel {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 1rem 1rem 1.25rem 1rem;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.search-glass-panel:focus-within {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

/* Input Styling (Similar to Spotlight) */
.search-input-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1.2rem;
    font-size: 1.5rem;
    color: var(--text-secondary);
    pointer-events: none;
    font-weight: 300;
}

input {
    width: 100%;
    /* Huge input, minimal style */
    padding: 1.1rem 3.5rem;
    font-size: 1.4rem;
    font-weight: 400;
    border: none;
    border-radius: var(--radius-lg);
    background: transparent;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.4);
}

input::placeholder {
    color: #a1a1a6;
    font-weight: 400;
}

.clear-btn {
    position: absolute;
    right: 1.2rem;
    background: var(--apple-gray-5);
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.clear-btn i {
    font-size: 1.2rem;
}

.clear-btn:hover {
    background: var(--apple-gray-4);
    color: var(--text-primary);
}

.hidden {
    display: none !important;
}

/* Filters - iOS Segmented Control style */
.search-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    background: rgba(0, 0, 0, 0.04);
    padding: 0.4rem;
    border-radius: var(--radius-lg);
}

.filter-badge {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

.filter-badge:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
}

.filter-badge.active {
    background: #ffffff;
    color: var(--text-primary);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 1px 1px rgba(0, 0, 0, 0.04);
}

/* Results Section */
.results-section {
    width: 100%;
    animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.results-info {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1.25rem;
}

/* Result Card - Apple Note/Widget Style */
.result-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    animation: slideUpFade 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.result-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.card-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    /* Squircle look */
    background: linear-gradient(180deg, var(--apple-green) 0%, #28a745 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 4px 12px rgba(52, 199, 89, 0.3);
}

.card-icon i {
    color: white;
    font-size: 1.6rem;
}

.card-content {
    flex-grow: 1;
}

.card-status {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--apple-green);
    margin-bottom: 0.2rem;
    letter-spacing: 0.5px;
}

.card-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.card-details {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.card-details span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-details i {
    color: var(--apple-blue);
    font-size: 1rem;
    opacity: 0.8;
}

.card-details strong {
    color: var(--text-primary);
    font-weight: 500;
}

/* Modern Share Button */
.share-btn {
    background: var(--apple-blue);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-xl);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.8rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.25);
    width: max-content;
}

.share-btn i {
    font-size: 1rem;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 122, 255, 0.35);
    background: #0062cc;
}

.share-btn:active {
    transform: translateY(0);
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    background: transparent;
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.empty-icon-wrapper {
    width: 90px;
    height: 90px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    /* Apple Squircle */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: var(--glass-shadow);
}

.empty-icon-wrapper i {
    font-size: 3rem;
    color: var(--apple-blue);
}

.empty-icon-wrapper.error i {
    color: var(--apple-red);
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 420px;
    margin: 0 auto;
    line-height: 1.4;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: auto;
    font-weight: 400;
}

/* Disclaimer Toast */
.disclaimer-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    padding: 0.8rem 1.2rem;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    width: max-content;
    max-width: 90vw;
    animation: popUpToast 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.disclaimer-toast.hiding {
    opacity: 0;
    transform: translate(-50%, 20px);
    pointer-events: none;
}

@keyframes popUpToast {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.toast-icon {
    width: 28px;
    height: 28px;
    background: var(--apple-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-icon i {
    color: white;
    font-size: 1.1rem;
}

.disclaimer-toast p {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

.disclaimer-toast p strong {
    font-weight: 600;
    color: var(--apple-blue);
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    margin-left: 0.5rem;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

@media (max-width: 600px) {
    .disclaimer-toast {
        border-radius: 16px;
        padding: 1rem;
        bottom: 15px;
    }

    .disclaimer-toast p {
        font-size: 0.8rem;
    }
}

/* Divider inside Search section acting like iOS list separator */
.search-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
    margin: 0 1rem;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 5rem 1rem 2rem 1rem;
        /* Extra top padding for mobile if needed, or adjust based on toast */
    }

    .logo-container {
        display: none;
        /* Hide icon on mobile */
    }

    h1 {
        font-size: 2rem;
        /* Animated text gradient for mobile */
        background: linear-gradient(270deg, var(--apple-blue), #ff3b30, #c4a5ff, var(--apple-blue));
        background-size: 300% 300%;
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        animation: textGradient 6s ease infinite;
    }

    @keyframes textGradient {
        0% {
            background-position: 0% 50%;
        }

        50% {
            background-position: 100% 50%;
        }

        100% {
            background-position: 0% 50%;
        }
    }

    .blob {
        opacity: 0.5;
        /* Reduce motion/distraction on mobile */
    }

    .search-glass-panel {
        padding: 1rem 0.5rem 1rem 0.5rem;
    }

    input {
        font-size: 1.1rem;
        padding: 1rem 3rem;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }
}