@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css');

@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap");

/* Instagram Story Viewer Download Styles */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        :root {
            /* Professional Color Palette */
            --bg-gradient-1: #f8f9fa;
            --bg-gradient-2: #e9ecef;
            --bg-gradient-3: #dee2e6;
            --surface-dark: #ffffff;
            --surface-light: #ffffff;
            --glass-bg-dark: rgba(255, 255, 255, 0.95);

            /* Professional Colors */
            --primary: #0d6efd;
            --secondary: #6c757d;
            --accent: #198754;
            --accent-secondary: #0dcaf0;
            --success: #198754;
            --warning: #ffc107;
            --error: #dc3545;

            /* Text Colors */
            --text-primary-light: #212529;
            --text-secondary-light: #495057;
            --text-muted-light: #6c757d;

            /* Shadows */
            --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
            --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.08);
            --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.1);
            --shadow-glow-primary: 0 0 15px rgba(13, 110, 253, 0.3);
            --shadow-glow-accent: 0 0 15px rgba(25, 135, 84, 0.3);

            /* Misc */
            --border-radius-sm: 8px;
            --border-radius-md: 12px;
            --border-radius-lg: 16px;
            --border-line-light: 1px solid rgba(0, 0, 0, 0.1);
            --transition-normal: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
            --backdrop-blur: blur(10px);
        }

        /* Wrapper to avoid conflicts */
     
      .instagram-story-viewer-wrapper {
	font-family: 'Outfit', sans-serif;
	background: linear-gradient(135deg, #f99a9a, #af79e6, #dd7bc4);
	color: var(--text-primary-light);
	line-height: 1.5;
	min-height: 100vh;
	overflow-x: hidden;
	overflow-y: auto;
	margin:0px auto;
	padding:20px;
}

        .hidden {
            display: none !important;
        }

        /* Layout */
        .app-container {
            display: flex;
            min-height: 100vh;
            max-width: 1400px;
            margin: 40px auto;
            position: relative;
            overflow: hidden;
            border-radius: 8px;
            height: 100vh;
        }

        .app-container::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle at center, transparent 30%, rgba(13, 110, 253, 0.03) 60%, rgba(25, 135, 84, 0.05) 100%);
            animation: rotate 60s linear infinite;
            z-index: -1;
        }

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

            to {
                transform: rotate(360deg);
            }
        }

        /* Side Panel */
        .side-panel {
            width: 420px;
            background: var(--glass-bg-dark);
            backdrop-filter: var(--backdrop-blur);
            -webkit-backdrop-filter: var(--backdrop-blur);
            border-right: var(--border-line-light);
            display: flex;
            flex-direction: column;
            z-index: 10;
            position: relative;
            overflow: hidden;
            max-height: 100vh;
        }

        .side-panel::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 100px;
            background: linear-gradient(to bottom, rgba(13, 110, 253, 0.1), transparent);
            z-index: -1;
        }

        .side-panel::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 100px;
            background: linear-gradient(to top, rgba(25, 135, 84, 0.1), transparent);
            z-index: -1;
        }

        .app-header {
            padding: 0.75rem;
            border-bottom: var(--border-line-light);
            position: relative;
            overflow: hidden;
            flex-shrink: 0;
        }

        .app-header::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle at top left, rgba(13, 110, 253, 0.1), transparent 70%);
            z-index: -1;
        }

        .app-logo {
            display: flex;
            align-items: center;
            gap: 1rem;
            margin-bottom: 1.5rem;
            position: relative;
        }

        .logo-icon {
            width: 50px;
            height: 50px;
            background: linear-gradient(45deg, var(--primary), var(--accent-secondary), var(--accent));
            border-radius: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: bold;
            font-size: 20px;
            box-shadow: 0 8px 20px rgba(13, 110, 253, 0.2);
            position: relative;
            overflow: hidden;
            animation: pulse 3s infinite;
        }

        @keyframes pulse {
            0% {
                box-shadow: 0 8px 20px rgba(13, 110, 253, 0.2);
            }

            50% {
                box-shadow: 0 8px 25px rgba(25, 135, 84, 0.3);
            }

            100% {
                box-shadow: 0 8px 20px rgba(13, 110, 253, 0.2);
            }
        }

        .logo-icon::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle at center, rgba(255, 255, 255, 0.3), transparent 70%);
            animation: rotate 10s linear infinite;
        }

        .logo-icon::after {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 50%);
        }

        .app-title {
            font-size: 1.6rem;
            font-weight: 800;
            background: linear-gradient(to right, var(--primary), var(--accent-secondary), var(--accent));
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            letter-spacing: -0.5px;
            position: relative;
        }

        /* Search Container */
        .search-container {
            padding: 2rem;
            position: relative;
            flex-shrink: 0;
        }

        .search-container::before {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            width: 100px;
            height: 100px;
            background: radial-gradient(circle at top right, rgba(25, 135, 84, 0.1), transparent 70%);
            z-index: -1;
        }

        #search-form {
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
        }

        .form-label {
            font-size: 1rem;
            font-weight: 600;
            color: var(--text-secondary-light);
            margin-bottom: 0.5rem;
            letter-spacing: 0.5px;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .form-label svg {
            width: 18px;
            height: 18px;
            stroke: var(--primary);
        }

        .input-group {
            position: relative;
        }

        #username-input {
            width: 100%;
            padding: 1.2rem 1.5rem;
            background: rgba(255, 255, 255, 0.7);
            border: 1px solid rgba(0, 0, 0, 0.1);
            border-radius: var(--border-radius-lg);
            color: var(--text-primary-light);
            font-family: 'Outfit', sans-serif;
            font-size: 1rem;
            transition: var(--transition-normal);
        }

        #username-input:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.15);
            background: rgba(255, 255, 255, 0.9);
        }

        #username-input::placeholder {
            color: var(--text-muted-light);
        }

        .input-icon {
            position: absolute;
            right: 1.5rem;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-muted-light);
        }

        #search-btn {
            background: linear-gradient(45deg, var(--primary), var(--accent-secondary), var(--accent));
            color: white;
            border: none;
            border-radius: var(--border-radius-lg);
            padding: 1.2rem 1.5rem;
            font-family: 'Outfit', sans-serif;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 0.8rem;
            transition: var(--transition-normal);
            box-shadow: 0 8px 20px rgba(13, 110, 253, 0.2);
            position: relative;
            overflow: hidden;
            letter-spacing: 0.5px;
        }

        #search-btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transition: var(--transition-normal);
        }

        #search-btn:hover {
            transform: translateY(-5px);
            box-shadow: 0 12px 25px rgba(13, 110, 253, 0.3);
        }

        #search-btn:hover::before {
            left: 100%;
            transition: 0.7s;
        }

        #search-btn:active {
            transform: translateY(-2px);
            box-shadow: 0 8px 15px rgba(13, 110, 253, 0.2);
        }

        /* Profile Section */
        .profile-section {
            flex: 1;
            overflow-y: auto;
            padding: 2rem;
            position: relative;
            max-height: calc(100vh - 200px);
        }

        .profile-section::-webkit-scrollbar {
            width: 6px;
        }

        .profile-section::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.05);
            border-radius: 10px;
        }

        .profile-section::-webkit-scrollbar-thumb {
            background: linear-gradient(to bottom, var(--primary), var(--accent));
            border-radius: 10px;
        }

        /* Loading State */
        .loading-state {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 4rem 0;
        }

        .spinner {
            width: 60px;
            height: 60px;
            position: relative;
            margin-bottom: 2rem;
        }

        .spinner::before,
        .spinner::after {
            content: '';
            position: absolute;
            border-radius: 50%;
        }

        .spinner::before {
            width: 100%;
            height: 100%;
            background-image: linear-gradient(var(--primary), var(--accent-secondary), var(--accent));
            animation: spin 1s linear infinite;
        }

        .spinner::after {
            top: 10%;
            left: 10%;
            right: 10%;
            bottom: 10%;
            background: var(--surface-dark);
            border-radius: 50%;
        }

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

        .loading-text {
            color: var(--text-secondary-light);
            font-size: 1.1rem;
            font-weight: 500;
            background: linear-gradient(to right, var(--primary), var(--accent));
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            animation: shimmer 2s infinite;
            background-size: 200% 100%;
        }

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

            100% {
                background-position: 100% 0;
            }
        }

        /* Profile Data */
        .profile-data {
            display: flex;
            flex-direction: column;
            gap: 2rem;
        }

        .profile-header {
            display: flex;
            align-items: center;
            gap: 1.5rem;
            padding: 1.8rem;
            background: rgba(255, 255, 255, 0.7);
            border-radius: var(--border-radius-lg);
            box-shadow: var(--shadow-md);
            transition: var(--transition-normal);
            border: 1px solid rgba(0, 0, 0, 0.1);
            position: relative;
            overflow: hidden;
        }

        .profile-header:hover {
            transform: translateY(-5px) scale(1.02);
            box-shadow: var(--shadow-lg), var(--shadow-glow-primary);
        }

        .profile-header::before {
            content: '';
            position: absolute;
            top: -100%;
            left: -100%;
            width: 300%;
            height: 300%;
            background: radial-gradient(circle at center, rgba(13, 110, 253, 0.1), transparent 70%);
            animation: rotate 20s linear infinite;
            z-index: -1;
        }

        .profile-image-container {
            position: relative;
        }

        .profile-image {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            object-fit: cover;
            border: 3px solid transparent;
            background:
                linear-gradient(var(--surface-dark), var(--surface-dark)) padding-box,
                linear-gradient(45deg, var(--primary), var(--accent-secondary), var(--accent)) border-box;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
            transition: var(--transition-normal);
            animation: float 6s ease-in-out infinite;
        }

        @keyframes float {

            0%,
            100% {
                transform: translateY(0);
            }

            50% {
                transform: translateY(-8px);
            }
        }

        .profile-image:hover {
            transform: scale(1.1);
            box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15), var(--shadow-glow-primary);
        }

        .profile-image-aura {
            position: absolute;
            top: -10px;
            left: -10px;
            right: -10px;
            bottom: -10px;
            border-radius: 50%;
            background: linear-gradient(45deg, var(--primary), var(--accent-secondary), var(--accent));
            opacity: 0.15;
            filter: blur(10px);
            z-index: -1;
            animation: pulse-aura 3s ease-in-out infinite alternate;
        }

        @keyframes pulse-aura {
            0% {
                opacity: 0.1;
                transform: scale(1);
            }

            100% {
                opacity: 0.2;
                transform: scale(1.1);
            }
        }

        .verified-indicator {
            position: absolute;
            bottom: 0;
            right: 0;
            width: 24px;
            height: 24px;
            background: linear-gradient(to right, var(--accent-secondary), var(--primary));
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 12px;
            border: 2px solid var(--surface-dark);
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        }

        .profile-info {
            flex: 1;
        }

        .profile-username {
            font-size: 1.3rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
            color: var(--text-primary-light);
            display: flex;
            align-items: center;
            gap: 0.5rem;
            letter-spacing: 0.5px;
        }

        .profile-fullname {
            font-size: 1rem;
            color: var(--text-secondary-light);
            font-weight: 500;
        }

        /* Stories Grid */
        .stories-section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
        }

        .stories-section-title {
            font-size: 1.2rem;
            font-weight: 700;
            color: var(--text-primary-light);
            display: flex;
            align-items: center;
            gap: 0.8rem;
            letter-spacing: 0.5px;
            position: relative;
        }

        .stories-section-title svg {
            width: 20px;
            height: 20px;
            stroke: var(--accent);
        }

        .stories-section-title::after {
            content: '';
            position: absolute;
            bottom: -8px;
            left: 0;
            width: 40px;
            height: 3px;
            background: linear-gradient(to right, var(--primary), var(--accent));
            border-radius: 3px;
        }

        .stories-count {
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--text-secondary-light);
            background: rgba(0, 0, 0, 0.05);
            padding: 0.4rem 0.8rem;
            border-radius: 20px;
        }

        .stories-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 1.5rem;
        }

        .story-card {
            background: rgba(255, 255, 255, 0.7);
            border-radius: var(--border-radius-md);
            overflow: hidden;
            box-shadow: var(--shadow-md);
            cursor: pointer;
            transition: var(--transition-normal);
            border: 1px solid rgba(0, 0, 0, 0.1);
            position: relative;
            transform-style: preserve-3d;
            perspective: 1000px;
        }

        .story-card:hover {
            transform: translateY(-8px) rotateX(5deg) rotateY(5deg);
            box-shadow: var(--shadow-lg), var(--shadow-glow-accent);
            border-color: rgba(0, 0, 0, 0.15);
        }

        .story-card::before {
            content: '';
            position: absolute;
            inset: -2px;
            background: linear-gradient(45deg, var(--primary), var(--accent-secondary), var(--accent));
            border-radius: calc(var(--border-radius-md) + 2px);
            z-index: -1;
            opacity: 0;
            transition: var(--transition-normal);
        }

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

        .story-preview {
            width: 100%;
            height: 220px;
            overflow: hidden;
            position: relative;
        }

        .story-preview img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: all 0.7s cubic-bezier(0.25, 0.8, 0.25, 1);
        }

        .story-card:hover .story-preview img {
            transform: scale(1.1);
        }

        .story-preview::after {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.7));
            z-index: 1;
        }

        .story-type-overlay {
            position: absolute;
            top: 15px;
            right: 15px;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            border-radius: 30px;
            padding: 0.5rem 1rem;
            color: white;
            font-size: 0.8rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 1px;
            display: flex;
            align-items: center;
            gap: 6px;
            z-index: 2;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .story-type-overlay.video {
            background: rgba(25, 135, 84, 0.7);
        }

        .story-type-overlay.image {
            background: rgba(13, 110, 253, 0.7);
        }

        .story-timestamp-overlay {
            position: absolute;
            bottom: 15px;
            left: 15px;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            border-radius: 30px;
            padding: 0.5rem 1rem;
            color: white;
            font-size: 0.8rem;
            font-weight: 500;
            z-index: 2;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .story-meta {
            padding: 1.2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: rgba(0, 0, 0, 0.05);
            border-top: 1px solid rgba(0, 0, 0, 0.05);
            position: relative;
            overflow: hidden;
        }

        .story-meta::before {
            content: '';
            position: absolute;
            top: -100%;
            left: -100%;
            width: 300%;
            height: 300%;
            background: radial-gradient(circle at center, rgba(255, 255, 255, 0.05), transparent 70%);
            animation: rotate 20s linear infinite;
            z-index: -1;
        }

        .story-info {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .story-info svg {
            width: 18px;
            height: 18px;
            stroke: var(--accent);
        }

        .story-time {
            font-size: 0.9rem;
            color: var(--text-secondary-light);
            font-weight: 500;
        }

        /* Error Panel */
        .error-panel {
            padding: 3rem;
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
            margin-top: 2rem;
            background: rgba(255, 255, 255, 0.7);
            backdrop-filter: var(--backdrop-blur);
            -webkit-backdrop-filter: var(--backdrop-blur);
            border-radius: var(--border-radius-lg);
            box-shadow: var(--shadow-md);
            border: 1px solid rgba(0, 0, 0, 0.1);
            position: relative;
            overflow: hidden;
        }

        .error-panel::before {
            content: '';
            position: absolute;
            top: -100%;
            left: -100%;
            width: 300%;
            height: 300%;
            background: radial-gradient(circle at center, rgba(220, 53, 69, 0.05), transparent 70%);
            animation: rotate 20s linear infinite;
            z-index: -1;
        }

        .error-icon {
            width: 80px;
            height: 80px;
            background: rgba(220, 53, 69, 0.1);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2.5rem;
            color: var(--error);
            margin-bottom: 2rem;
            position: relative;
        }

        .error-icon::after {
            content: '';
            position: absolute;
            inset: -8px;
            border-radius: 50%;
            border: 2px solid rgba(220, 53, 69, 0.2);
            animation: pulse-error 2s infinite;
        }

        @keyframes pulse-error {
            0% {
                transform: scale(1);
                opacity: 1;
            }

            100% {
                transform: scale(1.5);
                opacity: 0;
            }
        }

        .error-message {
            color: var(--text-secondary-light);
            font-size: 1.1rem;
            max-width: 300px;
            line-height: 1.6;
            font-weight: 500;
        }

        .error-action {
            margin-top: 2rem;
            padding: 0.8rem 1.5rem;
            background: linear-gradient(to right, var(--primary), var(--accent));
            color: white;
            border: none;
            border-radius: var(--border-radius-md);
            font-family: 'Outfit', sans-serif;
            font-size: 0.9rem;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition-normal);
            box-shadow: 0 4px 15px rgba(13, 110, 253, 0.2);
        }

        .error-action:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(13, 110, 253, 0.3);
        }

        /* Main Content */
        .main-content {
            flex: 1;
            position: relative;
            background-color: var(--surface-dark);
            overflow: hidden;
            max-height: 100vh;
        }

        .main-content::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background:
                radial-gradient(circle at 20% 20%, rgba(13, 110, 253, 0.05) 0%, transparent 40%),
                radial-gradient(circle at 80% 80%, rgba(25, 135, 84, 0.05) 0%, transparent 40%),
                radial-gradient(circle at 50% 50%, rgba(32, 201, 151, 0.03) 0%, transparent 60%);
            z-index: 0;
        }

        /* Welcome Panel */
        .welcome-panel {
            height: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 2rem;
            text-align: center;
            position: relative;
            z-index: 1;
            overflow-y: auto;
            max-height: 100vh;
					  background: hsla(344, 97%, 63%, 1);

background: linear-gradient(90deg, hsla(344, 97%, 63%, 1) 0%, hsla(232, 90%, 59%, 1) 100%);

background: -moz-linear-gradient(90deg, hsla(344, 97%, 63%, 1) 0%, hsla(232, 90%, 59%, 1) 100%);

background: -webkit-linear-gradient(90deg, hsla(344, 97%, 63%, 1) 0%, hsla(232, 90%, 59%, 1) 100%);

filter: progid: DXImageTransform.Microsoft.gradient( startColorstr="#FC4778", endColorstr="#3952F5", GradientType=1 );
        }

        .welcome-illustration {
            width: 320px;
            height: 320px;
            margin-bottom: 3rem;
            position: relative;
            flex-shrink: 0;
        }

        .welcome-illustration::before {
            content: '';
            position: absolute;
            width: 400px;
            height: 400px;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: radial-gradient(circle, rgba(13, 110, 253, 0.1) 0%, rgba(25, 135, 84, 0.05) 50%, transparent 70%);
            border-radius: 50%;
            z-index: -1;
            animation: pulse-illustration 5s ease-in-out infinite alternate;
        }

        @keyframes pulse-illustration {
            0% {
                opacity: 0.5;
                transform: translate(-50%, -50%) scale(0.9);
            }

            100% {
                opacity: 0.8;
                transform: translate(-50%, -50%) scale(1.1);
            }
        }

        .circle-1,
        .circle-2,
        .circle-3 {
            position: absolute;
            border-radius: 50%;
            opacity: 0.8;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            filter: blur(30px);
        }

        .circle-1 {
            width: 200px;
            height: 200px;
            background: linear-gradient(45deg, var(--primary), var(--accent-secondary));
            animation: pulse-circle 8s ease-in-out infinite alternate;
        }

        .circle-2 {
            width: 150px;
            height: 150px;
            background: linear-gradient(45deg, var(--accent-secondary), var(--accent));
            animation: pulse-circle 6s ease-in-out infinite alternate-reverse;
        }

        .circle-3 {
            width: 100px;
            height: 100px;
            background: linear-gradient(45deg, var(--accent), var(--warning));
            animation: pulse-circle 4s ease-in-out infinite alternate;
        }

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

            100% {
                opacity: 0.7;
                transform: translate(-50%, -50%) scale(1.2);
            }
        }

        .illustration-icon {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 100px;
            height: 100px;
            z-index: 2;
            filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
        }

      .welcome-title {
	font-size: 3rem;
	font-weight: 800;
	margin-bottom: 1.5rem;
	background: linear-gradient(to right, #ccf1ff, var(--accent-secondary), #f2dc24);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	letter-spacing: -1px;
	position: relative;
}

        .welcome-title::after {
            content: '';
            position: absolute;
            bottom: -10px;
            left: 50%;
            transform: translateX(-50%);
            width: 80px;
            height: 4px;
            background: linear-gradient(to right, var(--primary), var(--accent));
            border-radius: 4px;
        }

      .welcome-description {
	color: #f4f9fd;
	font-size: 1.2rem;
	max-width: 600px;
	margin-bottom: 4rem;
	line-height: 1.8;
	font-weight: 500;
}
        .instashot-features-list {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 2rem;
            margin-top: 2rem;
            flex-shrink: 0;
        }

        .instashot-feature-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 1rem;
            position: relative;
            padding: 2rem;
            border-radius: var(--border-radius-lg);
            background: rgba(255, 255, 255, 0.7);
            backdrop-filter: var(--backdrop-blur);
            -webkit-backdrop-filter: var(--backdrop-blur);
            box-shadow: var(--shadow-md);
            transition: var(--transition-normal);
            border: 1px solid rgba(0, 0, 0, 0.05);
            width: 180px;
            height: 180px;
            overflow: hidden;
        }

        .instashot-feature-item:hover {
            transform: translateY(-10px) scale(1.05);
            box-shadow: var(--shadow-lg), var(--shadow-glow-primary);
            border-color: rgba(0, 0, 0, 0.1);
        }

        .instashot-feature-icon {
            width: 60px;
            height: 60px;
            border-radius: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            color: white;
            position: relative;
            z-index: 1;
            box-shadow: 0 8px 20px rgba(13, 110, 253, 0.2);
        }

        .instashot-feature-icon-1 {
            background: linear-gradient(45deg, var(--primary), var(--accent-secondary));
        }

        .instashot-feature-icon-2 {
            background: linear-gradient(45deg, var(--accent-secondary), var(--accent));
        }

        .instashot-feature-icon-3 {
            background: linear-gradient(45deg, var(--accent), var(--warning));
        }

        .instashot-feature-icon::before {
            content: '';
            position: absolute;
            inset: -5px;
            background: inherit;
            border-radius: inherit;
            filter: blur(10px);
            opacity: 0.5;
            z-index: -1;
        }

        .instashot-feature-text {
            font-size: 1rem;
            color: var(--text-primary-light);
            font-weight: 600;
            text-align: center;
        }

        /* Story Player */
        .story-player {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: #000;
            z-index: 5;
        }

        .story-control-bar {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            padding: 1.5rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
            z-index: 15;
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
        }

        .story-user-data {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .story-user-image {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            border: 2px solid rgba(255, 255, 255, 0.8);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        }

        .story-username {
            font-size: 1.1rem;
            color: white;
            font-weight: 600;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        }

        .story-timestamp {
            font-size: 0.9rem;
            color: rgba(255, 255, 255, 0.8);
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        }

        .story-actions {
            display: flex;
            gap: 1rem;
        }

        .control-btn {
            width: 44px;
            height: 44px;
            background: rgba(255, 255, 255, 0.15);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: var(--transition-normal);
            color: white;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
        }

        .control-btn:hover {
            background-color: rgba(255, 255, 255, 0.25);
            transform: translateY(-3px) scale(1.1);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
        }

        /* Progress Track */
        .progress-track {
            position: absolute;
            top: 90px;
            left: 0;
            right: 0;
            padding: 0 1.5rem;
            display: flex;
            gap: 8px;
            z-index: 10;
        }

        .progress-indicator {
            height: 4px;
            flex: 1;
            background-color: rgba(255, 255, 255, 0.2);
            border-radius: 4px;
            overflow: hidden;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }
    .app-logo {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-bottom: 1.5rem;
	position: relative;
	flex-direction: column !important;
}
      .app-title {
	font-size: 1.6rem;
	font-weight: 800;
	background: linear-gradient(to right, var(--primary), var(--accent-secondary), var(--accent));
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	letter-spacing: -0.5px;
	position: relative;
	text-align: center;
}

        .progress-fill {
            height: 100%;
            width: 0;
            background: linear-gradient(to right, var(--primary), var(--accent-secondary), var(--accent));
            border-radius: 4px;
            transition: width 0.1s linear;
        }

        .progress-indicator.completed .progress-fill {
            width: 100%;
            background: white;
        }

        /* Media Container */
        .media-container {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: #000;
        }

        .media-container img,
        .media-container video {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
        }

        /* Navigation */
        .navigation-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            display: flex;
            z-index: 5;
        }

        .nav-area {
            flex: 1;
            background: transparent;
            border: none;
            cursor: pointer;
            position: relative;
        }

        .nav-indicator {
            position: absolute;
            top: 50%;
            width: 50px;
            height: 50px;
            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;
            transform: translateY(-50%);
            opacity: 0;
            transition: var(--transition-normal);
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: white;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        }
			
			.app-header {
	padding: 0.75rem;
	border-bottom: var(--border-line-light);
	position: relative;
	overflow: hidden;
	flex-shrink: 0;
	background: #201b59;
}
			
			.profile-section {
	flex: 1;
	overflow-y: auto;
	padding: 2rem;
	position: relative;
	max-height: calc(100vh - 200px);
	background: #29276d;
}
			.search-container {
	padding: 2rem;
	position: relative;
	flex-shrink: 0;
	background: #0e1c55;
}

        .prev-area .nav-indicator {
            left: 30px;
        }

        .next-area .nav-indicator {
            right: 30px;
        }

        .nav-area:hover .nav-indicator {
            opacity: 1;
            transform: translateY(-50%) scale(1.1);
        }

        /* Animations */
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .animate-fade-in-up {
            animation: fadeInUp 0.6s ease forwards;
        }

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

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

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

        .story-card:nth-child(4) {
            animation-delay: 0.4s;
        }
			
			.form-label {
	font-size: 1rem;
	font-weight: 600;
	color: #eff5fb;
	margin-bottom: 0.5rem;
	letter-spacing: 0.5px;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

        /* Responsive Styles */
        @media (max-width: 1200px) {
            .app-container {
                margin: 0;
                height: 100vh;
            }
        }

        @media (max-width: 992px) {
            .app-container {
                flex-direction: column;
                height: 100vh;
                overflow: hidden;
            }

            .side-panel {
                width: 100%;
                max-height: 50vh;
                border-right: none;
                border-bottom: 1px solid rgba(0, 0, 0, 0.1);
                overflow: hidden;
            }

            .app-header,
            .search-container,
            .profile-section {
                padding: 1.5rem;
            }

            .profile-section {
                max-height: calc(50vh - 200px);
                overflow-y: auto;
            }

            .main-content {
                max-height: 50vh;
                overflow: hidden;
            }

            .welcome-panel {
                max-height: 50vh;
                overflow-y: auto;
                padding: 1.5rem;
            }

            .welcome-illustration {
                width: 200px;
                height: 200px;
                margin-bottom: 2rem;
            }

            .welcome-title {
                font-size: 2.5rem;
            }

            .welcome-description {
                font-size: 1rem;
                margin-bottom: 2rem;
            }

            .instashot-features-list {
                gap: 1rem;
                margin-top: 1rem;
            }

            .instashot-feature-item {
                width: 140px;
                height: 140px;
                padding: 1.5rem;
            }
        }

        @media (max-width: 768px) {
            .app-logo {
                margin-bottom: 1rem;
            }

            .app-title {
                font-size: 1.5rem;
            }

            .profile-header {
                padding: 1.2rem;
            }

            .profile-image {
                width: 60px;
                height: 60px;
            }

            .welcome-title {
                font-size: 2.2rem;
            }

            .welcome-description {
                font-size: 1rem;
            }

            .instashot-features-list {
                flex-direction: column;
                align-items: center;
                gap: 1.5rem;
            }

            .welcome-illustration {
                width: 250px;
                height: 250px;
                margin-bottom: 2rem;
            }

            .side-panel {
                max-height: 60vh;
            }

            .main-content {
                max-height: 40vh;
            }
        }

        @media (max-width: 576px) {
            .stories-grid {
                grid-template-columns: 1fr;
            }

            .story-preview {
                height: 220px;
            }

            .story-control-bar {
                padding: 1.2rem;
            }

            .story-user-image {
                width: 40px;
                height: 40px;
            }

            .welcome-illustration {
                width: 200px;
                height: 200px;
                margin-bottom: 1.5rem;
            }

            .welcome-title {
                font-size: 1.8rem;
            }

            .welcome-description {
                font-size: 0.9rem;
                margin-bottom: 2.5rem;
            }

            .progress-track {
                top: 80px;
            }

            .instashot-feature-item {
                width: 150px;
                height: 150px;
                padding: 1.5rem;
            }

            .instashot-feature-icon {
                width: 50px;
                height: 50px;
            }

            .side-panel {
                max-height: 70vh;
            }

            .main-content {
                max-height: 30vh;
            }

            .welcome-panel {
                padding: 1rem;
            }

            .search-container {
                padding: 1.5rem;
            }

            .profile-section {
                padding: 1.5rem;
                max-height: calc(70vh - 250px);
            }
        }

        /* Toast Notifications */
        .toast-container {
            position: fixed;
            top: 20px;
            right: 20px;
            z-index: 1000;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .toast {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid rgba(0, 0, 0, 0.1);
            border-radius: var(--border-radius-md);
            padding: 1rem 1.5rem;
            color: var(--text-primary-light);
            font-size: 0.9rem;
            font-weight: 500;
            box-shadow: var(--shadow-lg);
            transform: translateX(100%);
            opacity: 0;
            transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
            display: flex;
            align-items: center;
            gap: 0.8rem;
            min-width: 300px;
        }

        .toast.show {
            transform: translateX(0);
            opacity: 1;
        }

        .toast.success {
            border-left: 4px solid var(--success);
        }

        .toast.error {
            border-left: 4px solid var(--error);
        }

        .toast.info {
            border-left: 4px solid var(--accent-secondary);
        }

        .toast-icon {
            width: 20px;
            height: 20px;
            flex-shrink: 0;
        }

        .toast-message {
            flex: 1;
        }

        .toast-close {
            background: none;
            border: none;
            color: var(--text-muted-light);
            cursor: pointer;
            padding: 0;
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition-normal);
        }

        .toast-close:hover {
            color: var(--text-primary-light);
        }

        /* No Stories Message */
        .no-stories-message {
            padding: 3rem;
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
            margin-top: 2rem;
            background: rgba(255, 255, 255, 0.7);
            backdrop-filter: var(--backdrop-blur);
            -webkit-backdrop-filter: var(--backdrop-blur);
            border-radius: var(--border-radius-lg);
            box-shadow: var(--shadow-md);
            border: 1px solid rgba(0, 0, 0, 0.1);
            position: relative;
            overflow: hidden;
        }

        .no-stories-message::before {
            content: '';
            position: absolute;
            top: -100%;
            left: -100%;
            width: 300%;
            height: 300%;
            background: radial-gradient(circle at center, rgba(255, 193, 7, 0.1), transparent 70%);
            animation: rotate 20s linear infinite;
            z-index: -1;
        }

        .no-stories-icon {
            width: 80px;
            height: 80px;
            background: rgba(255, 193, 7, 0.1);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2.5rem;
            color: var(--warning);
            margin-bottom: 2rem;
            position: relative;
        }

        .no-stories-icon::after {
            content: '';
            position: absolute;
            inset: -8px;
            border-radius: 50%;
            border: 2px solid rgba(255, 193, 7, 0.2);
            animation: pulse-accent 2s infinite;
        }

        @keyframes pulse-accent {
            0% {
                transform: scale(1);
                opacity: 1;
            }

            100% {
                transform: scale(1.5);
                opacity: 0;
            }
        }

        .no-stories-title {
            font-size: 1.3rem;
            font-weight: 700;
            color: var(--text-primary-light);
            margin-bottom: 1rem;
        }

        .no-stories-description {
            color: var(--text-secondary-light);
            font-size: 1rem;
            max-width: 400px;
            line-height: 1.6;
            font-weight: 500;
        }

        /* Play/Pause Button */
        .play-pause-btn {
            width: 44px;
            height: 44px;
            background: rgba(255, 255, 255, 0.15);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: var(--transition-normal);
            color: white;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
        }

        .play-pause-btn:hover {
            background-color: rgba(255, 255, 255, 0.25);
            transform: translateY(-3px) scale(1.1);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
        }

        /* Download Button */
        .download-btn {
            width: 44px;
            height: 44px;
            background: rgba(255, 255, 255, 0.15);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: var(--transition-normal);
            color: white;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
        }

        .download-btn:hover {
            background-color: rgba(255, 255, 255, 0.25);
            transform: translateY(-3px) scale(1.1);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
        }

        .download-btn:active {
            transform: translateY(-1px) scale(0.95);
        }

/* --- Codex CSS updates --- */
/* Instagram Story Viewer Download Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-gradient-1: #fff7fb;
    --bg-gradient-2: #f3f7ff;
    --bg-gradient-3: #eefcf8;
    --surface-dark: #ffffff;
    --surface-light: #ffffff;
    --glass-bg-dark: rgba(255, 255, 255, 0.9);
    --primary: #7c3aed;
    --secondary: #64748b;
    --accent: #06b6d4;
    --accent-secondary: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --text-primary-light: #111827;
    --text-secondary-light: #374151;
    --text-muted-light: #6b7280;
    --shadow-sm: 0 4px 12px rgba(17, 24, 39, 0.06);
    --shadow-md: 0 12px 32px rgba(17, 24, 39, 0.1);
    --shadow-lg: 0 22px 60px rgba(17, 24, 39, 0.16);
    --shadow-glow-primary: 0 0 0 4px rgba(124, 58, 237, 0.12), 0 18px 45px rgba(124, 58, 237, 0.18);
    --shadow-glow-accent: 0 0 0 4px rgba(6, 182, 212, 0.12), 0 18px 45px rgba(236, 72, 153, 0.18);
    --border-radius-sm: 10px;
    --border-radius-md: 14px;
    --border-radius-lg: 20px;
    --border-line-light: 1px solid rgba(148, 163, 184, 0.24);
    --transition-normal: all 0.25s ease;
    --backdrop-blur: blur(18px);
}

.instagram-story-viewer-wrapper {
    font-family: 'Outfit', sans-serif;
    background:
        radial-gradient(circle at 10% 0%, rgba(236, 72, 153, 0.24), transparent 34%),
        radial-gradient(circle at 88% 10%, rgba(124, 58, 237, 0.2), transparent 32%),
        linear-gradient(135deg, var(--bg-gradient-1), var(--bg-gradient-2) 48%, var(--bg-gradient-3));
    color: var(--text-primary-light);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    margin: 0 auto;
    padding: 24px;
    position: relative;
}

.instagram-story-viewer-wrapper .fa,
.instagram-story-viewer-wrapper .fas,
.instagram-story-viewer-wrapper .far,
.instagram-story-viewer-wrapper .fal,
.instagram-story-viewer-wrapper .fab,
.instagram-story-viewer-wrapper [class^="fa-"],
.instagram-story-viewer-wrapper [class*=" fa-"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome" !important;
    font-style: normal;
    font-weight: 900;
}

.hidden {
    display: none !important;
}

.app-container {
    display: flex;
    min-height: 760px;
    max-width: 1400px;
    margin: 24px auto;
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    height: calc(100vh - 96px);
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow-lg);
}

.app-container::before {
    content: '';
    position: absolute;
    inset: -50%;
    background: radial-gradient(circle at center, transparent 30%, rgba(124, 58, 237, 0.05) 60%, rgba(6, 182, 212, 0.08) 100%);
    animation: rotate 60s linear infinite;
    z-index: 0;
}

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

.side-panel {
    width: 420px;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    z-index: 10;
    position: relative;
    overflow: hidden;
    max-height: 100%;
}

.side-panel::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 180px;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.34), rgba(124, 58, 237, 0.14), transparent);
    z-index: -1;
}

.side-panel::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 180px;
    background: linear-gradient(to top, rgba(6, 182, 212, 0.18), transparent);
    z-index: -1;
}

.app-header {
    padding: 22px 22px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.82), rgba(88, 28, 135, 0.5));
}

.app-header::before {
    content: '';
    position: absolute;
    inset: -50%;
    background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.14), transparent 70%);
    z-index: -1;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 0;
    position: relative;
    flex-direction: column !important;
    text-align: center;
}

.logo-icon {
    width: 54px;
    height: 54px;
    background: linear-gradient(135deg, var(--accent-secondary), var(--primary) 52%, var(--accent));
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 19px;
    box-shadow: 0 16px 36px rgba(124, 58, 237, 0.28);
    position: relative;
    overflow: hidden;
    animation: pulse 3s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 16px 36px rgba(124, 58, 237, 0.28); }
    50% { box-shadow: 0 18px 44px rgba(236, 72, 153, 0.34); }
}

.logo-icon::before {
    content: '';
    position: absolute;
    inset: -50%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.36), transparent 70%);
    animation: rotate 10s linear infinite;
}

.logo-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0) 52%);
}

.app-title {
    font-size: clamp(1.35rem, 2vw, 1.65rem);
    line-height: 1.25;
    font-weight: 800;
    background: linear-gradient(90deg, #ffffff, #fce7f3 48%, #a7f3d0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0;
    position: relative;
    text-align: center;
    text-transform: capitalize !important;
    max-width: 360px;
}

.search-container {
    padding: 24px;
    position: relative;
    flex-shrink: 0;
    background: rgba(15, 23, 42, 0.64);
}

.search-container::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle at top right, rgba(6, 182, 212, 0.18), transparent 70%);
    z-index: -1;
}

#search-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #eff6ff;
    margin-bottom: 10px;
    letter-spacing: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-label svg {
    width: 18px;
    height: 18px;
    stroke: #a5f3fc;
    flex-shrink: 0;
}

.input-group {
    position: relative;
    width: 100%;
    max-width: 100%;
}

#username-input {
    width: 100%;
    max-width: 100%;
    height: 54px;
    min-height: 54px;
    max-height: 54px;
    padding: 0 48px 0 18px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(203, 213, 225, 0.88);
    border-radius: 16px;
    color: var(--text-primary-light);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    line-height: 54px;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-sm);
    resize: none;
}

#username-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.18), 0 14px 30px rgba(15, 23, 42, 0.14);
    background: #ffffff;
}

#username-input::placeholder {
    color: #94a3b8;
}

.input-icon {
    position: absolute;
    right: 17px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
    height: 18px;
}

#search-btn {
    min-height: 54px;
    background: linear-gradient(135deg, var(--accent-secondary), var(--primary) 52%, var(--accent));
    color: white;
    border: none;
    border-radius: 16px;
    padding: 0 22px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: var(--transition-normal);
    box-shadow: 0 16px 32px rgba(124, 58, 237, 0.28);
    position: relative;
    overflow: hidden;
    letter-spacing: 0;
}

#search-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
    transition: var(--transition-normal);
}

#search-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 42px rgba(124, 58, 237, 0.34);
}

#search-btn:hover::before {
    left: 100%;
    transition: 0.7s;
}

#search-btn:active {
    transform: translateY(-1px);
}

#search-btn:focus-visible,
.error-action:focus-visible,
.control-btn:focus-visible,
.nav-area:focus-visible,
.toast-close:focus-visible {
    outline: 3px solid rgba(6, 182, 212, 0.32);
    outline-offset: 3px;
}

.profile-section {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    position: relative;
    max-height: calc(100% - 230px);
    background: rgba(15, 23, 42, 0.72);
}

.profile-section::-webkit-scrollbar {
    width: 8px;
}

.profile-section::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.profile-section::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--accent-secondary), var(--accent));
    border-radius: 10px;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 0;
}

.spinner {
    width: 56px;
    height: 56px;
    position: relative;
    margin-bottom: 18px;
}

.spinner::before,
.spinner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}

.spinner::before {
    width: 100%;
    height: 100%;
    background-image: linear-gradient(var(--accent-secondary), var(--primary), var(--accent));
    animation: spin 1s linear infinite;
}

.spinner::after {
    inset: 10%;
    background: #0f172a;
    border-radius: 50%;
}

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

.loading-text {
    color: #e0f2fe;
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(to right, #fce7f3, #a5f3fc, #d9f99d);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 2s infinite;
    background-size: 200% 100%;
}

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

.profile-data {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
    border: 1px solid rgba(255, 255, 255, 0.78);
    position: relative;
    overflow: hidden;
}

.profile-header:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow-primary);
}

.profile-header::before {
    content: '';
    position: absolute;
    inset: -100%;
    background: radial-gradient(circle at center, rgba(124, 58, 237, 0.12), transparent 70%);
    animation: rotate 20s linear infinite;
    z-index: -1;
}

.profile-image-container {
    position: relative;
    flex-shrink: 0;
}

.profile-image {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid transparent;
    background:
        linear-gradient(var(--surface-dark), var(--surface-dark)) padding-box,
        linear-gradient(135deg, var(--accent-secondary), var(--primary), var(--accent)) border-box;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
    transition: var(--transition-normal);
    animation: float 6s ease-in-out infinite;
}

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

.profile-image:hover {
    transform: scale(1.06);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18), var(--shadow-glow-primary);
}

.profile-image-aura {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-secondary), var(--primary), var(--accent));
    opacity: 0.16;
    filter: blur(12px);
    z-index: -1;
    animation: pulse-aura 3s ease-in-out infinite alternate;
}

@keyframes pulse-aura {
    0% { opacity: 0.1; transform: scale(1); }
    100% { opacity: 0.24; transform: scale(1.08); }
}

.verified-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    border: 2px solid var(--surface-dark);
    box-shadow: var(--shadow-sm);
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-username {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 4px;
    color: var(--text-primary-light);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.profile-fullname {
    font-size: 0.95rem;
    color: var(--text-secondary-light);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.stories-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.stories-section-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0;
    position: relative;
}

.stories-section-title svg {
    width: 20px;
    height: 20px;
    stroke: #67e8f9;
    flex-shrink: 0;
}

.stories-section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 42px;
    height: 3px;
    background: linear-gradient(to right, var(--accent-secondary), var(--accent));
    border-radius: 999px;
}

.stories-count {
    font-size: 0.86rem;
    font-weight: 800;
    color: #e0f2fe;
    background: rgba(255, 255, 255, 0.12);
    padding: 7px 12px;
    border-radius: 999px;
    white-space: nowrap;
}

.stories-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.story-card {
    background: rgba(255, 255, 255, 0.94);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: var(--transition-normal);
    border: 1px solid rgba(255, 255, 255, 0.72);
    position: relative;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.story-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-glow-accent);
    border-color: rgba(6, 182, 212, 0.28);
}

.story-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, var(--accent-secondary), var(--primary), var(--accent));
    border-radius: calc(var(--border-radius-md) + 2px);
    z-index: -1;
    opacity: 0;
    transition: var(--transition-normal);
}

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

.story-card.is_video,
.story.is_video {
    border-color: rgba(236, 72, 153, 0.34);
}

.story-preview {
    width: 100%;
    height: 220px;
    overflow: hidden;
    position: relative;
    background: #020617;
}

.story-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.55s ease;
}

.story-card:hover .story-preview img {
    transform: scale(1.08);
}

.story-preview::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 42%, rgba(2, 6, 23, 0.78));
    z-index: 1;
}

.story-type-overlay {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 999px;
    padding: 7px 12px;
    color: white;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 2;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.story-type-overlay.video {
    background: rgba(236, 72, 153, 0.82);
}

.story-type-overlay.image {
    background: rgba(124, 58, 237, 0.82);
}

.story-timestamp-overlay {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 999px;
    padding: 7px 12px;
    color: white;
    font-size: 0.78rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.story-meta {
    padding: 13px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(248, 250, 252, 0.92);
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    position: relative;
    overflow: hidden;
}

.story-meta::before {
    content: '';
    position: absolute;
    inset: -100%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.16), transparent 70%);
    animation: rotate 20s linear infinite;
    z-index: -1;
}

.story-info {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.story-info svg {
    width: 18px;
    height: 18px;
    stroke: var(--accent);
    flex-shrink: 0;
}

.story-time {
    font-size: 0.88rem;
    color: var(--text-secondary-light);
    font-weight: 700;
}

.error-panel,
.no-stories-message {
    padding: 32px 22px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.72);
    position: relative;
    overflow: hidden;
}

.error-panel::before,
.no-stories-message::before {
    content: '';
    position: absolute;
    inset: -100%;
    animation: rotate 20s linear infinite;
    z-index: -1;
}

.error-panel::before {
    background: radial-gradient(circle at center, rgba(239, 68, 68, 0.09), transparent 70%);
}

.no-stories-message::before {
    background: radial-gradient(circle at center, rgba(245, 158, 11, 0.12), transparent 70%);
}

.error-icon,
.no-stories-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin-bottom: 18px;
    position: relative;
}

.error-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.no-stories-icon {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
}

.error-icon::after,
.no-stories-icon::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    animation: pulse-accent 2s infinite;
}

.error-icon::after {
    border: 2px solid rgba(239, 68, 68, 0.2);
}

.no-stories-icon::after {
    border: 2px solid rgba(245, 158, 11, 0.22);
}

@keyframes pulse-error {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

@keyframes pulse-accent {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.error-message,
.no-stories-description {
    color: var(--text-secondary-light);
    font-size: 0.98rem;
    max-width: 400px;
    line-height: 1.65;
    font-weight: 600;
}

.error-action {
    margin-top: 20px;
    min-height: 44px;
    padding: 0 18px;
    background: linear-gradient(135deg, var(--accent-secondary), var(--primary), var(--accent));
    color: white;
    border: none;
    border-radius: 14px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: 0 14px 30px rgba(124, 58, 237, 0.22);
}

.error-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(124, 58, 237, 0.3);
}

.no-stories-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary-light);
    margin-bottom: 10px;
}

.main-content {
    flex: 1;
    position: relative;
    background-color: var(--surface-dark);
    overflow: hidden;
    max-height: 100%;
    z-index: 1;
}

.main-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(124, 58, 237, 0.1) 0%, transparent 42%),
        radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.1) 0%, transparent 42%),
        radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.08) 0%, transparent 60%);
    z-index: 0;
}

.welcome-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 42px 28px;
    text-align: center;
    position: relative;
    z-index: 1;
    overflow-y: auto;
    max-height: 100%;
    background:
        radial-gradient(circle at 20% 12%, rgba(255, 255, 255, 0.18), transparent 28%),
        linear-gradient(135deg, #be185d 0%, #6d28d9 48%, #0891b2 100%);
}

.welcome-illustration {
    width: 260px;
    height: 260px;
    margin-bottom: 30px;
    position: relative;
    flex-shrink: 0;
}

.welcome-illustration::before {
    content: '';
    position: absolute;
    width: 320px;
    height: 320px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, rgba(6, 182, 212, 0.12) 48%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    animation: pulse-illustration 5s ease-in-out infinite alternate;
}

@keyframes pulse-illustration {
    0% { opacity: 0.5; transform: translate(-50%, -50%) scale(0.92); }
    100% { opacity: 0.85; transform: translate(-50%, -50%) scale(1.06); }
}

.circle-1,
.circle-2,
.circle-3 {
    position: absolute;
    border-radius: 50%;
    opacity: 0.82;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: blur(28px);
}

.circle-1 {
    width: 190px;
    height: 190px;
    background: linear-gradient(45deg, var(--primary), var(--accent-secondary));
    animation: pulse-circle 8s ease-in-out infinite alternate;
}

.circle-2 {
    width: 145px;
    height: 145px;
    background: linear-gradient(45deg, var(--accent-secondary), var(--accent));
    animation: pulse-circle 6s ease-in-out infinite alternate-reverse;
}

.circle-3 {
    width: 100px;
    height: 100px;
    background: linear-gradient(45deg, var(--accent), var(--warning));
    animation: pulse-circle 4s ease-in-out infinite alternate;
}

@keyframes pulse-circle {
    0% { opacity: 0.42; transform: translate(-50%, -50%) scale(0.84); }
    100% { opacity: 0.72; transform: translate(-50%, -50%) scale(1.16); }
}

.illustration-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 96px;
    height: 96px;
    z-index: 2;
    filter: drop-shadow(0 18px 32px rgba(0, 0, 0, 0.22));
}

.welcome-title {
    font-size: clamp(1.75rem, 3vw, 2.45rem);
    font-weight: 800;
    margin-bottom: 18px;
    background: linear-gradient(to right, #ffffff, #e0f2fe, #fef3c7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0;
    position: relative;
    line-height: 1.18;
}

.welcome-title::after {
    content: '';
    position: absolute;
    bottom: -9px;
    left: 50%;
    transform: translateX(-50%);
    width: 76px;
    height: 4px;
    background: linear-gradient(to right, #f472b6, #67e8f9);
    border-radius: 999px;
}

.welcome-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.05rem;
    max-width: 620px;
    margin-bottom: 34px;
    line-height: 1.75;
    font-weight: 500;
}

.instashot-features-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
    margin-top: 10px;
    flex-shrink: 0;
}

.instashot-feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    position: relative;
    padding: 22px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
    border: 1px solid rgba(255, 255, 255, 0.74);
    width: 170px;
    min-height: 160px;
    overflow: hidden;
}

.instashot-feature-item:hover {
    transform: translateY(-7px);
    box-shadow: var(--shadow-glow-primary);
}

.instashot-feature-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: white;
    position: relative;
    z-index: 1;
    box-shadow: 0 14px 30px rgba(124, 58, 237, 0.24);
}

.instashot-feature-icon-1 {
    background: linear-gradient(135deg, var(--primary), var(--accent-secondary));
}

.instashot-feature-icon-2 {
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent));
}

.instashot-feature-icon-3 {
    background: linear-gradient(135deg, var(--accent), var(--warning));
}

.instashot-feature-icon::before {
    content: '';
    position: absolute;
    inset: -5px;
    background: inherit;
    border-radius: inherit;
    filter: blur(10px);
    opacity: 0.5;
    z-index: -1;
}

.instashot-feature-text {
    font-size: 0.98rem;
    color: var(--text-primary-light);
    font-weight: 800;
    text-align: center;
    line-height: 1.35;
}

.story-player {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 5;
}

.story-control-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: linear-gradient(to bottom, rgba(2, 6, 23, 0.88), rgba(2, 6, 23, 0.12));
    z-index: 15;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.story-user-data {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.story-user-image {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.86);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.26);
    object-fit: cover;
    flex-shrink: 0;
}

.story-username {
    font-size: 1rem;
    color: white;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.32);
    overflow-wrap: anywhere;
}

.story-timestamp {
    font-size: 0.86rem;
    color: rgba(255, 255, 255, 0.82);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.32);
}

.story-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.control-btn,
.play-pause-btn,
.download-btn,
.mute-btn,
.close-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-normal);
    color: white;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.control-btn:hover,
.play-pause-btn:hover,
.download-btn:hover,
.mute-btn:hover,
.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

.download-btn:active,
.play-pause-btn:active,
.mute-btn:active,
.close-btn:active {
    transform: translateY(-1px) scale(0.96);
}

.progress-track {
    position: absolute;
    top: 86px;
    left: 0;
    right: 0;
    padding: 0 20px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.progress-indicator {
    height: 4px;
    flex: 1;
    background-color: rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(to right, var(--accent-secondary), var(--primary), var(--accent));
    border-radius: 999px;
    transition: width 0.1s linear;
}

.progress-indicator.completed .progress-fill {
    width: 100%;
    background: white;
}

.media-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
}

.media-container img,
.media-container video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.navigation-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    z-index: 5;
}

.nav-area {
    flex: 1;
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
}

.prev-area {
    cursor: w-resize;
}

.next-area {
    cursor: e-resize;
}

.nav-indicator {
    position: absolute;
    top: 50%;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    opacity: 0;
    transition: var(--transition-normal);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: white;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
}

.prev-area .nav-indicator {
    left: 28px;
}

.next-area .nav-indicator {
    right: 28px;
}

.nav-area:hover .nav-indicator {
    opacity: 1;
    transform: translateY(-50%) scale(1.08);
}

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

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.story-card:nth-child(1) { animation-delay: 0.1s; }
.story-card:nth-child(2) { animation-delay: 0.2s; }
.story-card:nth-child(3) { animation-delay: 0.3s; }
.story-card:nth-child(4) { animation-delay: 0.4s; }

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: calc(100vw - 40px);
}

.toast {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--border-radius-md);
    padding: 14px 16px;
    color: var(--text-primary-light);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
    max-width: 420px;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--error);
}

.toast.info {
    border-left: 4px solid var(--accent);
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted-light);
    cursor: pointer;
    padding: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-normal);
}

.toast-close:hover {
    color: var(--text-primary-light);
}

.\? {
    display: inline;
}

@media (max-width: 1200px) {
    .instagram-story-viewer-wrapper {
        padding: 16px;
    }

    .app-container {
        margin: 0 auto;
        height: calc(100vh - 32px);
        min-height: 700px;
    }
}

@media (max-width: 992px) {
    .app-container {
        flex-direction: column;
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .side-panel {
        width: 100%;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
        overflow: visible;
    }

    .app-header,
    .search-container,
    .profile-section {
        padding: 20px;
    }

    .profile-section {
        max-height: none;
        overflow-y: visible;
    }

    .main-content {
        min-height: 560px;
        max-height: none;
        overflow: hidden;
    }

    .welcome-panel {
        max-height: none;
        min-height: 560px;
        overflow-y: auto;
        padding: 34px 20px;
    }

    .welcome-illustration {
        width: 220px;
        height: 220px;
        margin-bottom: 26px;
    }

    .welcome-title {
        font-size: clamp(1.7rem, 4vw, 2.1rem);
    }

    .welcome-description {
        font-size: 1rem;
        margin-bottom: 26px;
    }

    .instashot-features-list {
        gap: 14px;
        margin-top: 8px;
    }

    .instashot-feature-item {
        width: 150px;
        min-height: 145px;
        padding: 18px;
    }
}

@media (max-width: 768px) {
    .instagram-story-viewer-wrapper {
        padding: 12px;
        min-height: auto;
    }

    .app-container {
        border-radius: 22px;
        width: 100%;
        max-width: 100%;
    }

    .app-logo {
        margin-bottom: 0;
    }

    .app-title {
        font-size: clamp(1.25rem, 5vw, 1.5rem);
        max-width: 100%;
    }

    #search-form {
        display: flex;
        flex-direction: column;
        gap: 14px;
        width: 100%;
    }

    .input-group,
    #username-input,
    #search-btn {
        width: 100%;
        max-width: 100%;
    }

    #username-input {
        height: 52px;
        min-height: 52px;
        max-height: 52px;
        line-height: 52px;
        padding-top: 0;
        padding-bottom: 0;
        font-size: 1rem;
    }

    #search-btn {
        min-height: 52px;
        padding: 0 18px;
        font-size: 1rem;
    }

    .profile-header {
        padding: 16px;
    }

    .profile-image {
        width: 62px;
        height: 62px;
    }

    .stories-section-header {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .welcome-title {
        font-size: clamp(1.6rem, 6vw, 2rem);
    }

    .welcome-description {
        font-size: 0.98rem;
    }

    .instashot-features-list {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 340px;
        gap: 14px;
    }

    .instashot-feature-item {
        width: 100%;
        min-height: 120px;
        padding: 18px;
    }

    .welcome-illustration {
        width: 210px;
        height: 210px;
        margin-bottom: 24px;
    }

    .story-control-bar {
        align-items: flex-start;
        padding: 16px;
    }

    .story-actions {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .control-btn,
    .play-pause-btn,
    .download-btn,
    .mute-btn,
    .close-btn {
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
    }

    .progress-track {
        top: 86px;
        padding: 0 16px;
    }
}

@media (max-width: 576px) {
    .instagram-story-viewer-wrapper {
        padding: 10px;
    }

    .app-container {
        border-radius: 18px;
    }

    .app-header,
    .search-container,
    .profile-section {
        padding: 16px;
    }

    .logo-icon {
        width: 48px;
        height: 48px;
        border-radius: 16px;
        font-size: 17px;
    }

    .app-title {
        font-size: 1.22rem;
        line-height: 1.28;
    }

    .form-label {
        font-size: 0.9rem;
    }

    #username-input {
        height: 50px;
        min-height: 50px;
        max-height: 50px;
        line-height: 50px;
        border-radius: 14px;
    }

    #search-btn {
        min-height: 50px;
        border-radius: 14px;
    }

    .profile-header {
        align-items: flex-start;
        gap: 14px;
    }

    .profile-username {
        font-size: 1.05rem;
    }

    .profile-fullname {
        font-size: 0.9rem;
    }

    .stories-grid {
        grid-template-columns: 1fr;
    }

    .story-preview {
        height: 220px;
    }

    .story-user-image {
        width: 40px;
        height: 40px;
    }

    .story-username {
        font-size: 0.94rem;
    }

    .story-timestamp {
        font-size: 0.8rem;
    }

    .welcome-panel {
        min-height: 500px;
        padding: 28px 16px;
    }

    .welcome-illustration {
        width: 180px;
        height: 180px;
        margin-bottom: 20px;
    }

    .welcome-illustration::before {
        width: 240px;
        height: 240px;
    }

    .illustration-icon,
    .illustration-icon svg {
        width: 78px;
        height: 78px;
    }

    .welcome-title {
        font-size: 1.55rem;
    }

    .welcome-description {
        font-size: 0.92rem;
        margin-bottom: 24px;
        line-height: 1.65;
    }

    .instashot-feature-icon {
        width: 50px;
        height: 50px;
        border-radius: 16px;
    }

    .toast-container {
        top: 12px;
        right: 12px;
        left: 12px;
        max-width: none;
    }

    .toast {
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }

    .nav-indicator {
        width: 44px;
        height: 44px;
    }

    .prev-area .nav-indicator {
        left: 14px;
    }

    .next-area .nav-indicator {
        right: 14px;
    }
}

@media (max-width: 380px) {
    .app-title {
        font-size: 1.12rem;
    }

    .app-header,
    .search-container,
    .profile-section {
        padding: 14px;
    }

    .story-control-bar {
        padding: 12px;
        gap: 10px;
    }

    .control-btn,
    .play-pause-btn,
    .download-btn,
    .mute-btn,
    .close-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
    }

    .progress-track {
        top: 78px;
        padding: 0 12px;
    }
}