/* ============================================
   MODERN MOBILE APP STYLE - PROFESSIONAL REDESIGN
   Instagram / TikTok / Social Media App Style
   ============================================ */

:root {
    --primary: #c50025;
    --primary-dark: #a3001e;
    --primary-light: #ff0036;
    --accent: #ff385c;
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-tertiary: #f5f5f5;
    --bg-dark: #000000;
    --bg-dark-card: #121212;
    --bg-dark-secondary: #1a1a1a;
    --text-primary: #000000;
    --text-secondary: #737373;
    --text-tertiary: #a8a8a8;
    --border: #efefef;
    --border-dark: #262626;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-heavy: rgba(0, 0, 0, 0.2);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --nav-height: 60px;
    --bottom-nav-height: 56px;
    --content-max-width: 640px;
    --grid-gap: 2px;
}

.dark {
    --bg-primary: #000000;
    --bg-secondary: #121212;
    --bg-tertiary: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a8a8a8;
    --text-tertiary: #737373;
    --border: #262626;
}

/* ============================================
   MOBILE APP LAYOUT STRUCTURE
   ============================================ */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom);
}

.app-content {
    flex: 1;
    padding-top: var(--nav-height);
    padding-bottom: var(--bottom-nav-height);
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
}

@media (min-width: 768px) {
    .app-content {
        padding-bottom: 0;
        max-width: var(--content-max-width);
    }
}

/* ============================================
   TOP NAVIGATION - MOBILE APP STYLE
   ============================================ */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95);
}

.dark .app-header {
    background: rgba(0, 0, 0, 0.95);
}

.app-header-logo {
    height: 32px;
    display: flex;
    align-items: center;
}

.app-header-logo img {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.app-header-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

.header-icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s ease;
    position: relative;
}

.header-icon-btn:active {
    transform: scale(0.9);
    background: var(--bg-tertiary);
}

.header-icon-btn svg {
    width: 24px;
    height: 24px;
}

.badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
}

/* ============================================
   BOTTOM NAVIGATION - MOBILE APP STYLE
   ============================================ */
.app-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 1000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95);
}

.dark .app-bottom-nav {
    background: rgba(0, 0, 0, 0.95);
}

@media (min-width: 768px) {
    .app-bottom-nav {
        display: none;
    }
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    border-radius: var(--radius-sm);
    position: relative;
}

.nav-item:active {
    transform: scale(0.95);
}

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

.nav-item svg {
    width: 26px;
    height: 26px;
    transition: all 0.2s ease;
}

.nav-item.active svg {
    transform: scale(1.1);
}

.nav-item span {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* ============================================
   SEARCH BAR - MODERN APP STYLE
   ============================================ */
.app-search-container {
    padding: 12px 16px;
    background: var(--bg-primary);
    position: sticky;
    top: var(--nav-height);
    z-index: 100;
}

.app-search-wrapper {
    position: relative;
    width: 100%;
}

.app-search-input {
    width: 100%;
    height: 44px;
    padding: 0 44px 0 44px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 22px;
    font-size: 15px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.app-search-input:focus {
    outline: none;
    background: var(--bg-secondary);
    box-shadow: 0 0 0 2px var(--primary);
}

.app-search-input::placeholder {
    color: var(--text-tertiary);
}

.app-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}

.app-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--text-tertiary);
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
}

.app-search-input:not(:placeholder-shown) ~ .app-search-clear {
    opacity: 1;
}

/* ============================================
   STORY/HIGHLIGHTS SLIDER - INSTAGRAM STYLE
   ============================================ */
.stories-container {
    background: var(--bg-primary);
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.stories-container::-webkit-scrollbar {
    display: none;
}

.stories-wrapper {
    display: flex;
    gap: 12px;
    padding: 0 16px;
}

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 72px;
    text-decoration: none;
}

.story-avatar {
    position: relative;
    width: 64px;
    height: 64px;
}

.story-ring {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary), var(--accent));
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-ring-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--bg-primary);
    padding: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.story-name {
    font-size: 12px;
    color: var(--text-primary);
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

/* ============================================
   FEED CARDS - MODERN SOCIAL MEDIA STYLE
   ============================================ */
.feed-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.feed-card {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

.feed-card-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.feed-card-user {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.feed-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

.feed-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.feed-username {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.verified-badge {
    width: 14px;
    height: 14px;
    color: var(--primary);
}

.feed-location {
    font-size: 12px;
    color: var(--text-secondary);
}

.feed-card-image {
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-tertiary);
    position: relative;
    overflow: hidden;
}

.feed-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feed-card-actions {
    padding: 12px 16px;
    display: flex;
    gap: 16px;
    align-items: center;
}

.feed-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: var(--text-primary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.feed-action-btn:active {
    transform: scale(0.9);
}

.feed-action-btn svg {
    width: 24px;
    height: 24px;
}

.feed-action-btn.liked svg {
    color: var(--primary);
    fill: var(--primary);
}

.feed-action-count {
    font-size: 14px;
    font-weight: 600;
}

.feed-card-stats {
    padding: 0 16px 4px;
}

.feed-likes {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.feed-card-caption {
    padding: 0 16px 12px;
}

.feed-caption-text {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
}

.feed-username-inline {
    font-weight: 600;
    margin-right: 4px;
}

/* ============================================
   GRID LAYOUT - INSTAGRAM PROFILE STYLE
   ============================================ */
.profile-grid-container {
    background: var(--bg-primary);
}

.profile-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.profile-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: all 0.2s ease;
}

.profile-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}

.profile-tab svg {
    width: 24px;
    height: 24px;
}

.instagram-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--grid-gap);
    background: var(--bg-secondary);
}

.grid-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-tertiary);
    cursor: pointer;
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.grid-item:active img {
    transform: scale(1.05);
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

@media (hover: hover) {
    .grid-item:hover .grid-overlay {
        opacity: 1;
    }
}

.grid-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.grid-stat svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   PROFILE HEADER - MODERN STYLE
   ============================================ */
.profile-header-section {
    background: var(--bg-primary);
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
}

.profile-info-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}

.profile-avatar-large {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border);
}

.profile-stats-row {
    flex: 1;
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.profile-stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-stat-number {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.profile-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.profile-bio {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.profile-action-btn {
    width: 100%;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-action-btn.primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

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

/* ============================================
   REELS/TIKTOK STYLE VIDEO FEED
   ============================================ */

/* Reels Container */
.reels-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-dark);
    z-index: 9999;
}

/* Hide scrollbar but keep functionality */
.reels-container::-webkit-scrollbar {
    display: none;
}

.reels-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Individual Reel Item */
.reel-item {
    position: relative;
    width: 100%;
    height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
}

/* Video Element */
.reel-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--bg-dark);
}

/* Video Thumbnail/Poster */
.reel-thumbnail {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 5;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.reel-item.playing .reel-thumbnail {
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

/* Reel Overlay UI */
.reel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    pointer-events: none;
    background: linear-gradient(to bottom,
        rgba(0,0,0,0.3) 0%,
        rgba(0,0,0,0) 20%,
        rgba(0,0,0,0) 60%,
        rgba(0,0,0,0.6) 100%
    );
}

/* Play Icon on Thumbnail */
.reel-thumbnail-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 6;
    pointer-events: all;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reel-item.playing .reel-thumbnail-play {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.3);
    pointer-events: none;
    z-index: -1;
}

.reel-thumbnail-play svg {
    width: 40px;
    height: 40px;
    color: white;
    margin-left: 4px;
}

/* Play/Pause Button */
.reel-play-pause {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: all;
    cursor: pointer;
}

.reel-item.paused .reel-play-pause {
    opacity: 1;
}

.reel-play-pause svg {
    width: 32px;
    height: 32px;
    color: white;
}

/* Bottom Info Section */
.reel-info {
    position: absolute;
    bottom: 20px;
    left: 12px;
    right: 70px;
    z-index: 11;
    pointer-events: all;
}

.reel-author {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.reel-author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid white;
    object-fit: cover;
}

.reel-author-name {
    font-size: 14px;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.reel-follow-btn {
    padding: 4px 12px;
    background: transparent;
    border: 1px solid white;
    border-radius: 4px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reel-follow-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.2);
}

.reel-title {
    font-size: 14px;
    line-height: 1.4;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    max-height: 60px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Right Side Actions */
.reel-actions {
    position: absolute;
    right: 12px;
    bottom: 80px;
    z-index: 11;
    display: flex;
    flex-direction: column;
    gap: 20px;
    pointer-events: all;
}

.reel-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.reel-action-btn:active {
    transform: scale(0.9);
}

.reel-action-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.reel-action-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.reel-action-icon.liked {
    background: rgba(197, 0, 37, 0.9);
}

.reel-action-icon.liked svg {
    fill: white;
}

.reel-action-count {
    font-size: 12px;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* Video Grid View (for listing page) */
.video-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--grid-gap);
    padding: var(--grid-gap);
}

@media (min-width: 640px) {
    .video-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .video-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.video-grid-item {
    position: relative;
    aspect-ratio: 9/16;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    background: var(--bg-secondary);
}

.video-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-grid-item:active img {
    transform: scale(0.95);
}

.video-grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom,
        rgba(0,0,0,0) 0%,
        rgba(0,0,0,0) 50%,
        rgba(0,0,0,0.7) 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8px;
}

.video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-play-icon svg {
    width: 32px;
    height: 32px;
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.video-grid-info {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
}

.video-grid-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.video-grid-stats svg {
    width: 16px;
    height: 16px;
}

/* Loading Spinner */
.reel-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Progress Bar */
.reel-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    z-index: 12;
}

.reel-progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.1s linear;
}

/* Desktop Optimizations */
@media (min-width: 1024px) {
    .reels-container {
        max-width: 500px;
        margin: 0 auto;
        height: calc(100vh - var(--nav-height));
    }

    .reel-item {
        height: calc(100vh - var(--nav-height));
        border-radius: 12px;
        overflow: hidden;
        margin-bottom: 20px;
        scroll-snap-align: center;
    }

    .reel-video {
        border-radius: 12px;
    }
}

/* Touch Feedback */
.reel-item:active {
    filter: brightness(0.95);
}

/* Mute/Unmute Button */
.reel-mute-btn {
    position: absolute;
    top: 20px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 11;
    pointer-events: all;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reel-mute-btn:active {
    transform: scale(0.9);
}

.reel-mute-btn svg {
    width: 20px;
    height: 20px;
    color: white;
}

/* Back Button */
.reel-back-btn {
    position: absolute;
    top: 20px;
    left: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 11;
    pointer-events: all;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reel-back-btn:active {
    transform: scale(0.9);
}

.reel-back-btn svg {
    width: 24px;
    height: 24px;
    color: white;
}

/* ============================================
   MODERN STATS CARDS
   ============================================ */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    padding: 16px;
    background: var(--bg-secondary);
}

.stat-card-modern {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 20px 16px;
    text-align: center;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.stat-card-modern:active {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow);
}

.stat-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-label-modern {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* ============================================
   SECTION HEADERS
   ============================================ */
.section-header-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-primary);
}

.section-title-modern {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.section-link-modern {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.section-link-modern:active {
    opacity: 0.7;
}

/* ============================================
   FLOATING ACTION BUTTON
   ============================================ */
.fab {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 16px);
    right: 16px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 16px var(--shadow-heavy);
    cursor: pointer;
    z-index: 999;
    transition: all 0.3s ease;
}

.fab:active {
    transform: scale(0.9);
}

@media (min-width: 768px) {
    .fab {
        bottom: 24px;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.animate-slide-up {
    animation: slideUp 0.4s ease-out;
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease-out;
}

/* Stagger animations */
.stagger-item {
    opacity: 0;
    animation: slideUp 0.4s ease-out forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.1s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.2s; }
.stagger-item:nth-child(5) { animation-delay: 0.25s; }
.stagger-item:nth-child(6) { animation-delay: 0.3s; }
.stagger-item:nth-child(n+7) { animation-delay: 0.35s; }

/* ============================================
   LOADING SKELETONS
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-circle {
    border-radius: 50%;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.pull-to-refresh {
    overscroll-behavior-y: contain;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.safe-bottom {
    padding-bottom: env(safe-area-inset-bottom);
}

.safe-top {
    padding-top: env(safe-area-inset-top);
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */
@media (min-width: 768px) {
    :root {
        --nav-height: 64px;
        --grid-gap: 4px;
    }

    .instagram-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .app-content {
        padding-left: 16px;
        padding-right: 16px;
    }
}

@media (min-width: 1024px) {
    .instagram-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}
