@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@300;400;500;600;700&display=swap');
@import url('https://cdn-uicons.flaticon.com/2.6.0/uicons-regular-rounded/css/uicons-regular-rounded.css');
@import url('https://cdn-uicons.flaticon.com/2.6.0/uicons-solid-rounded/css/uicons-solid-rounded.css');

* {
    box-sizing: border-box;
    font-family: 'Fredoka', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body,
html {
    margin: 0;
    padding: 0;
    background: linear-gradient(to bottom, #150610, #090319);
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
}

.container {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 40px;
    /* Increased spacing */
    padding-top: 10px;
}

.header h1 {
    font-size: 28px;
    font-weight: 500;
    margin: 0;
}

.header-icons {
    display: flex;
    gap: 15px;
}

.header-icon {
    font-size: 28px;
    color: #fff;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: auto;
    /* Pushes content up */
}

.category-card {
    /* background: #fff; Removed for progressive blur */
    border-radius: 40px;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #fff;
    /* Switch to white text for contrast on blurred bg */
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    /* Fallback/Base */
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Glass border */
}

/* Progressive Blur Background Layer */
.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--card-bg-img);
    background-size: cover;
    background-position: center;
    filter: blur(25px) saturate(180%);
    opacity: 0.8;
    z-index: 0;
    transform: scale(1.5);
    /* Hide blur edges */
}

/* Ensure content sits above the blur */
.category-card img,
.category-card i,
.category-card span {
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    /* Better readability */
}

.category-card:active {
    transform: scale(0.95);
}

.card-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: #fff;
}

.card-label {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.2;
}


/* Create Button */
.create-btn-container {
    display: flex;
    justify-content: center;
    padding-bottom: 40px;
    width: 100%;
    margin-top: 40px;
}

.bottom-actions {
    display: flex;
    justify-content: center;
    padding: 30px 0;
    margin-top: 20px;
}

.follow-pill {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 40px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    margin-right: 10px;
}

.follow-pill.following {
    background: #007AFF;
    /* Apple Blue */
    border-color: #007AFF;
    color: #fff;
}

.create-event-btn {
    background: #fff;
    color: #000;
    border: none;
    border-radius: 40px;
    padding: 18px 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

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

/* Create Page Form Elements (Preserved) */
.create-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

.next-btn {
    background: #fff;
    color: #000;
    border: none;
    padding: 8px 20px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.bg-uploader {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0 30px;
}

.bg-uploader-icon {
    font-size: 32px;
    color: #fff;
    margin-bottom: 10px;
}

.add-bg-btn {
    background: #fff;
    color: #000;
    border: none;
    border-radius: 40px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.tabs-scroll-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 20px;
}

.tabs-scroll-container::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    background: #fff;
    color: #000;
    border: none;
    border-radius: 40px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: transform 0.2s;
}

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

.info-card {
    background: #201d1d7e;
    border-radius: 40px;
    padding: 20px;
    margin-bottom: 20px;
    width: 100%;
}

.form-group {
    margin-bottom: 12px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-input {
    width: 100%;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 40px;
    padding: 15px 20px;
    font-size: 14px;
    font-weight: 500;
    outline: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-with-icon {
    position: relative;
    text-align: center;
    flex-direction: column;
    gap: 5px;
    height: auto;
    padding: 15px 10px;
}

.input-with-icon i {
    margin-right: 0;
    margin-bottom: 2px;
    font-size: 18px;
    vertical-align: middle;
}

.host-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
}

.host-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.host-name {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
}

.desc-btn {
    width: 100%;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 30px;
    padding: 15px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.photos-section {
    text-align: center;
    color: #fff;
}

.photos-icon {
    font-size: 24px;
    margin-bottom: 10px;
    display: block;
}

.photos-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
    line-height: 1.4;
    padding: 0 20px;
}

.share-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    position: relative;
}

.link-icon {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
}

.close-card-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    margin-left: auto;
}

/* Event Card Styles */
.event-card {
    position: relative;
    width: 100%;
    /* Aspect ratio portrait roughly 9:16 or similar, or just tall */
    aspect-ratio: 9/16;
    border-radius: 40px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.event-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.event-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2) 0%, rgba(20, 5, 20, 0) 40%, rgba(21, 6, 16, 1) 100%);
    z-index: 2;
}

.event-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Chips at top left/right or just top */
.chips-container {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 3;
    display: flex;
    gap: 10px;
}

.chip {
    background: #fff;
    color: #000;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.host-chip .chip-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #ddd;
}

.attendees-chip {
    padding-left: 8px;
    /* Less padding since avatars handle left space */
}

.chip-avatars-group {
    display: flex;
    align-items: center;
    margin-right: 5px;
}

.chip-avatar-small {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    margin-right: -8px;
    /* Overlap */
}

.chip-avatar-small:last-child {
    margin-right: 0;
}

.event-title {
    font-size: 32px;
    font-weight: 600;
    margin: 0 0 10px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.event-details {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 5px;
}

.event-location {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

/* Details Page Specifics */
.close-details-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #fff;
    font-size: 24px;
    z-index: 100;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: rgba(0, 0, 0, 0.3);
    /* Slight background for visibility */
    border-radius: 50%;
}

.dark-card {
    background: #2b1f24;
    /* Dark brownish */
    border-radius: 30px;
    padding: 20px;
    margin-bottom: 20px;
    color: #fff;
}

/* Calendar Actions */
.calendar-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 15px;
}

.calendar-btn {
    background: #fff;
    color: #000;
    padding: 12px 20px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s;
}

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

.calendar-btn.google {
    background: #4285F4;
    color: #fff;
}

.calendar-btn.ics {
    background: #000;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* RSVP Container */
.rsvp-container {
    background: #dcd6d9;
    /* Light grey/beige pill */
    border-radius: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
}

.rsvp-btn {
    background: none;
    border: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    color: #333;
    font-size: 10px;
    cursor: pointer;
    font-weight: 600;
}

.rsvp-btn i {
    font-size: 18px;
    margin-bottom: 2px;
}

.rsvp-count {
    font-size: 14px;
    margin-top: 4px;
    font-weight: 700;
}

/* RSVP Buttons Active States */
.rsvp-btn.active[data-status="going"] i,
.rsvp-btn.active[data-status="going"] span {
    color: #4CAF50;
    /* Green */
}

.rsvp-btn.active[data-status="not_going"] i,
.rsvp-btn.active[data-status="not_going"] span {
    color: #F44336;
    /* Red */
}

.rsvp-btn.active[data-status="maybe"] i,
.rsvp-btn.active[data-status="maybe"] span {
    color: #FF9800;
    /* Orange */
}

.rsvp-divider {
    width: 1px;
    height: 30px;
    background: #bbb;
}

/* Attendees */
.attendees-section {
    text-align: center;
}

.avatars-row {
    display: flex;
    justify-content: center;
    margin-top: 10px;
    margin-left: 15px;
    /* Offset for overlap */
}

.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ddd;
    border: 2px solid #2b1f24;
    margin-left: -15px;
    /* Overlap effect */
    background-size: cover;
}

/* Mock avatars backgrounds */
.avatar-circle:nth-child(1) {
    background-color: #fca;
}

.avatar-circle:nth-child(2) {
    background-color: #afc;
}

.avatar-circle:nth-child(3) {
    background-color: #caf;
}

.avatar-circle:nth-child(4) {
    background-color: #fac;
}

.avatar-circle:nth-child(5) {
    background-color: #cfa;
}

.avatar-more {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    color: #000;
    border: 2px solid #2b1f24;
    margin-left: -15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

/* Map */
.map-section {
    text-align: center;
}

.map-section h3 {
    margin: 5px 0 10px 0;
    font-size: 14px;
    color: #eee;
}

.map-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: #444;
}

/* Swipe Card Stack Styles (Default view) */
.events-list {
    position: relative;
    width: 100%;
    /* width: 100% is fine, but for stack effect we might want some constraints */
    height: 600px;
    /* Fixed height for stack area or use vh */
    max-height: 70vh;
    display: flex;
    justify-content: center;
    overflow: visible;
    /* Was hidden, changed to visible to prevent clipping/allow free movement */
}

/* Base state for cards in stack (not grid) */
.events-list:not(.grid-view) .event-card-link {
    position: absolute;
    top: 0;
    width: 100%;
    max-width: 400px;
    transition: transform 0.1s ease-out;
    /* Fast response for drag, overridden by JS for snap back */
}

/* Emojis */
.status-icon {
    position: absolute;
    top: 40px;
    font-size: 80px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
    pointer-events: none;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.thumbs-up {
    /* Right side for swipe right (thumbs up) */
    left: 40px;
    transform: rotate(-15deg);
    color: #4CAF50;
    /* Greenish */
}

.thumbs-down {
    /* Left side for swipe left (thumbs down) */
    right: 40px;
    transform: rotate(15deg);
    color: #F44336;
    /* Reddish */
}

/* Event Link Wrapper */
.event-card-link {
    text-decoration: none;
    display: block;
    color: inherit;
    transition: transform 0.2s;
}

.event-card-link:active {
    transform: scale(0.98);
}

/* Grid View Toggle Styles */
.events-list.grid-view {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    height: auto;
    overflow: visible;
    justify-content: initial;
    display: grid !important;
    /* Force grid display */
}

/* Ensure the anchor link (grid item) handles content correctly */
.events-list.grid-view .event-card-link {
    width: 100%;
    min-width: 0;
    position: static;
    max-width: none;
}

.events-list.grid-view .event-card {
    aspect-ratio: 9/12;
    margin-bottom: 0;
}

.events-list.grid-view .event-title {
    font-size: 16px;
    margin-bottom: 5px;
}

.events-list.grid-view .event-details,
.events-list.grid-view .event-location {
    font-size: 11px;
}

.events-list.grid-view .event-card-content {
    padding: 12px;
}

.events-list.grid-view .chips-container {
    top: 8px;
    left: 8px;
}

.events-list.grid-view .chip {
    padding: 4px 10px;
    font-size: 10px;
}

/* Hide emojis in grid view */
.events-list.grid-view .status-icon {
    display: none;
}

/* Attendees Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #1e1e1e;
    width: 90%;
    max-width: 400px;
    height: 80vh;
    border-radius: 20px;
    padding: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #fff;
}

.modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
}

.attendee-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #2a2a2a;
}

.attendee-item:last-child {
    border-bottom: none;
}

.attendee-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: #333;
    margin-right: 15px;
}

.attendee-info {
    display: flex;
    flex-direction: column;
}

.attendee-name {
    font-size: 14px;
    color: #fff;
    font-weight: 500;
}

.attendee-username {
    font-size: 12px;
    color: #888;
}

/* Better Search Box Styling */
.search-box-styled {
    width: 100%;
    background: #333;
    color: #fff;
    border-radius: 30px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* Left align */
    text-align: left;
    gap: 10px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.search-box-styled i {
    font-size: 18px;
    color: #fff;
    opacity: 0.7;
}

.search-box-styled input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
}

.search-box-styled input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Suggestions as distinct boxes */
.search-suggestions {
    background: #1e1e1e;
    /* Dark background for the dropdown itself */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-height: 250px;
    margin-top: 5px;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 9999;
    overflow-y: auto;
    padding: 5px;
}

.suggestion-item {
    background: #1e1e1e;
    color: #fff;
    padding: 12px 15px;
    margin-bottom: 8px;
    /* Spacing between items */
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
    text-align: left;
}

.suggestion-item:hover {
    background: #333;
    border-color: rgba(255, 255, 255, 0.3);
}

.suggestion-item:last-child {
    margin-bottom: 0;
}

/* Map Buttons */
.map-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border-radius: 15px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.2s;
}

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

.apple-map {
    background: #fff;
    color: #000;
}

.google-map {
    background: #fff;
    color: #000;
}

.map-btn i {
    font-size: 18px;
}

/* Story Viewer Styles */
.story-bars {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    z-index: 10;
}

.story-bar {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.story-bar-fill {
    height: 100%;
    background: #fff;
    width: 0%;
    transition: width 0.1s linear;
    /* Smooth fill */
}

/* Navigation Zones */
.story-nav-left,
.story-nav-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    z-index: 5;
    /* Above bg, below content/bars */
    /* background: rgba(255,0,0,0.1); Debugging */
}

.story-nav-left {
    left: 0;
}

.story-nav-right {
    right: 0;
}

/* Ensure overlay stays on top of nav to allow text selection? 
   Actually, nav zones are for tapping background. 
   Content (.event-card-content, chips) has z-index: 3. 
   Nav zones need to be z-index: 2 to capture clicks on image but not block text.
*/
.event-card-overlay {
    z-index: 2;
    /* Keep generic overlay */
    pointer-events: none;
    /* Let clicks pass through overlay to nav zones */
}

.story-nav-left,
.story-nav-right {
    z-index: 4;
    /* Above overlay (2) and content (3)? No, content needs interaction */
    /* Wait, if content covers nav zones, we can't click "prev" on the bottom text area.
       That's usually fine for stories. Tapping the top/middle works.
       Let's put nav zones at z-index 4, but make content z-index 5.
    */
}

.event-card-content,
.chips-container {
    z-index: 15;
    /* Higher than nav to allow selecting text/buttons */
    pointer-events: auto;
}

/* Apple Style List */
.apple-list-card {
    background: #fff;
    border-radius: 40px;
    padding: 0 20px;
    margin-bottom: 12px;
}

.apple-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    font-size: 16px;
    color: #000;
}

.apple-list-divider {
    height: 1px;
    background: #f0f0f0;
    width: 100%;
}

.list-label {
    font-weight: 500;
    color: #000;
}

.list-value {
    color: #888;
    display: flex;
    align-items: center;
}

/* Date Input Styling Override */
.apple-date-input {
    border: none;
    background: transparent;
    font-family: 'Fredoka', sans-serif;
    font-size: 16px;
    color: #007AFF;
    /* Apple Blue */
    text-align: right;
    outline: none;
    cursor: pointer;
    width: auto;
}

/* Make it look clickable/text-like */
.apple-date-input::-webkit-calendar-picker-indicator {
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: auto;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
}

.list-value {
    position: relative;
    /* For the picker indicator absolute positioning */
}

/* Toggle Switch */
.apple-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 30px;
}

.apple-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e9e9ea;
    /* Light grey when off */
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
    background-color: #34c759;
    /* Apple Green */
}

input:focus+.slider {
    box-shadow: 0 0 1px #34c759;
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.date-time-group {
    display: flex;
    gap: 10px;
}

.date-time-group .apple-date-input {
    background: #f5f5f7;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 14px;
    color: #000;
    width: 100px;
    /* specific width to keep them compact */
    text-align: center;
}

/* Enhanced Background Uploader */
.bg-uploader {
    position: relative;
    width: 100%;
    height: 200px;
    background-color: #f0f0f0;
    border-radius: 40px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background-size: cover;
    background-position: center;
}

.bg-uploader-icon {
    font-size: 40px;
    color: #ccc;
    z-index: 2;
}

.add-bg-btn {
    padding: 10px 20px;
    border-radius: 20px;
    border: none;
    background: #007AFF;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    z-index: 2;
}

/* Glassy button when image is present */
.bg-uploader.has-image .add-bg-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.bg-uploader.has-image {
    background-color: transparent;
    /* Ensure image shows */
    border: 1px solid rgba(0, 0, 0, 0.1);
    /* Subtle border definition */
}

/* 3D Category Images */
.card-icon-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
}

/* Friday AI Chat Modal */
.ai-modal {
    position: fixed;
    bottom: -100%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 450px;
    height: 70vh;
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 40px 40px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    z-index: 1000;
    transition: bottom 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}

.ai-modal.active {
    bottom: 0;
}

.ai-modal-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: #fff;
    font-size: 18px;
}

.ai-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 28px;
    cursor: pointer;
}

.ai-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Scrollbar for chat */
.ai-chat-body::-webkit-scrollbar {
    width: 4px;
}

.ai-chat-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.ai-msg {
    max-width: 85%;
    padding: 12px 18px;
    border-radius: 20px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.ai-msg.bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    color: #eee;
    border-bottom-left-radius: 5px;
}

.ai-msg.user {
    align-self: flex-end;
    background: #007AFF;
    color: #fff;
    border-bottom-right-radius: 5px;
}

.ai-input-area {
    padding: 15px 20px 30px;
    /* Extra bottom padding for iOS home bar */
    display: flex;
    gap: 10px;
}

.ai-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 12px 20px;
    color: #fff;
    font-size: 14px;
    outline: none;
}

.ai-input-area button {
    background: #007AFF;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
}

/* Loading dots */
.ai-dot-loading {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #aaa;
    animation: ai-dot-anim 1s infinite alternate;
}

@keyframes ai-dot-anim {
    from {
        opacity: 0.3;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1.2);
    }
}

.ai-pill {
    background: linear-gradient(135deg, rgba(88, 86, 214, 0.3), rgba(0, 122, 255, 0.3));
    border: 1px solid rgba(0, 122, 255, 0.4);
}

.ai-pill:active {
    transform: scale(0.95);
}
/* Visit Link Button Styling (Highlighted) */
@keyframes pulse-blue {
    0% { transform: scale(1); box-shadow: 0 4px 15px rgba(0, 122, 255, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 4px 25px rgba(0, 122, 255, 0.6); }
    100% { transform: scale(1); box-shadow: 0 4px 15px rgba(0, 122, 255, 0.4); }
}

.visit-link-btn {
    font-size: 18px !important;
    color: #fff !important;
    background: #007AFF !important;
    padding: 12px 30px !important;
    border-radius: 40px !important;
    display: inline-block !important;
    font-weight: 700 !important;
    margin-top: 15px !important;
    text-decoration: none !important;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.4) !important;
    animation: pulse-blue 2s infinite ease-in-out !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

.visit-link-btn:active {
    transform: scale(0.95) !important;
    opacity: 0.9 !important;
}

.visit-link-btn i {
    font-size: 14px !important;
    margin-left: 5px !important;
}
