/* Additional styles for better mobile experience */

/* Notification improvements */
#notificationContainer {
    pointer-events: none;
    /* Stack notifications from bottom to top */
    display: flex;
    flex-direction: column-reverse;
}

#notificationContainer > * {
    pointer-events: auto;
}

/* Better notification shadows on mobile */
@media (max-width: 768px) {
    #notificationContainer > div {
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
    }
}

/* Smooth animations - updated for bottom-up */
.notification-enter {
    animation: slideInUp 0.3s ease-out;
}

.notification-exit {
    animation: slideOutDown 0.3s ease-in;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

/* Better touch targets */
.tap-target {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    touch-action: manipulation;
}

/* Prevent text selection on buttons */
button, .tap-target {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Better scrollbar for breadcrumbs on mobile */
@media (max-width: 768px) {
    #breadcrumb::-webkit-scrollbar {
        display: none;
    }
    
    #breadcrumb {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}

/* Image modal improvements */
#imageModal img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
}

@media (max-width: 768px) {
    #imageModal img {
        max-width: 100vw;
        max-height: 100vh;
    }
}

/* Upload progress improvements */
#uploadProgress {
    backdrop-filter: blur(10px);
}

/* Better focus states for accessibility */
button:focus-visible,
input:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Smooth transitions for grid items */
#contentGrid > div {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#contentGrid > div:active {
    transform: scale(0.98);
}

/* Loading state for images */
#contentGrid img {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

#contentGrid img[src] {
    animation: none;
    background: none;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Improve modal backdrop */
#folderModal,
#imageModal {
    backdrop-filter: blur(4px);
}

/* Better button active states */
button:active:not(:disabled) {
    transform: scale(0.97);
}

/* Notification close button hover effect */
.notification-close-btn {
    transition: all 0.2s ease;
}

.notification-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Pull to refresh indicator */
#pullRefreshIndicator {
    animation: fadeInDown 0.3s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Better drag overlay */
#dropOverlay {
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Improve selection ring visibility */
.ring-2.ring-blue-500 {
    box-shadow: 0 0 0 2px #3b82f6, 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Better empty state */
#emptyState {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive font sizing */
@media (max-width: 375px) {
    html {
        font-size: 14px;
    }
}

/* Force white text for story username and time */
#storyUsername {
    color: white !important;
}

#storyTime {
    color: white !important;
}

/* Force white icons in story header */
#deleteCurrentStoryBtn i {
    color: white !important;
}

/* Force black icon for close button */
#closeStoryBtn i {
    color: #374151 !important; /* gray-700 */
}

/* Story header container should be white text */
#storyViewer .absolute.top-12 {
    color: white !important;
}

/* Better contrast for accessibility */
@media (prefers-contrast: high) {
    .bg-blue-50 {
        background-color: #dbeafe;
    }
    
    .text-gray-600 {
        color: #374151;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}

/* Mobile menu z-index fixes */
.z-60 {
    z-index: 60;
}

.z-70 {
    z-index: 70;
}

/* Mobile navbar improvements */
#mobileNavbar {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 50;
}

/* Back button transitions */
#backBtn {
    transition: all 0.3s ease;
}

#backBtn[style*="visibility: hidden"] {
    opacity: 0;
    transform: scale(0.8);
}

/* Mobile menu animations */
#mobileMenuPanel {
    box-shadow: -10px 0 25px rgba(0, 0, 0, 0.1);
    z-index: 70;
    width: 18rem; /* 288px - w-72 */
    max-width: 82vw;
}

/* Even more compact on very small screens */
@media (max-width: 375px) {
    #mobileMenuPanel {
        width: 15rem; /* 240px - w-60 */
        max-width: 78vw;
    }
}

/* Extra small screens */
@media (max-width: 320px) {
    #mobileMenuPanel {
        width: 13rem; /* 208px - w-52 */
        max-width: 75vw;
    }
}

#mobileMenuOverlay {
    z-index: 60;
}

.menu-item {
    transition: all 0.2s ease;
    padding: 0.875rem; /* Slightly increased for better balance */
    font-size: 1.125rem; /* Increased to 18px */
}

.menu-item i {
    font-size: 1.25rem; /* Increased icon size to 20px */
    width: 1.25rem; /* Increased icon width */
}

.menu-item:active {
    transform: scale(0.98);
    background-color: #f3f4f6;
}

/* Compact menu items on small screens */
@media (max-width: 375px) {
    .menu-item {
        padding: 0.75rem; /* Balanced for smaller screens */
        font-size: 1.125rem; /* Increased to 18px */
    }
    
    .menu-item i {
        width: 1.25rem;
        font-size: 1.125rem; /* Increased to 18px */
    }
}

/* Selection toggle animation */
#selectionToggle {
    transition: background-color 0.3s ease;
}

#selectionToggleKnob {
    transition: transform 0.3s ease;
}

/* Mobile navbar shadow */
@media (max-width: 768px) {
    #mobileNavbar {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
}

/* Hide desktop breadcrumb on mobile */
@media (max-width: 768px) {
    #breadcrumb {
        display: none;
    }
}

/* Adjust content spacing for mobile navbar */
@media (max-width: 768px) {
    .container {
        padding-top: 6rem !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* Mobile menu overlay animation */
#mobileMenuOverlay {
    animation: fadeIn 0.3s ease-out;
    z-index: 60 !important;
}

#mobileMenuOverlay.hidden {
    animation: fadeOut 0.3s ease-in;
}

#mobileMenuPanel {
    z-index: 70 !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Mobile search bar styling */
@media (max-width: 768px) {
    #mobileSearchInput {
        background-color: #f9fafb;
        border-color: #e5e7eb;
    }
    
    #mobileSearchInput:focus {
        background-color: white;
    }
    
    /* Add extra spacing for mobile search container */
    .mobile-search-container {
        margin-top: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

/* Folder menu button (3 dots) */
.folder-menu-btn {
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.folder-menu-btn:hover {
    transform: scale(1.05);
    background-color: rgba(229, 231, 235, 0.9);
}

.folder-menu-btn:active {
    transform: scale(0.95);
}

/* Folder dropdown menu */
.folder-dropdown-menu {
    animation: fadeInDown 0.2s ease-out;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(8px);
    background-color: rgba(255, 255, 255, 0.95);
}

.folder-dropdown-menu.hidden {
    animation: fadeOutUp 0.2s ease-in;
}

/* Folder action items in dropdown */
.folder-action-item {
    transition: all 0.15s ease;
}

.folder-action-item:hover {
    transform: translateX(2px);
}

.folder-action-item:active {
    transform: translateX(1px) scale(0.98);
}

/* Animations for dropdown */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOutUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Mobile optimizations for folder menu */
@media (max-width: 768px) {
    .folder-menu-btn {
        width: 2rem; /* 32px */
        height: 2rem; /* 32px */
        opacity: 0.8;
        background-color: rgba(243, 244, 246, 0.9);
    }
    
    /* Always show menu button on mobile */
    .group .folder-menu-btn {
        opacity: 0.8;
    }
    
    .group:hover .folder-menu-btn,
    .group:active .folder-menu-btn {
        opacity: 1;
    }
    
    .folder-dropdown-menu {
        min-width: 160px;
        right: -8px; /* Adjust position for mobile */
    }
    
    .folder-action-item {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}
/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Image Modal Improvements */
#imageModal {
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

#imageModal.hidden {
    animation: fadeOut 0.2s ease-in;
}

#modalImage {
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
    max-width: 95vw;
    max-height: 95vh;
}

#modalImage:hover {
    transform: scale(1.02);
}

#closeImageModal {
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#closeImageModal:hover {
    background-color: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

#closeImageModal:active {
    transform: scale(0.95);
}

/* Loading state for modal image */
#modalImage[alt*="Cargando"] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    min-width: 200px;
    min-height: 200px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Photo menu button improvements */
.photo-menu-btn {
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.photo-menu-btn:hover {
    transform: scale(1.05);
    background-color: rgba(0, 0, 0, 0.8) !important;
}

.photo-menu-btn:active {
    transform: scale(0.95);
}

/* Photo dropdown menu */
.photo-dropdown-menu {
    backdrop-filter: blur(8px);
    animation: slideInDown 0.2s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive modal improvements */
@media (max-width: 640px) {
    #modalImage {
        max-width: 98vw;
        max-height: 90vh;
        border-radius: 4px;
    }
    
    #closeImageModal {
        width: 36px;
        height: 36px;
        top: 8px;
        right: 8px;
    }
}

/* Stories System Styles */
#storiesContainer {
    background: white;
    color: #374151; /* gray-700 */
    margin-bottom: 2rem; /* Increased from 1.5rem to 2rem */
    border: 1px solid #e5e7eb; /* gray-200 */
}

#storiesContainer h3 {
    color: #374151; /* gray-700 */
}

#storiesGrid {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

#storiesGrid::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Story circles with gradient border for unviewed */
.story-circle-unviewed {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    padding: 2px;
    border-radius: 50%;
}

.story-circle-viewed {
    border: 2px solid #e5e7eb;
    border-radius: 50%;
}

/* Story viewer animations */
#storyViewer {
    animation: fadeIn 0.3s ease-out;
    background-color: white !important;
    background: white !important;
    backdrop-filter: none !important;
}

#storyViewer.hidden {
    animation: fadeOut 0.3s ease-in;
}

/* Force white background for story viewer container */
#storyViewer .relative {
    background-color: white !important;
    background: white !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* Story progress bars */
.story-progress-active {
    transition: width linear;
}

/* Story image animations and full screen 9:16 format */
#storyImage,
.story-image-916 {
    animation: storyImageEnter 0.5s ease-out;
    /* Full screen display - no white space */
    width: 100vw;
    height: 100vh;
    object-fit: cover; /* Cover entire screen */
    object-position: center;
    /* Prevent any rotation or transformation */
    transform: none !important;
    image-orientation: from-image;
}

/* Remove responsive adjustments - always full screen */
@media (max-width: 768px) {
    #storyImage,
    .story-image-916 {
        /* Full screen on mobile too */
        width: 100vw;
        height: 100vh;
        object-fit: cover;
    }
}

/* Remove old orientation-specific styles */
#storyImage[data-orientation="portrait"],
#storyImage[data-orientation="landscape"] {
    /* Full screen for all stories */
    width: 100vw;
    height: 100vh;
    object-fit: cover;
}

/* Force white background for all story viewer elements */
#storyContent {
    background-color: white !important;
    background: white !important;
}

#storyViewer * {
    color: inherit;
}

@keyframes storyImageEnter {
    from {
        opacity: 0;
        transform: scale(1.1);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Mobile optimizations for stories */
@media (max-width: 768px) {
    #storiesContainer {
        margin: 0 -12px 2rem -12px; /* Increased bottom margin from 0 to 2rem */
        border-radius: 0;
        padding: 16px 12px;
    }
    
    #storiesGrid {
        padding-left: 4px;
        padding-right: 4px;
    }
    
    #storyViewer {
        padding: 0;
    }
    
    #storyViewer .relative {
        max-width: 100%;
    }
    
    /* Larger touch targets on mobile */
    #prevStoryArea,
    #nextStoryArea {
        min-width: 80px;
    }
}

/* Hover effects for desktop */
@media (min-width: 769px) {
    .story-element:hover {
        transform: scale(1.05);
        transition: transform 0.2s ease;
    }
    
    #addStoryBtn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }
}

/* Story notification dot */
.story-notification-dot {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Loading animation for story upload */
.story-uploading {
    position: relative;
    overflow: hidden;
}

.story-uploading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Smooth scrolling for stories grid */
.smooth-scroll {
    scroll-behavior: smooth;
}

/* Better focus states for accessibility */
#addStoryBtn:focus,
.story-element:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Photo Preview Modal Styles */
#photoPreviewModal {
    animation: fadeIn 0.3s ease-out;
}

#previewImage {
    animation: zoomIn 0.4s ease-out;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Preview control buttons */
#confirmPhotoBtn,
#cancelPhotoBtn {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

#confirmPhotoBtn:hover {
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

#cancelPhotoBtn:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* Preview instructions */
#photoPreviewModal .bg-black.bg-opacity-50 {
    backdrop-filter: blur(8px);
    animation: slideUpFade 0.5s ease-out 0.2s both;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Timer Button Styles */
#timerBtn {
    position: relative;
    transition: all 0.2s ease;
}

#timerText {
    font-size: 10px;
    font-weight: bold;
    line-height: 1;
}

#timerBtn:hover {
    background-color: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

/* Timer Countdown Overlay */
#timerCountdown {
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease-out;
}

#countdownNumber {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

#cancelTimerBtn {
    animation: slideUpFade 0.5s ease-out 0.3s both;
}

/* Mobile optimizations for timer */
@media (max-width: 768px) {
    #countdownNumber {
        font-size: 6rem;
    }
    
    #timerCountdown .text-xl {
        font-size: 1rem;
    }
    
    #cancelTimerBtn {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
}
@media (max-width: 768px) {
    #photoPreviewModal .absolute.bottom-8 {
        bottom: 2rem;
    }
    
    #photoPreviewModal .absolute.bottom-28 {
        bottom: 7rem;
    }
    
    #confirmPhotoBtn,
    #cancelPhotoBtn {
        width: 4rem;
        height: 4rem;
    }
    
    #photoPreviewModal .gap-6 {
        gap: 2rem;
    }
}
#usernameModal,
#changeUsernameModal {
    animation: modalFadeIn 0.3s ease-out;
}

#usernameModal .bg-white,
#changeUsernameModal .bg-white {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Username input focus effects */
#usernameInput:focus,
#newUsernameInput:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

/* Button hover effects */
#saveUsernameBtn:not(:disabled):hover,
#saveChangeUsernameBtn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#cancelUsernameBtn:hover,
#cancelChangeUsernameBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Character progress animation */
#charProgress,
#newCharProgress {
    transition: all 0.3s ease;
}

/* Mobile optimizations for username modal */
@media (max-width: 640px) {
    #usernameModal .max-w-md,
    #changeUsernameModal .max-w-md {
        max-width: 95vw;
        margin: 0 8px;
    }
    
    #usernameModal .p-6,
    #changeUsernameModal .p-6 {
        padding: 1rem;
    }
    
    #usernameModal .px-6,
    #changeUsernameModal .px-6 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Camera Modal Styles */
#cameraModal {
    animation: fadeIn 0.3s ease-out;
}

#cameraPreview {
    transform: scaleX(-1); /* Mirror effect for front camera */
    object-fit: cover;
    width: 100%;
    height: 100%;
    /* Remove forced aspect ratio to prevent zoom */
}

/* iOS-specific camera optimizations */
@media screen and (-webkit-min-device-pixel-ratio: 2) {
    #cameraPreview {
        /* Better object-fit for high-DPI iOS devices */
        object-fit: cover;
        object-position: center;
        /* Prevent zoom issues on iOS */
        -webkit-transform: scaleX(-1);
        transform: scaleX(-1);
    }
}

#captureBtn {
    transition: transform 0.1s ease;
}

#captureBtn:active {
    transform: scale(0.9);
}

#switchCameraBtn,
#galleryFromCameraBtn,
#closeCameraBtn {
    transition: all 0.2s ease;
}

#switchCameraBtn:hover,
#galleryFromCameraBtn:hover,
#closeCameraBtn:hover {
    background-color: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

#switchCameraBtn:active,
#galleryFromCameraBtn:active,
#closeCameraBtn:active {
    transform: scale(0.95);
}

/* Camera capture animation */
@keyframes cameraFlash {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.camera-flash {
    position: fixed;
    inset: 0;
    background: white;
    pointer-events: none;
    animation: cameraFlash 0.3s ease-out;
}

/* Story add button hover effect */
.story-add-button:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

/* Mobile camera optimizations */
@media (max-width: 768px) {
    #cameraModal .relative {
        max-width: 100%;
    }
    
    #cameraPreview {
        object-fit: cover;
        width: 100%;
        height: 100%;
        transform: scaleX(-1); /* Mirror effect for front camera */
        /* iOS-specific fixes */
        -webkit-transform: scaleX(-1);
        -moz-transform: scaleX(-1);
        -ms-transform: scaleX(-1);
        -o-transform: scaleX(-1);
        /* Prevent zoom on iOS Safari */
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        /* Remove forced aspect ratio on mobile */
    }
    
    #captureBtn {
        width: 72px;
        height: 72px;
    }
    
    #captureBtn > div {
        width: 56px;
        height: 56px;
    }
    
    /* iOS-specific camera modal fixes */
    #cameraModal {
        /* Prevent viewport zoom on iOS */
        -webkit-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
        touch-action: manipulation;
    }
}
/* Force hide stories when not in home */
body.in-folder #storiesContainer {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure stories are visible in home */
body.in-home #storiesContainer {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}
/* Force hide stories when in folder */
body.in-folder #storiesContainer {
    display: none !important;
    visibility: hidden !important;
}

/* Ensure stories are visible when in home */
body.in-home #storiesContainer {
    visibility: visible;
}

/* Stories delete button styles */
.delete-story-btn {
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.delete-story-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Delete button in story viewer */
#deleteCurrentStoryBtn {
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#deleteCurrentStoryBtn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Better hover effect for story elements */
.story-element:hover .delete-story-btn {
    opacity: 1 !important;
}

/* Mobile touch improvements for delete button */
@media (max-width: 768px) {
    .delete-story-btn {
        opacity: 0.7 !important; /* Always slightly visible on mobile */
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .delete-story-btn:active {
        transform: scale(0.95);
    }
    
    #deleteCurrentStoryBtn {
        width: 36px;
        height: 36px;
    }
}

/* Story container improvements */
#storiesContainer {
    transition: all 0.3s ease-in-out;
}

/* Better story grid scrolling */
#storiesGrid {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

#storiesGrid::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}