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

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

:root {
        --primary: #2af0ea;
        --primary-glow: rgba(42, 240, 234, 0.34);
        --accent: #ff4fa3;
        --accent-purple: #ff7a59;
        --success: #10B981;
        --error: #EF4444;
        --white: #fff7fb;
        --gray-100: #fdf2ff;
        --gray-300: #d9c7ef;
        --gray-500: #9f8dbd;
        --gray-800: #2e2142;
        --gray-900: #120917;
        --glass-bg: rgba(22, 12, 32, 0.78);
        --glass-border: rgba(122, 243, 238, 0.22);
        --shadow-lg: 0 24px 56px rgba(8, 4, 18, 0.56);
        --radius-md: 14px;
        --radius-lg: 18px;
        --radius-xl: 17px;
        --transition: all 0.3s cubic-bezier(.23, 1.02, .67, 1.01);
        --text-primary: #ffffff;
        --text-secondary: #d9c7ef;
        --text-muted: #9f8dbd;
        --border-color: rgba(122, 243, 238, 0.22);
    }
	
	.uicore-page-title .uicore h1.uicore-title {
	margin: .4em 0;
	display: none;
}

    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    .tiktok_body {
        font-family: 'Inter', sans-serif;
        position: relative;
        z-index: 0;
        min-height: 100vh;
        background:
            radial-gradient(circle at 10% 12%, rgba(42, 240, 234, 0.3), transparent 34%),
            radial-gradient(circle at 88% 14%, rgba(255, 79, 163, 0.34), transparent 38%),
            radial-gradient(circle at 80% 82%, rgba(255, 122, 89, 0.2), transparent 42%),
            radial-gradient(circle at 18% 84%, rgba(143, 92, 255, 0.22), transparent 44%),
            radial-gradient(circle at 52% 52%, rgba(255, 255, 255, 0.05), transparent 52%),
            linear-gradient(136deg, #09040d 0%, #150819 20%, #2a1033 42%, #3b0f2f 60%, #4a1638 78%, #120918 100%);
        background-size: 190% 190%, 180% 180%, 220% 220%, 210% 210%, 230% 230%, 240% 240%;
        animation: tiktok-aurora 16s ease-in-out infinite;
        color: var(--gray-100);
        line-height: 1.6;
        padding: 10px 10px;
        overflow-x: hidden;
        width: 100%;
    }

    .tiktok_body::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: -1;
        background:
            linear-gradient(160deg, rgba(4, 2, 10, 0.46), rgba(16, 8, 22, 0.22)),
            radial-gradient(circle at 18% 18%, rgba(42, 240, 234, 0.08), transparent 52%),
            radial-gradient(circle at 82% 76%, rgba(255, 79, 163, 0.08), transparent 48%),
            radial-gradient(circle at 55% 56%, rgba(255, 122, 89, 0.06), transparent 54%);
        opacity: 1;
    }

    .container_tiktok {
        max-width: 1400px;
        margin: 0 auto;
        padding: 32px 16px;
        position: relative;
        z-index: 1;
    }

    /* Header */
    .header {
        text-align: center;
        margin-bottom: 2.5rem;
        animation: fadeInDown 1s ease-out;
    }

    .logo {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 1.5rem;
        margin-bottom: 1rem;
        flex-wrap: wrap;
    }

    .logo-icon {
        width: 80px;
        height: 80px;
        background: linear-gradient(135deg, #00f2ea67 0%, #25f4ed52 25%, #ff0050 75%, #ff4fa3 100%);
        border-radius: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 36px;
        font-weight: 900;
        box-shadow: 0 25px 50px rgba(8, 4, 18, 0.3), 0 0 20px rgba(42, 240, 234, 0.3);
        position: relative;
        overflow: hidden;
        animation: pulse 2s ease-in-out infinite;
    }

    .logo-text {
        font-size: clamp(1.8rem, 5vw, 2.5rem);
        font-weight: 900;
        background: linear-gradient(135deg, #00f2ea 0%, #25f4ee 25%, #ff0050 75%, #ff4fa3 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        text-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        letter-spacing: -1px;
        font-family: 'Sora', sans-serif;
        display: block;
        width: 100%;
        text-align: center;
    }

    .subtitle {
        font-size: clamp(0.9rem, 2.5vw, 1.1rem);
        color: var(--text-secondary);
        font-weight: 500;
        margin-top: 0.5rem;
        text-align: center;
        padding: 0 1rem;
    }

    /* Search Section */
    .search-section {
        background: var(--glass-bg);
        backdrop-filter: blur(20px) saturate(145%) contrast(1.05);
        -webkit-backdrop-filter: blur(20px) saturate(145%) contrast(1.05);
        border: 2px solid var(--glass-border);
        padding: clamp(24px, 5vw, 48px);
        border-radius: var(--radius-xl);
        box-shadow: var(--shadow-lg);
        margin-bottom: 32px;
        animation: fadeInUp 1s ease-out 0.2s both;
    }

    .input-group {
        position: relative;
        margin-bottom: 1.5rem;
        z-index: 2;
    }

    .input-field {
        width: 100% !important;
        padding: clamp(16px, 3vw, 20px) clamp(20px, 4vw, 24px)  !important;
        border: 2px solid rgba(122, 243, 238, 0.18)  !important;
        border-radius: var(--radius-lg)  !important;
        font-size: clamp(14px, 2.5vw, 16px)  !important;
        font-weight: 500  !important;
        background: rgba(18, 9, 23, 0.68)  !important;
        color: var(--white)  !important;
        transition: var(--transition)  !important;
    }

    .input-field:focus {
        outline: none  !important;
        border-color: rgba(110, 238, 232, 0.78)  !important;
        background: rgba(22, 12, 32, 0.78)  !important;
        box-shadow: 0 0 0 4px rgba(42, 240, 234, 0.14), 0 10px 24px rgba(18, 8, 28, 0.28)  !important;
    }

    .input-field::placeholder {
        color: rgba(255, 255, 255, 0.5);
    }

    .input-actions {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 1rem;
        font-size: clamp(0.8rem, 2vw, 0.9rem);
        color: var(--text-tertiary);
        z-index: 2;
        position: relative;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .paste-btn {
        background: linear-gradient(135deg, rgba(46, 33, 66, 0.9) 0%, rgba(62, 47, 79, 0.9) 100%);
        color: white;
        border: 1px solid rgba(122, 243, 238, 0.22);
        border-radius: var(--radius-md);
        font-weight: 700;
        font-size: clamp(0.85rem, 2.5vw, 1rem);
        cursor: pointer;
        transition: var(--transition);
        box-shadow: var(--shadow-lg);
        padding: 16px;
    }

    .paste-btn:hover {
        transform: translateY(-2px);
        background: linear-gradient(135deg, rgba(62, 47, 79, 0.95) 0%, rgba(86, 55, 80, 0.95) 100%);
        border-color: rgba(115, 242, 237, 0.32);
        box-shadow: var(--shadow-lg);
    }

    .action-buttons {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
        align-items: center;
        z-index: 2;
        position: relative;
    }

    .search-btn {
        flex: 1;
        min-width: 200px;
        padding: clamp(16px, 3vw, 20px) clamp(24px, 5vw, 32px);
        background: linear-gradient(135deg, #00f2ea67 0%, #25f4ed52 25%, #ff0050 75%, #ff4fa3 100%);
        color: white;
        border: 1px solid rgba(122, 243, 238, 0.22);
        border-radius: var(--radius-md);
        font-size: clamp(0.85rem, 2.5vw, 1rem);
        font-weight: 700;
        cursor: pointer;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
        box-shadow: var(--shadow-lg), 0 0 20px rgba(42, 240, 234, 0.3);
    }

    .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: left 0.5s;
    }

    .search-btn:hover:not(:disabled)::before {
        left: 100%;
    }

    .search-btn:hover:not(:disabled) {
        transform: translateY(-3px);
        background: linear-gradient(135deg, #00f2ea67 0%, #25f4ed52 25%, #ff4fa3 75%, #ff0050 100%);
        box-shadow: 0 12px 28px rgba(255, 79, 163, 0.35), 0 0 20px rgba(42, 240, 234, 0.25);
        border-color: rgba(122, 243, 238, 0.4);
    }

    .search-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
    }

    .search-another-btn {
        background: linear-gradient(135deg, rgba(46, 33, 66, 0.9) 0%, rgba(62, 47, 79, 0.9) 100%);
        color: white;
        margin-top: 16px;
        width: 100%;
        padding: 16px;
        border: 1px solid rgba(122, 243, 238, 0.22);
        border-radius: var(--radius-md);
        font-weight: 700;
        font-size: clamp(0.85rem, 2.5vw, 1rem);
        cursor: pointer;
        transition: var(--transition);
        box-shadow: var(--shadow-lg);
    }

    .search-another-btn:hover {
        transform: translateY(-2px);
        background: linear-gradient(135deg, rgba(62, 47, 79, 0.95) 0%, rgba(86, 55, 80, 0.95) 100%);
        border-color: rgba(115, 242, 237, 0.32);
        box-shadow: var(--shadow-lg);
    }

    /* Loading Animation */
    .loading {
        display: none;
        justify-content: center;
        align-items: center;
        padding: 60px 40px;
        background: var(--glass-bg);
        backdrop-filter: blur(30px);
        border-radius: var(--radius-xl);
        margin: 32px 0;
        border: 1px solid var(--glass-border);
        box-shadow: var(--shadow-lg);
    }

    .loading-content {
        text-align: center;
    }

    .loading-animation {
        position: relative;
        width: 120px;
        height: 120px;
        margin: 0 auto 24px;
    }

    .loading-ring {
        position: absolute;
        border: 4px solid transparent;
        border-radius: 50%;
        animation: spin 2s linear infinite;
    }

    .loading-ring:nth-child(1) {
        width: 120px;
        height: 120px;
        border-top-color: var(--primary);
        animation-duration: 2s;
    }

    .loading-ring:nth-child(2) {
        width: 90px;
        height: 90px;
        top: 15px;
        left: 15px;
        border-right-color: var(--accent);
        animation-duration: 1.5s;
        animation-direction: reverse;
    }

    .loading-ring:nth-child(3) {
        width: 60px;
        height: 60px;
        top: 30px;
        left: 30px;
        border-bottom-color: var(--accent-purple);
        animation-duration: 1s;
    }

    .loading-dots {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-bottom: 16px;
    }

    .loading-dot {
        width: 12px;
        height: 12px;
        background: linear-gradient(135deg, #00f2ea67 0%, #25f4ed52 25%, #ff0050 75%, #ff4fa3 100%);
        border-radius: 50%;
        animation: bounce 1.4s ease-in-out infinite both;
    }

    .loading-dot:nth-child(1) {
        animation-delay: -0.32s;
    }

    .loading-dot:nth-child(2) {
        animation-delay: -0.16s;
    }

    .loading-dot:nth-child(3) {
        animation-delay: 0s;
    }

    .loading-text {
        font-size: 18px;
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 8px;
    }

    .loading-subtext {
        font-size: 14px;
        color: var(--text-secondary);
    }

    /* Video Section */
    .video-section {
        display: none;
        animation: fadeInUp 0.8s ease-out;
        background: var(--glass-bg);
        backdrop-filter: blur(20px) saturate(145%) contrast(1.05);
        -webkit-backdrop-filter: blur(20px) saturate(145%) contrast(1.05);
        border: 2px solid var(--glass-border);
        border-radius: var(--radius-xl);
        padding: 32px;
        margin-bottom: 32px;
        box-shadow: var(--shadow-lg);
    }

    /* Author Info */
    .author-section {
        display: flex;
        align-items: center;
        gap: clamp(0.8rem, 3vw, 1.2rem);
        margin-bottom: 1.5rem;
        padding: clamp(1rem, 3vw, 1.5rem);
        background: rgba(79, 70, 229, 0.1);
        border-radius: var(--radius-xl);
        border: 1px solid rgba(79, 70, 229, 0.3);
        width: 100%;
        box-shadow: var(--shadow-md);
        transition: var(--transition);
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }

    .author-section:hover,
    .author-section:active {
        transform: translateY(-3px);
        box-shadow: var(--shadow-lg), 0 0 20px rgba(79, 70, 229, 0.3);
    }

    .author-avatar {
        width: clamp(50px, 12vw, 60px);
        height: clamp(50px, 12vw, 60px);
        border-radius: 50%;
        object-fit: cover;
        border: 3px solid transparent;
        background: linear-gradient(135deg, #00f2ea67 0%, #25f4ed52 25%, #ff0050 75%, #ff4fa3 100%);
        padding: 2px;
        box-shadow: var(--shadow-md);
        animation: avatarPulse 4s ease-in-out infinite;
        flex-shrink: 0;
    }

    .author-details {
        flex: 1;
        min-width: 0;
    }

    .author-details h3 {
        font-size: clamp(1rem, 3vw, 1.2rem);
        font-weight: 700;
        margin-bottom: 0.25rem;
        background: linear-gradient(135deg, #00f2ea67 0%, #25f4ed52 25%, #ff0050 75%, #ff4fa3 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        word-break: break-word;
    }

    .author-username {
        color: var(--text-tertiary);
        font-size: clamp(0.8rem, 2.5vw, 0.95rem);
        font-weight: 500;
        word-break: break-word;
    }

    /* Title */
    .video-title {
        font-size: clamp(1.2rem, 4vw, 1.6rem);
        font-weight: 800;
        margin-bottom: 1.5rem;
        line-height: 1.4;
        color: var(--text-primary);
        width: 100%;
        text-align: center;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
        word-break: break-word;
        padding: 0 1rem;
    }

    /* Stats Grid */
    .video-stats {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: clamp(0.5rem, 2vw, 1rem);
        margin-bottom: 2rem;
    }

    .stat-item {
        background: rgba(30, 41, 59, 0.8);
        padding: clamp(0.8rem, 3vw, 1.2rem);
        border-radius: var(--radius-md);
        text-align: center;
        border: 1px solid rgba(122, 243, 238, 0.22);
        transition: var(--transition);
        position: relative;
        overflow: hidden;
        box-shadow: var(--shadow-md);
        backdrop-filter: blur(15px);
    }

    .stat-item::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(79, 70, 229, 0.3), transparent);
        transition: left 0.6s;
    }

    .stat-item:hover::before,
    .stat-item:active::before {
        left: 100%;
    }

    .stat-item:hover,
    .stat-item:active {
        transform: translateY(-5px) scale(1.02);
        box-shadow: var(--shadow-lg), 0 0 20px rgba(79, 70, 229, 0.3);
    }

    .stat-item.views {
        border-color: rgba(122, 243, 238, 0.4);
        background: rgba(79, 70, 229, 0.1);
    }

    .stat-item.likes {
        border-color: rgba(122, 243, 238, 0.4);
        background: rgba(236, 72, 153, 0.1);
    }

    .stat-item.comments {
        border-color: rgba(122, 243, 238, 0.4);
        background: rgba(139, 92, 246, 0.1);
    }

    .stat-item.shares {
        border-color: rgba(122, 243, 238, 0.4);
        background: rgba(245, 158, 11, 0.1);
    }

    .stat-item.duration {
        border-color: rgba(122, 243, 238, 0.4);
        background: rgba(16, 185, 129, 0.1);
    }

    .stat-value {
        font-size: clamp(1.2rem, 4vw, 1.6rem);
        font-weight: 900;
        display: block;
        margin-bottom: 0.25rem;
        background: linear-gradient(135deg, #00f2ea67 0%, #25f4ed52 25%, #ff0050 75%, #ff4fa3 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        animation: valueGlow 4s ease-in-out infinite;
    }

    .stat-label {
        font-size: clamp(0.7rem, 2vw, 0.8rem);
        color: var(--text-tertiary);
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    /* Video Streaming Area */
    .video-streaming-area {
        background: rgba(79, 70, 229, 0.08);
        border: 2px solid rgba(122, 243, 238, 0.22);
        border-radius: var(--radius-xl);
        padding: clamp(1.5rem, 4vw, 2.5rem);
        margin-bottom: 1.5rem;
        position: relative;
        overflow: hidden;
        box-shadow: var(--shadow-lg);
        backdrop-filter: blur(15px);
    }

    .video-streaming-area::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-image:
            linear-gradient(rgba(79, 70, 229, 0.05) 1px, transparent 1px),
            linear-gradient(90deg, rgba(139, 92, 246, 0.05) 1px, transparent 1px);
        background-size: 30px 30px;
        opacity: 0.6;
        pointer-events: none;
        z-index: 1;
        animation: gridMove 12s linear infinite;
    }

    .video-streaming-area::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(135deg, #00f2ea67 0%, #25f4ed52 25%, #ff0050 75%, #ff4fa3 100%);
        z-index: 2;
        animation: borderFlow 3s ease-in-out infinite;
    }

    .streaming-header {
        text-align: center;
        margin-bottom: 2rem;
        position: relative;
        z-index: 3;
    }

    .streaming-title {
        font-size: clamp(1rem, 3vw, 1.3rem);
        font-weight: 700;
        margin-bottom: 0.5rem;
        background: linear-gradient(135deg, #00f2ea67 0%, #25f4ed52 25%, #ff0050 75%, #ff4fa3 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        animation: titlePulse 4s ease-in-out infinite;
    }

    .streaming-subtitle {
        color: var(--text-tertiary);
        font-size: clamp(0.8rem, 2vw, 0.95rem);
        font-weight: 500;
    }

    /* Video Player */
    .video-player-wrapper {
        position: relative;
        width: 100%;
        max-width: min(380px, 90vw);
        margin: 0 auto;
        aspect-ratio: 9/16;
        border-radius: var(--radius-xl);
        overflow: hidden;
        box-shadow: var(--shadow-xl);
        background: #000;
        z-index: 3;
        border: 2px solid rgba(122, 243, 238, 0.22);
    }

    .video-thumbnail {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        z-index: 4;
        cursor: pointer;
        transition: var(--transition);
    }

    .video-thumbnail:hover,
    .video-thumbnail:active {
        transform: scale(1.02);
    }

    .thumbnail-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.4);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 5;
        cursor: pointer;
        transition: var(--transition);
        backdrop-filter: blur(2px);
    }

    .thumbnail-overlay:hover,
    .thumbnail-overlay:active {
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
    }

    .thumbnail-play-btn {
        width: clamp(60px, 15vw, 80px);
        height: clamp(60px, 15vw, 80px);
        background: linear-gradient(135deg, #00f2ea67 0%, #25f4ed52 25%, #ff0050 75%, #ff4fa3 100%);
        border: none;
        border-radius: 50%;
        color: white;
        font-size: clamp(1.5rem, 4vw, 2rem);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: var(--shadow-xl), 0 0 30px rgba(42, 240, 234, 0.3);
        transition: var(--transition);
        position: relative;
        overflow: hidden;
        animation: playButtonPulse 3s ease-in-out infinite;
        border: 2px solid rgba(255, 255, 255, 0.2);
        min-height: 44px;
    }

    .thumbnail-play-btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
        transform: translateX(-100%);
        transition: transform 0.6s;
    }

    .thumbnail-play-btn:hover::before,
    .thumbnail-play-btn:active::before {
        transform: translateX(100%);
    }

    .thumbnail-play-btn:hover,
    .thumbnail-play-btn:active {
        transform: scale(1.15);
        box-shadow: var(--shadow-xl), 0 0 40px rgba(42, 240, 234, 0.3);
    }

    .video-player {
        width: 100%;
        height: 100%;
        object-fit: contain;
        background: #000;
        position: relative;
        z-index: 2;
        display: none;
    }

    .video-player.playing {
        display: block;
    }

    .video-controls {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
        padding: clamp(1rem, 3vw, 1.5rem);
        transform: translateY(100%);
        transition: transform 0.4s ease;
        z-index: 10;
        backdrop-filter: blur(10px);
    }

    .video-player-wrapper:hover .video-controls,
    .video-controls.show {
        transform: translateY(0);
    }

    .progress-bar {
        width: 100%;
        height: clamp(4px, 1.5vw, 6px);
        background: rgba(255, 255, 255, 0.2);
        border-radius: var(--radius-sm);
        margin-bottom: 0.5rem;
        cursor: pointer;
        position: relative;
        overflow: hidden;
        min-height: 20px;
        display: flex;
        align-items: center;
    }

    .progress-fill {
        height: 100%;
        background: linear-gradient(135deg, #00f2ea67 0%, #25f4ed52 25%, #ff0050 75%, #ff4fa3 100%);
        border-radius: var(--radius-sm);
        width: 0%;
        transition: width 0.1s linear;
        box-shadow: 0 0 10px rgba(42, 240, 234, 0.4);
    }

    /* Video Time Display */
    .video-time {
        display: flex;
        justify-content: space-between;
        font-size: clamp(0.7rem, 2vw, 0.8rem);
        color: var(--text-tertiary);
        margin-bottom: 1rem;
    }

    .control-buttons {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .control-group {
        display: flex;
        align-items: center;
        gap: clamp(0.5rem, 2vw, 0.75rem);
        flex-wrap: wrap;
    }

    .control-btn {
        background: rgba(255, 255, 255, 0.15);
        border: none;
        color: white;
        width: clamp(40px, 10vw, 44px);
        height: clamp(40px, 10vw, 44px);
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: var(--transition);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        font-size: clamp(0.8rem, 2vw, 1rem);
        min-height: 44px;
        min-width: 44px;
    }

    .control-btn:hover,
    .control-btn:active {
        background: rgba(255, 255, 255, 0.25);
        transform: scale(1.1);
        box-shadow: var(--shadow-md);
    }

    .play-btn {
        width: clamp(50px, 12vw, 60px);
        height: clamp(50px, 12vw, 60px);
        background: linear-gradient(135deg, #00f2ea67 0%, #25f4ed52 25%, #ff0050 75%, #ff4fa3 100%);
        font-size: clamp(1rem, 3vw, 1.4rem);
        border: none;
        box-shadow: var(--shadow-lg), 0 0 30px rgba(42, 240, 234, 0.3);
    }

    .volume-control {
        display: flex;
        align-items: center;
        gap: clamp(0.3rem, 1.5vw, 0.5rem);
        flex-wrap: wrap;
    }

    .volume-slider {
        width: clamp(60px, 15vw, 80px);
        height: clamp(4px, 1.5vw, 6px);
        background: rgba(255, 255, 255, 0.2);
        border-radius: var(--radius-sm);
        cursor: pointer;
        position: relative;
        overflow: hidden;
        min-height: 20px;
        display: flex;
        align-items: center;
    }

    .volume-fill {
        height: 100%;
        background: linear-gradient(135deg, #00f2ea67 0%, #25f4ed52 25%, #ff0050 75%, #ff4fa3 100%);
        border-radius: var(--radius-sm);
        width: 100%;
        transition: width 0.1s ease;
        box-shadow: 0 0 8px rgba(42, 240, 234, 0.4);
    }

    /* Download Section */
    .download-section {
        background: rgba(16, 185, 129, 0.1);
        border: 2px solid rgba(122, 243, 238, 0.22);
        border-radius: var(--radius-xl);
        padding: clamp(1rem, 3vw, 1.5rem);
        margin-bottom: 1.5rem;
        box-shadow: var(--shadow-md);
        position: relative;
        overflow: hidden;
        backdrop-filter: blur(15px);
    }

    .download-section::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(135deg, #00f2ea67 0%, #25f4ed52 25%, #ff0050 75%, #ff4fa3 100%);
        animation: borderFlow 3s ease-in-out infinite;
    }

    .download-header {
        text-align: center;
        margin-bottom: clamp(0.8rem, 2.5vw, 1.2rem);
    }

    .download-title {
        font-size: clamp(1rem, 3vw, 1.2rem);
        font-weight: 700;
        margin-bottom: 0.25rem;
        background: linear-gradient(135deg, #00f2ea67 0%, #25f4ed52 25%, #ff0050 75%, #ff4fa3 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        animation: titlePulse 4s ease-in-out infinite;
        flex-wrap: wrap;
    }

    .download-subtitle {
        color: var(--text-tertiary);
        font-size: clamp(0.8rem, 2vw, 0.9rem);
    }

    .download-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: clamp(0.8rem, 2vw, 1rem);
    }

    .download-btn {
        background: linear-gradient(135deg, #00f2ea67 0%, #25f4ed52 25%, #ff0050 75%, #ff4fa3 100%);
        color: white;
        border: none;
        padding: clamp(0.8rem, 3vw, 1rem) clamp(1rem, 3vw, 1.5rem);
        border-radius: var(--radius-md);
        font-weight: 700;
        cursor: pointer;
        transition: var(--transition);
        display: flex;
        align-items: center;
        gap: 0.5rem;
        box-shadow: var(--shadow-md);
        font-size: clamp(0.8rem, 2vw, 0.95rem);
        animation: buttonGlow 5s ease-in-out infinite;
        border: 1px solid rgba(16, 185, 129, 0.3);
        min-height: 48px;
        text-align: center;
    }

    .download-btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
        transition: left 0.5s;
    }

    .download-btn:hover:not(:disabled)::before,
    .download-btn:active:not(:disabled)::before {
        left: 100%;
    }

    .download-btn:hover:not(:disabled),
    .download-btn:active:not(:disabled) {
        transform: translateY(-3px) scale(1.02);
        box-shadow: var(--shadow-lg), 0 0 20px rgba(42, 240, 234, 0.3);
    }

    .download-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
        animation: none;
    }

    .download-btn.hd {
        background: linear-gradient(135deg, #00f2ea67 0%, #25f4ed52 25%, #ff0050 75%, #ff4fa3 100%);
        border-color: rgba(245, 158, 11, 0.3);
    }

    .download-btn.hd:hover:not(:disabled),
    .download-btn.hd:active:not(:disabled) {
        box-shadow: var(--shadow-lg), 0 0 30px rgba(42, 240, 234, 0.3);
    }

    /* Audio Streaming Section */
    .audio-streaming {
        background: rgba(139, 92, 246, 0.12);
        border: 2px solid rgba(122, 243, 238, 0.22);
        border-radius: var(--radius-xl);
        padding: clamp(1rem, 3vw, 1.5rem);
        position: relative;
        overflow: hidden;
        box-shadow: var(--shadow-md);
        backdrop-filter: blur(15px);
    }

    .audio-streaming::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(135deg, #00f2ea67 0%, #25f4ed52 25%, #ff0050 75%, #ff4fa3 100%);
        animation: borderFlow 3s ease-in-out infinite;
    }

    .audio-header {
        text-align: center;
        margin-bottom: clamp(0.8rem, 2.5vw, 1.2rem);
    }

    .audio-main-title {
        font-size: clamp(1rem, 3vw, 1.2rem);
        font-weight: 700;
        margin-bottom: 0.25rem;
        background: linear-gradient(135deg, #00f2ea67 0%, #25f4ed52 25%, #ff0050 75%, #ff4fa3 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        animation: titlePulse 4s ease-in-out infinite;
        flex-wrap: wrap;
    }

    .audio-subtitle {
        color: var(--text-tertiary);
        font-size: clamp(0.8rem, 2vw, 0.9rem);
        margin-bottom: clamp(0.8rem, 2.5vw, 1.2rem);
    }

    .audio-player-section {
        display: flex;
        align-items: center;
        gap: clamp(0.8rem, 3vw, 1.2rem);
        margin-bottom: 1.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Audio Icon - Left Side, Smaller */
    .audio-icon-wrapper {
        position: relative;
        flex-shrink: 0;
    }

    .audio-icon {
        width: clamp(40px, 10vw, 50px);
        height: clamp(40px, 10vw, 50px);
        background: linear-gradient(135deg, #00f2ea67 0%, #25f4ed52 25%, #ff0050 75%, #ff4fa3 100%);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: clamp(1rem, 2.5vw, 1.2rem);
        color: white;
        box-shadow: var(--shadow-md);
        animation: audioIconPulse 4s ease-in-out infinite;
        position: relative;
        z-index: 2;
        border: 2px solid rgba(139, 92, 246, 0.3);
    }

    .audio-wave {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        border: 1px solid rgba(139, 92, 246, 0.2);
        border-radius: 50%;
        animation: audioWaveRipple 2s ease-out infinite;
    }

    .audio-wave:nth-child(1) {
        width: clamp(50px, 12vw, 60px);
        height: clamp(50px, 12vw, 60px);
        animation-delay: 0s;
    }

    .audio-wave:nth-child(2) {
        width: clamp(60px, 15vw, 75px);
        height: clamp(60px, 15vw, 75px);
        animation-delay: 0.5s;
    }

    .audio-wave:nth-child(3) {
        width: clamp(70px, 18vw, 90px);
        height: clamp(70px, 18vw, 90px);
        animation-delay: 1s;
    }

    .audio-info {
        flex: 1;
        min-width: 0;
        text-align: center;
    }

    .audio-title {
        font-size: clamp(0.9rem, 2.5vw, 1rem);
        font-weight: 700;
        color: var(--text-primary);
        margin-bottom: 0.25rem;
        word-break: break-word;
    }

    .audio-artist {
        font-size: clamp(0.75rem, 2vw, 0.85rem);
        color: var(--text-tertiary);
        margin-bottom: 1rem;
        word-break: break-word;
    }

    /* Audio Progress Bar */
    .audio-progress-container {
        width: 100%;
        margin-bottom: 1rem;
    }

    .audio-progress {
        height: clamp(6px, 2vw, 8px);
        background: rgba(139, 92, 246, 0.2);
        border-radius: var(--radius-md);
        position: relative;
        cursor: pointer;
        overflow: hidden;
        margin-bottom: 0.5rem;
        min-height: 20px;
        display: flex;
        align-items: center;
    }

    .audio-progress-fill {
        height: 100%;
        background: linear-gradient(135deg, #00f2ea67 0%, #25f4ed52 25%, #ff0050 75%, #ff4fa3 100%);
        border-radius: var(--radius-md);
        width: 0%;
        transition: width 0.1s ease;
        box-shadow: 0 0 10px rgba(42, 240, 234, 0.4);
    }

    .audio-time {
        display: flex;
        justify-content: space-between;
        font-size: clamp(0.7rem, 2vw, 0.8rem);
        color: var(--text-tertiary);
        margin-bottom: 1rem;
    }

    /* Audio Controls */
    .audio-controls {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: clamp(0.8rem, 3vw, 1rem);
        margin-bottom: 1rem;
        flex-wrap: wrap;
    }

    .audio-play-btn {
        width: clamp(44px, 10vw, 50px);
        height: clamp(44px, 10vw, 50px);
        background: linear-gradient(135deg, #00f2ea67 0%, #25f4ed52 25%, #ff0050 75%, #ff4fa3 100%);
        border: none;
        border-radius: 50%;
        color: white;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: var(--transition);
        box-shadow: var(--shadow-md);
        font-size: clamp(1rem, 2.5vw, 1.2rem);
        flex-shrink: 0;
        animation: audioPlayPulse 4s ease-in-out infinite;
        border: 2px solid rgba(139, 92, 246, 0.3);
        min-height: 44px;
        min-width: 44px;
    }

    .audio-play-btn:hover,
    .audio-play-btn:active {
        transform: scale(1.1);
        box-shadow: var(--shadow-lg), 0 0 20px rgba(42, 240, 234, 0.3);
    }

    /* Audio Volume Control */
    .audio-volume-control {
        display: flex;
        align-items: center;
        gap: clamp(0.5rem, 2vw, 0.75rem);
        flex-wrap: wrap;
    }

    .audio-volume-btn {
        background: rgba(139, 92, 246, 0.15);
        border: none;
        color: var(--secondary-light);
        width: clamp(36px, 8vw, 40px);
        height: clamp(36px, 8vw, 40px);
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: var(--transition);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(139, 92, 246, 0.2);
        font-size: clamp(0.8rem, 2vw, 1rem);
        min-height: 44px;
        min-width: 44px;
    }

    .audio-volume-btn:hover,
    .audio-volume-btn:active {
        background: rgba(139, 92, 246, 0.25);
        transform: scale(1.1);
        box-shadow: var(--shadow-md);
    }

    .audio-volume-slider {
        width: clamp(60px, 15vw, 80px);
        height: clamp(4px, 1.5vw, 6px);
        background: rgba(139, 92, 246, 0.2);
        border-radius: var(--radius-sm);
        cursor: pointer;
        position: relative;
        overflow: hidden;
        min-height: 20px;
        display: flex;
        align-items: center;
    }

    .audio-volume-fill {
        height: 100%;
        background: linear-gradient(135deg, #00f2ea67 0%, #25f4ed52 25%, #ff0050 75%, #ff4fa3 100%);
        border-radius: var(--radius-sm);
        width: 100%;
        transition: width 0.1s ease;
        box-shadow: 0 0 8px rgba(42, 240, 234, 0.4);
    }

    .download-audio-section {
        text-align: center;
    }

    .download-audio-btn {
        background: linear-gradient(135deg, #00f2ea67 0%, #25f4ed52 25%, #ff0050 75%, #ff4fa3 100%);
        color: white;
        border: none;
        padding: clamp(0.8rem, 3vw, 1rem) clamp(1rem, 3vw, 1.5rem);
        border-radius: var(--radius-md);
        font-weight: 700;
        cursor: pointer;
        transition: var(--transition);
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        box-shadow: var(--shadow-md);
        font-size: clamp(0.8rem, 2vw, 0.95rem);
        position: relative;
        overflow: hidden;
        animation: buttonGlow 5s ease-in-out infinite;
        border: 1px solid rgba(139, 92, 246, 0.3);
        min-height: 48px;
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    .download-audio-btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
        transition: left 0.5s;
    }

    .download-audio-btn:hover:not(:disabled)::before,
    .download-audio-btn:active:not(:disabled)::before {
        left: 100%;
    }

    .download-audio-btn:hover:not(:disabled),
    .download-audio-btn:active:not(:disabled) {
        transform: translateY(-3px) scale(1.02);
        box-shadow: var(--shadow-lg), 0 0 20px rgba(139, 92, 246, 0.5);
    }

    .download-audio-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
        animation: none;
    }

    /* Download Progress */
    .download-progress {
        position: fixed;
        bottom: 1.5rem;
        right: 1.5rem;
        background: var(--glass-bg);
        backdrop-filter: blur(20px);
        border: 1px solid var(--glass-border);
        border-radius: var(--radius-xl);
        padding: clamp(1rem, 3vw, 1.5rem) clamp(1.5rem, 4vw, 2rem);
        min-width: min(320px, 90vw);
        max-width: 90vw;
        box-shadow: var(--shadow-xl);
        z-index: 1000;
        display: none;
    }

    .download-progress.show {
        display: block;
        animation: slideInRight 0.4s ease-out;
    }

    .progress-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem;
        gap: 1rem;
        flex-wrap: wrap;
    }

    .progress-text {
        font-weight: 700;
        font-size: clamp(0.8rem, 2vw, 0.95rem);
        color: var(--text-primary);
        background: linear-gradient(135deg, #00f2ea67 0%, #25f4ed52 25%, #ff0050 75%, #ff4fa3 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        flex: 1;
        min-width: 0;
    }

    .cancel-btn {
        background: rgba(239, 68, 68, 0.15);
        border: 1px solid rgba(239, 68, 68, 0.3);
        color: var(--danger);
        padding: clamp(0.4rem, 1.5vw, 0.5rem) clamp(0.8rem, 2vw, 1rem);
        border-radius: var(--radius-md);
        font-size: clamp(0.7rem, 2vw, 0.8rem);
        cursor: pointer;
        transition: var(--transition);
        font-weight: 600;
        backdrop-filter: blur(10px);
        min-height: 36px;
        flex-shrink: 0;
    }

    .cancel-btn:hover,
    .cancel-btn:active {
        background: rgba(239, 68, 68, 0.25);
        transform: scale(1.05);
    }

    .progress-bar-container {
        width: 100%;
        height: clamp(6px, 2vw, 8px);
        background: rgba(139, 92, 246, 0.2);
        border-radius: var(--radius-md);
        overflow: hidden;
    }

    .progress-bar-fill {
        height: 100%;
        background: linear-gradient(135deg, #00f2ea67 0%, #25f4ed52 25%, #ff0050 75%, #ff4fa3 100%);
        border-radius: var(--radius-md);
        width: 0%;
        transition: width 0.3s ease;
        box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
        animation: progressGlow 3s ease-in-out infinite;
    }

    /* Error Message */
    .error-message {
        background: rgba(255, 79, 163, 0.1);
        border: 1px solid rgba(255, 79, 163, 0.2);
        color: var(--accent);
        padding: 16px 24px;
        border-radius: 12px;
        margin-top: 16px;
        display: none;
        align-items: center;
        gap: 12px;
        font-weight: 500;
    }

    /* Animations */
    @keyframes tiktok-aurora {
        0% { background-position: 0% 50%, 100% 50%, 50% 0%; }
        50% { background-position: 100% 50%, 0% 50%, 50% 100%; }
        100% { background-position: 0% 50%, 100% 50%, 50% 0%; }
    }

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

    @keyframes fadeInDown {
        from {
            opacity: 0;
            transform: translateY(-30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

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

    @keyframes pulse {
        0%, 100% {
            transform: scale(1);
            box-shadow: 0 25px 50px rgba(8, 4, 18, 0.3), 0 0 20px rgba(42, 240, 234, 0.3);
        }
        50% {
            transform: scale(1.05);
            box-shadow: 0 30px 60px rgba(8, 4, 18, 0.4), 0 0 30px rgba(42, 240, 234, 0.5);
        }
    }

    @keyframes bounce {
        0%, 80%, 100% {
            transform: scale(0);
        }
        40% {
            transform: scale(1);
        }
    }

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

  

    @media (max-height: 500px) and (orientation: landscape) {
        .container {
            padding: 1rem;
        }

        .header {
            margin-bottom: 1rem;
        }

        .logo {
            flex-direction: row;
            gap: 1rem;
        }

        .logo-icon {
            width: 40px;
            height: 40px;
            font-size: 16px;
        }

        .video-player-wrapper {
            max-width: min(200px, 30vw);
        }

        .video-stats {
            grid-template-columns: repeat(5, 1fr);
            gap: 0.5rem;
        }

        .stat-item {
            min-height: 60px;
            padding: 0.5rem;
        }

        .stat-value {
            font-size: 1rem;
        }

        .stat-label {
            font-size: 0.6rem;
        }
    }

    @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
        .logo-icon,
        .author-avatar,
        .audio-icon,
        .thumbnail-play-btn,
        .audio-play-btn {
            image-rendering: -webkit-optimize-contrast;
            image-rendering: crisp-edges;
        }
    }

    @media (prefers-reduced-motion: reduce) {
        *,
        *::before,
        *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }

        .video-player-wrapper,
        .search-section,
        .video-section,
        .download-section,
        .audio-streaming {
            animation: none !important;
        }
    }

    @media (prefers-contrast: high) {
        :root {
            --glass-bg: rgba(0, 0, 0, 0.9);
            --glass-border: rgba(255, 255, 255, 0.8);
            --shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
            --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.9);
            --shadow-xl: 0 16px 60px rgba(0, 0, 0, 1);
        }

        .input-field,
        .search-btn,
        .download-btn,
        .audio-play-btn {
            border: 2px solid var(--text-primary);
        }
    }

    @media (prefers-color-scheme: dark) {
        body {
            background: linear-gradient(135deg,
                    #000000 0%,
                    var(--bg-primary) 25%,
                    var(--bg-secondary) 50%,
                    var(--bg-tertiary) 75%,
                    var(--card-bg) 100%);
        }
    }

    @media print {
        body {
            background: white !important;
            color: black !important;
        }

        .container {
            max-width: none;
            padding: 0;
        }

        .video-player-wrapper,
        .download-section,
        .audio-streaming,
        .download-progress {
            display: none !important;
        }

        .search-section,
        .video-section {
            background: white !important;
            border: 1px solid black !important;
            box-shadow: none !important;
        }
			
			
	}
	
	/* Responsive adjustments for smaller screens */

/* Large devices (laptops, 992px and up) */
@media (max-width: 992px) {
    .container_tiktok {
        padding: 3rem;
    }

    .logo {
        gap: 1rem;
    }

    .logo-icon {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    .logo-text {
        font-size: 3rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .search-section,
    .loading,
    .video-section,
    .download-section,
    .audio-streaming {
        padding: 2rem;
    }

    .input-field {
        padding: 1.2rem 1.5rem !important;
        font-size: 1rem !important;
    }

    .paste-btn,
    .search-another-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .search-btn {
        padding: 1.2rem 2rem;
        font-size: 1rem;
    }

    .author-section {
        flex-direction: column;
        text-align: center;
    }

    .author-avatar {
        width: 55px;
        height: 55px;
    }

    .video-title {
        font-size: 1.4rem;
    }

    .video-stats {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.8rem;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .video-streaming-area {
        padding: 2rem;
    }

    .streaming-title {
        font-size: 1.2rem;
    }

    .streaming-subtitle {
        font-size: 0.9rem;
    }

    .video-player-wrapper {
        max-width: min(350px, 80vw);
    }

    .thumbnail-play-btn {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }

    .download-title,
    .audio-main-title {
        font-size: 1.1rem;
    }

    .download-subtitle,
    .audio-subtitle {
        font-size: 0.85rem;
    }

    .download-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 0.8rem;
    }

    .download-btn {
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
    }

    .audio-icon {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .audio-wave:nth-child(1) {
        width: 55px;
        height: 55px;
    }

    .audio-wave:nth-child(2) {
        width: 70px;
        height: 70px;
    }

    .audio-wave:nth-child(3) {
        width: 85px;
        height: 85px;
    }

    .audio-title {
        font-size: 0.95rem;
    }

    .audio-artist {
        font-size: 0.8rem;
    }

    .audio-play-btn {
        width: 46px;
        height: 46px;
        font-size: 1.1rem;
    }

    .audio-volume-btn {
        width: 38px;
        height: 38px;
        font-size: 0.9rem;
    }

    .download-audio-btn {
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
    }

    .download-progress {
        min-width: 280px;
        padding: 1rem 1.5rem;
    }

    .progress-text {
        font-size: 0.9rem;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (max-width: 768px) {
    .container_tiktok {
        padding: 2.5rem;
    }

    .logo-text {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 0.9rem;
        padding: 0 0.5rem;
    }

    .search-section,
    .loading,
    .video-section,
    .download-section,
    .audio-streaming {
        padding: 1.8rem;
    }

    .input-field {
        padding: 1rem 1.2rem !important;
        font-size: 0.95rem !important;
    }

    .input-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .paste-btn {
        width: 100%;
        justify-content: center;
        padding: 0.7rem 1rem;
        font-size: 0.8rem;
    }

    .action-buttons {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .search-btn,
    .search-another-btn {
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 0.95rem;
    }

    .loading-spinner {
        width: 80px;
        height: 80px;
    }

    .loading-text {
        font-size: 1.2rem;
    }

    .loading-subtext {
        font-size: 0.9rem;
    }

    .author-section {
        padding: 1rem;
    }

    .author-avatar {
        width: 50px;
        height: 50px;
    }

    .author-details h3 {
        font-size: 1.1rem;
    }

    .author-username {
        font-size: 0.9rem;
    }

    .video-title {
        font-size: 1.2rem;
        padding: 0 0.5rem;
    }

    .video-stats {
        grid-template-columns: repeat(2, 1fr); /* 2 columns for tablets */
        gap: 0.7rem;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .video-streaming-area {
        padding: 1.8rem;
    }

    .streaming-title {
        font-size: 1.1rem;
    }

    .streaming-subtitle {
        font-size: 0.85rem;
    }

    .video-player-wrapper {
        max-width: min(300px, 90vw);
    }

    .thumbnail-play-btn {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .control-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
    }

    .control-group {
        width: 100%;
        justify-content: center;
    }

    .download-grid {
        grid-template-columns: 1fr; /* Stack download buttons on smaller tablets */
    }

    .download-btn {
        width: 100%;
    }

    .audio-player-section {
        flex-direction: column;
        gap: 0.8rem;
    }

    .audio-icon-wrapper {
        margin-bottom: 0.5rem;
    }

    .audio-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .audio-wave:nth-child(1) {
        width: 50px;
        height: 50px;
    }

    .audio-wave:nth-child(2) {
        width: 65px;
        height: 65px;
    }

    .audio-wave:nth-child(3) {
        width: 80px;
        height: 80px;
    }

    .audio-title {
        font-size: 0.9rem;
    }

    .audio-artist {
        font-size: 0.75rem;
    }

    .audio-play-btn {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }

    .audio-volume-btn {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }

    .download-audio-btn {
        max-width: 100%;
    }

    .download-progress {
        bottom: 1rem;
        right: 1rem;
        min-width: unset;
        width: calc(100% - 2rem);
        padding: 0.8rem 1rem;
    }

    .progress-text {
        font-size: 0.85rem;
    }

    .cancel-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }
}

/* Small devices (phones, 600px and up) - also targets 600px */
@media (max-width: 600px) {
    .container_tiktok {
        padding: 2rem 1.5rem;
    }

    .logo-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .logo-text {
        font-size: 2rem;
        letter-spacing: -1px;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .search-section,
    .loading,
    .video-section,
    .download-section,
    .audio-streaming {
        padding: 1.5rem;
    }

    .input-field {
        padding: 0.9rem 1rem !important;
        font-size: 0.9rem !important;
    }

    .input-actions {
        margin-top: 0.8rem;
    }

    .paste-btn,
    .search-btn,
    .search-another-btn {
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
        min-height: 40px;
    }

    .search-btn {
        min-height: 50px;
    }

    .loading-spinner {
        width: 60px;
        height: 60px;
        margin-bottom: 1.5rem;
    }

    .loading-text {
        font-size: 1.1rem;
    }

    .loading-subtext {
        font-size: 0.8rem;
    }

    .author-section {
        padding: 0.8rem;
        gap: 0.8rem;
    }

    .author-avatar {
        width: 45px;
        height: 45px;
    }

    .author-details h3 {
        font-size: 1rem;
    }

    .author-username {
        font-size: 0.85rem;
    }

    .video-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .video-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .stat-item {
        padding: 0.8rem;
        min-height: 70px;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .video-streaming-area {
        padding: 1.5rem;
    }

    .streaming-title {
        font-size: 1rem;
    }

    .streaming-subtitle {
        font-size: 0.8rem;
    }

    .video-player-wrapper {
        max-width: min(280px, 90vw);
    }

    .thumbnail-play-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .download-title,
    .audio-main-title {
        font-size: 1rem;
        gap: 0.3rem;
    }

    .download-subtitle,
    .audio-subtitle {
        font-size: 0.8rem;
    }

    .download-btn {
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
        min-height: 44px;
    }

    .audio-icon {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    .audio-wave:nth-child(1) {
        width: 45px;
        height: 45px;
    }

    .audio-wave:nth-child(2) {
        width: 55px;
        height: 55px;
    }

    .audio-wave:nth-child(3) {
        width: 65px;
        height: 65px;
    }

    .audio-title {
        font-size: 0.85rem;
    }

    .audio-artist {
        font-size: 0.7rem;
    }

    .audio-play-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    .audio-volume-btn {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    .audio-volume-slider,
    .volume-slider {
        width: 50px;
    }

    .download-audio-btn {
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
        min-height: 44px;
    }

    .download-progress {
        bottom: 0.8rem;
        right: 0.8rem;
        padding: 0.6rem 0.8rem;
    }

    .progress-text {
        font-size: 0.8rem;
    }

    .cancel-btn {
        font-size: 0.65rem;
        min-height: 30px;
    }

    .error-message {
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
    }
}

/* Extra small devices (portrait phones, less than 576px) - targeting 400px and 375px */
@media (max-width: 400px) {
    .container_tiktok {
        padding: 1.5rem 1rem;
    }

    .logo {
        flex-direction: column;
        gap: 0.8rem;
    }

    .logo-icon {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .logo-text {
        font-size: 1.8rem;
        line-height: 1.2;
    }

    .subtitle {
        font-size: 0.8rem;
        margin-top: 0.3rem;
    }

    .search-section,
    .loading,
    .video-section,
    .download-section,
    .audio-streaming {
        padding: 1.2rem;
    }

    .input-field {
        padding: 0.8rem 0.9rem !important;
        font-size: 0.85rem !important;
    }

    .paste-btn,
    .search-btn,
    .search-another-btn {
        font-size: 0.8rem;
        padding: 0.7rem;
    }
    .search-btn {
        min-height: 45px;
    }

    .loading-text {
        font-size: 1rem;
    }

    .loading-subtext {
        font-size: 0.75rem;
    }

    .author-section {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.7rem;
    }

    .author-avatar {
        width: 40px;
        height: 40px;
    }

    .author-details h3 {
        font-size: 0.95rem;
    }

    .author-username {
        font-size: 0.8rem;
    }

    .video-title {
        font-size: 1rem;
        margin-bottom: 0.8rem;
        padding: 0 0.2rem;
    }

    .video-stats {
        grid-template-columns: 1fr; /* Stack stats on very small screens */
        gap: 0.4rem;
    }

    .stat-item {
        padding: 0.7rem;
        min-height: 60px;
    }

    .stat-value {
        font-size: 1rem;
    }

    .stat-label {
        font-size: 0.6rem;
    }

    .video-streaming-area {
        padding: 1.2rem;
    }

    .streaming-header {
        margin-bottom: 1rem;
    }

    .streaming-title {
        font-size: 0.95rem;
    }

    .streaming-subtitle {
        font-size: 0.75rem;
    }

    .video-player-wrapper {
        max-width: min(250px, 95vw);
        width: 100%; /* Ensure it takes full width of available space */
    }

    .thumbnail-play-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .control-btn, .play-btn {
        min-width: 36px;
        min-height: 36px;
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }
    .play-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    .video-time {
        font-size: 0.7rem;
        margin-bottom: 0.8rem;
    }

    .download-grid {
        gap: 0.5rem;
    }

    .download-btn {
        font-size: 0.8rem;
        min-height: 40px;
        padding: 0.6rem;
    }

    .audio-player-section {
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .audio-icon-wrapper {
        margin-bottom: 0;
    }

    .audio-icon {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }

    .audio-wave:nth-child(1) {
        width: 40px;
        height: 40px;
    }

    .audio-wave:nth-child(2) {
        width: 50px;
        height: 50px;
    }

    .audio-wave:nth-child(3) {
        width: 60px;
        height: 60px;
    }

    .audio-info {
        text-align: center;
    }

    .audio-title {
        font-size: 0.8rem;
    }

    .audio-artist {
        font-size: 0.65rem;
        margin-bottom: 0.8rem;
    }

    .audio-progress {
        min-height: 16px;
        height: 4px;
    }

    .audio-time {
        font-size: 0.65rem;
    }

    .audio-play-btn {
        width: 38px;
        height: 38px;
        font-size: 0.85rem;
        min-height: 38px;
        min-width: 38px;
    }

    .audio-volume-btn {
        width: 30px;
        height: 30px;
        font-size: 0.7rem;
        min-height: 30px;
        min-width: 30px;
    }

    .audio-volume-slider, .volume-slider {
        width: 40px;
        min-height: 16px;
        height: 4px;
    }

    .download-audio-btn {
        font-size: 0.8rem;
        min-height: 40px;
        padding: 0.6rem;
    }

    .download-progress {
        bottom: 0.5rem;
        right: 0.5rem;
        padding: 0.5rem 0.6rem;
        min-width: unset;
        width: calc(100% - 1rem);
    }

    .progress-header {
        margin-bottom: 0.6rem;
        gap: 0.5rem;
    }

    .progress-text {
        font-size: 0.75rem;
    }

    .cancel-btn {
        padding: 0.2rem 0.5rem;
        font-size: 0.6rem;
    }

    .progress-bar-container {
        height: 5px;
    }

    .error-message {
        padding: 0.7rem 0.9rem;
        font-size: 0.8rem;
        gap: 0.5rem;
    }
}

/* Specific adjustment for 375px width */
@media (max-width: 375px) {
    .container_tiktok {
        padding: 1.2rem 0.8rem;
    }

    .logo-text {
        font-size: 1.6rem;
    }

    .subtitle {
        font-size: 0.75rem;
    }

    .search-section,
    .loading,
    .video-section,
    .download-section,
    .audio-streaming {
        padding: 1rem;
    }

    .input-field {
        padding: 0.7rem 0.8rem !important;
        font-size: 0.8rem !important;
    }

    .paste-btn,
    .search-btn,
    .search-another-btn {
        font-size: 0.75rem;
        padding: 0.5rem;
    }
    .search-btn {
        min-height: 40px;
    }

    .loading-spinner {
        width: 50px;
        height: 50px;
    }

    .loading-text {
        font-size: 0.9rem;
    }

    .loading-subtext {
        font-size: 0.7rem;
    }

    .author-avatar {
        width: 35px;
        height: 35px;
    }

    .author-details h3 {
        font-size: 0.9rem;
    }

    .author-username {
        font-size: 0.75rem;
    }

    .video-title {
        font-size: 0.9rem;
        margin-bottom: 0.6rem;
    }

    .stat-item {
        padding: 0.6rem;
        min-height: 55px;
    }

    .stat-value {
        font-size: 0.9rem;
    }

    .stat-label {
        font-size: 0.55rem;
    }

    .video-streaming-area {
        padding: 1rem;
    }

    .streaming-title {
        font-size: 0.9rem;
    }

    .streaming-subtitle {
        font-size: 0.7rem;
    }

    .video-player-wrapper {
        max-width: min(220px, 95vw);
    }

    .thumbnail-play-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .download-title,
    .audio-main-title {
        font-size: 0.9rem;
    }

    .download-subtitle,
    .audio-subtitle {
        font-size: 0.75rem;
    }

    .download-btn {
        font-size: 0.75rem;
        min-height: 38px;
        padding: 0.5rem;
    }

    .audio-icon {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .audio-wave:nth-child(1) {
        width: 38px;
        height: 38px;
    }

    .audio-wave:nth-child(2) {
        width: 48px;
        height: 48px;
    }

    .audio-wave:nth-child(3) {
        width: 58px;
        height: 58px;
    }

    .audio-title {
        font-size: 0.75rem;
    }

    .audio-artist {
        font-size: 0.6rem;
    }

    .audio-play-btn {
        width: 35px;
        height: 35px;
        font-size: 0.8rem;
        min-height: 35px;
        min-width: 35px;
    }

    .audio-volume-btn {
        width: 28px;
        height: 28px;
        font-size: 0.65rem;
        min-height: 28px;
        min-width: 28px;
    }

    .download-audio-btn {
        font-size: 0.75rem;
        min-height: 38px;
        padding: 0.5rem;
    }

    .progress-text {
        font-size: 0.7rem;
    }

    .cancel-btn {
        font-size: 0.55rem;
        min-height: 28px;
    }

    .error-message {
        padding: 0.6rem 0.8rem;
        font-size: 0.75rem;
    }
}

/* --- Codex CSS updates --- */
:root {
    --primary: #25f4ee;
    --primary-glow: rgba(37, 244, 238, 0.32);
    --accent: #ff2f6d;
    --accent-purple: #7c3aed;
    --success: #10b981;
    --error: #ef4444;
    --danger: #ef4444;
    --secondary-light: #dffefe;
    --white: #ffffff;
    --gray-100: #f8fbff;
    --gray-300: #d7e4ee;
    --gray-500: #91a4b7;
    --gray-800: #172033;
    --gray-900: #070a12;
    --glass-bg: rgba(10, 16, 28, 0.78);
    --glass-border: rgba(37, 244, 238, 0.22);
    --shadow-md: 0 14px 32px rgba(0, 0, 0, 0.26);
    --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.42);
    --shadow-xl: 0 32px 72px rgba(0, 0, 0, 0.5);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 18px;
    --transition: all 0.3s cubic-bezier(.23, 1.02, .67, 1.01);
    --text-primary: #ffffff;
    --text-secondary: #d7e4ee;
    --text-tertiary: #a7b7c8;
    --text-muted: #91a4b7;
    --border-color: rgba(37, 244, 238, 0.22);
    --bg-primary: #070a12;
    --bg-secondary: #0f1827;
    --bg-tertiary: #1a1024;
    --card-bg: rgba(10, 16, 28, 0.82);
}

.uicore-page-title .uicore h1.uicore-title {
    margin: .4em 0;
    display: none;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.tiktok_body {
    font-family: 'Inter', sans-serif;
    position: relative;
    z-index: 0;
    min-height: 100vh;
    width: 100%;
    color: var(--gray-100);
    line-height: 1.6;
    padding: 24px 16px;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 10% 12%, rgba(37, 244, 238, 0.24), transparent 34%),
        radial-gradient(circle at 88% 14%, rgba(255, 47, 109, 0.25), transparent 38%),
        radial-gradient(circle at 76% 82%, rgba(124, 58, 237, 0.18), transparent 42%),
        linear-gradient(136deg, #05070d 0%, #0b1020 28%, #111827 52%, #1c1028 78%, #070a12 100%);
    background-size: 190% 190%, 180% 180%, 220% 220%, 240% 240%;
    animation: tiktok-aurora 16s ease-in-out infinite;
}

.tiktok_body::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(160deg, rgba(0, 0, 0, 0.38), rgba(10, 16, 28, 0.18)),
        radial-gradient(circle at 18% 18%, rgba(37, 244, 238, 0.08), transparent 52%),
        radial-gradient(circle at 82% 76%, rgba(255, 47, 109, 0.08), transparent 48%);
    opacity: 1;
}

.container_tiktok {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 0;
    position: relative;
    z-index: 1;
}

.header {
    text-align: center;
    margin-bottom: 2.5rem;
    animation: fadeInDown 1s ease-out;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.logo-icon {
    width: 76px;
    height: 76px;
    background: linear-gradient(135deg, #25f4ee 0%, #0ea5e9 32%, #ff2f6d 74%, #7c3aed 100%);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: 900;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3), 0 0 24px rgba(37, 244, 238, 0.26);
    position: relative;
    overflow: hidden;
    animation: pulse 2s ease-in-out infinite;
}

.logo-text {
    font-size: clamp(1.9rem, 5vw, 3rem);
    font-weight: 900;
    background: linear-gradient(135deg, #25f4ee 0%, #ffffff 34%, #ff2f6d 72%, #b794f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0;
    font-family: 'Inter', sans-serif;
    display: block;
    width: 100%;
    text-align: center;
    line-height: 1.12;
}

.subtitle {
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 0.5rem;
    text-align: center;
    padding: 0 1rem;
}

.search-section,
.loading,
.video-section {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(145%) contrast(1.05);
    -webkit-backdrop-filter: blur(20px) saturate(145%) contrast(1.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.search-section {
    padding: clamp(24px, 5vw, 48px);
    margin-bottom: 32px;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
    z-index: 2;
}

.input-field {
    width: 100% !important;
    padding: clamp(16px, 3vw, 20px) clamp(18px, 4vw, 24px) !important;
    border: 1px solid rgba(37, 244, 238, 0.24) !important;
    border-radius: var(--radius-lg) !important;
    font-size: clamp(14px, 2.5vw, 16px) !important;
    font-weight: 500 !important;
    background: rgba(5, 8, 15, 0.78) !important;
    color: var(--white) !important;
    transition: var(--transition) !important;
}

.input-field:focus {
    outline: none !important;
    border-color: rgba(37, 244, 238, 0.82) !important;
    background: rgba(9, 14, 25, 0.88) !important;
    box-shadow: 0 0 0 4px rgba(37, 244, 238, 0.14), 0 10px 24px rgba(0, 0, 0, 0.28) !important;
}

.input-field::placeholder {
    color: rgba(255, 255, 255, 0.52);
}

.input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    color: var(--text-tertiary);
    z-index: 2;
    position: relative;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.paste-btn,
.search-another-btn,
.cancel-btn {
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.paste-btn,
.search-another-btn {
    background: rgba(20, 31, 50, 0.92);
    color: white;
    border: 1px solid rgba(37, 244, 238, 0.24);
    box-shadow: var(--shadow-md);
    padding: 14px 16px;
    font-size: clamp(0.85rem, 2.5vw, 1rem);
}

.paste-btn:hover,
.search-another-btn:hover {
    transform: translateY(-2px);
    background: rgba(28, 43, 68, 0.96);
    border-color: rgba(37, 244, 238, 0.42);
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: center;
    z-index: 2;
    position: relative;
}

.search-btn,
.download-btn,
.download-audio-btn {
    background: linear-gradient(135deg, #25f4ee 0%, #0ea5e9 35%, #ff2f6d 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-md);
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md), 0 0 20px rgba(37, 244, 238, 0.22);
}

.search-btn {
    min-width: 200px;
    padding: clamp(16px, 3vw, 20px) clamp(24px, 5vw, 32px);
    font-size: clamp(0.9rem, 2.5vw, 1rem);
}

.search-btn::before,
.download-btn::before,
.download-audio-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.5s;
}

.search-btn:hover:not(:disabled)::before,
.download-btn:hover:not(:disabled)::before,
.download-audio-btn:hover:not(:disabled)::before {
    left: 100%;
}

.search-btn:hover:not(:disabled),
.download-btn:hover:not(:disabled),
.download-audio-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    background: linear-gradient(135deg, #13d8d3 0%, #2563eb 34%, #ff2f6d 100%);
    box-shadow: 0 14px 32px rgba(255, 47, 109, 0.28), 0 0 24px rgba(37, 244, 238, 0.24);
}

.search-btn:disabled,
.download-btn:disabled,
.download-audio-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    animation: none;
}

.search-another-btn {
    margin-top: 16px;
    width: 100%;
}

.loading {
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 60px 40px;
    margin: 32px 0;
    text-align: center;
}

.loading-spinner,
.loading-animation {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
}

.spinner-ring,
.loading-ring {
    position: absolute;
    border: 4px solid transparent;
    border-radius: 50%;
    animation: spin 2s linear infinite;
}

.spinner-ring:nth-child(1),
.loading-ring:nth-child(1) {
    width: 120px;
    height: 120px;
    border-top-color: var(--primary);
}

.spinner-ring:nth-child(2),
.loading-ring:nth-child(2) {
    width: 90px;
    height: 90px;
    top: 15px;
    left: 15px;
    border-right-color: var(--accent);
    animation-duration: 1.5s;
    animation-direction: reverse;
}

.spinner-ring:nth-child(3),
.loading-ring:nth-child(3) {
    width: 60px;
    height: 60px;
    top: 30px;
    left: 30px;
    border-bottom-color: var(--accent-purple);
    animation-duration: 1s;
}

.loading-content {
    text-align: center;
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.loading-dot {
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #25f4ee 0%, #ff2f6d 100%);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }
.loading-dot:nth-child(3) { animation-delay: 0s; }

.loading-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.loading-subtext {
    font-size: 14px;
    color: var(--text-secondary);
}

.video-section {
    display: none;
    animation: fadeInUp 0.8s ease-out;
    padding: clamp(20px, 4vw, 32px);
    margin-bottom: 32px;
}

.author-section {
    display: flex;
    align-items: center;
    gap: clamp(0.8rem, 3vw, 1.2rem);
    margin-bottom: 1.5rem;
    padding: clamp(1rem, 3vw, 1.5rem);
    background: rgba(37, 244, 238, 0.08);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(37, 244, 238, 0.24);
    width: 100%;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
}

.author-section:hover,
.author-section:active {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(37, 244, 238, 0.18);
}

.author-avatar {
    width: clamp(50px, 12vw, 60px);
    height: clamp(50px, 12vw, 60px);
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid transparent;
    background: linear-gradient(135deg, #25f4ee 0%, #ff2f6d 100%);
    padding: 2px;
    box-shadow: var(--shadow-md);
    animation: avatarPulse 4s ease-in-out infinite;
    flex-shrink: 0;
}

.author-details {
    flex: 1;
    min-width: 0;
}

.author-details h3 {
    font-size: clamp(1rem, 3vw, 1.2rem);
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
    word-break: break-word;
}

.author-username {
    color: var(--text-tertiary);
    font-size: clamp(0.8rem, 2.5vw, 0.95rem);
    font-weight: 500;
    word-break: break-word;
}

.video-title {
    font-size: clamp(1.2rem, 4vw, 1.6rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.4;
    color: var(--text-primary);
    width: 100%;
    text-align: center;
    word-break: break-word;
    padding: 0 1rem;
}

.video-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: clamp(0.5rem, 2vw, 1rem);
    margin-bottom: 2rem;
}

.stat-item {
    background: rgba(15, 24, 39, 0.86);
    padding: clamp(0.8rem, 3vw, 1.2rem);
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid rgba(37, 244, 238, 0.22);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(15px);
}

.stat-item::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 -100%;
    width: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 244, 238, 0.18), transparent);
    transition: left 0.6s;
}

.stat-item:hover::before,
.stat-item:active::before {
    left: 100%;
}

.stat-item:hover,
.stat-item:active {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(37, 244, 238, 0.18);
}

.stat-item.views,
.stat-item.likes,
.stat-item.comments,
.stat-item.shares,
.stat-item.duration {
    border-color: rgba(37, 244, 238, 0.34);
}

.stat-item.views { background: rgba(37, 244, 238, 0.08); }
.stat-item.likes { background: rgba(255, 47, 109, 0.09); }
.stat-item.comments { background: rgba(124, 58, 237, 0.1); }
.stat-item.shares { background: rgba(14, 165, 233, 0.09); }
.stat-item.duration { background: rgba(16, 185, 129, 0.09); }

.stat-value {
    font-size: clamp(1.2rem, 4vw, 1.6rem);
    font-weight: 900;
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
    animation: valueGlow 4s ease-in-out infinite;
}

.stat-label {
    font-size: clamp(0.7rem, 2vw, 0.8rem);
    color: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.video-streaming-area,
.download-section,
.audio-streaming {
    border: 1px solid rgba(37, 244, 238, 0.22);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(15px);
}

.video-streaming-area {
    background: rgba(37, 244, 238, 0.06);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    margin-bottom: 1.5rem;
}

.video-streaming-area::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(37, 244, 238, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 47, 109, 0.04) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.6;
    pointer-events: none;
    z-index: 1;
    animation: gridMove 12s linear infinite;
}

.video-streaming-area::after,
.download-section::before,
.audio-streaming::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #25f4ee 0%, #0ea5e9 35%, #ff2f6d 100%);
    z-index: 2;
    animation: borderFlow 3s ease-in-out infinite;
}

.streaming-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 3;
}

.streaming-title,
.download-title,
.audio-main-title {
    font-size: clamp(1rem, 3vw, 1.25rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    animation: titlePulse 4s ease-in-out infinite;
}

.streaming-subtitle,
.download-subtitle,
.audio-subtitle {
    color: var(--text-tertiary);
    font-size: clamp(0.8rem, 2vw, 0.95rem);
    font-weight: 500;
}

.video-player-wrapper {
    position: relative;
    width: 100%;
    max-width: min(380px, 90vw);
    margin: 0 auto;
    aspect-ratio: 9/16;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    background: #000;
    z-index: 3;
    border: 1px solid rgba(37, 244, 238, 0.28);
}

.video-thumbnail {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 4;
    cursor: pointer;
    transition: var(--transition);
}

.video-thumbnail:hover,
.video-thumbnail:active {
    transform: scale(1.02);
}

.thumbnail-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(2px);
}

.thumbnail-overlay:hover,
.thumbnail-overlay:active {
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(4px);
}

.thumbnail-play-btn,
.audio-play-btn,
.play-btn {
    background: linear-gradient(135deg, #25f4ee 0%, #ff2f6d 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.thumbnail-play-btn {
    width: clamp(60px, 15vw, 80px);
    height: clamp(60px, 15vw, 80px);
    border-radius: 50%;
    font-size: clamp(1.5rem, 4vw, 2rem);
    box-shadow: var(--shadow-xl), 0 0 30px rgba(37, 244, 238, 0.26);
    position: relative;
    overflow: hidden;
    animation: playButtonPulse 3s ease-in-out infinite;
    border: 2px solid rgba(255, 255, 255, 0.2);
    min-height: 44px;
}

.thumbnail-play-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.thumbnail-play-btn:hover::before,
.thumbnail-play-btn:active::before {
    transform: translateX(100%);
}

.thumbnail-play-btn:hover,
.thumbnail-play-btn:active {
    transform: scale(1.15);
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    position: relative;
    z-index: 2;
    display: none;
}

.video-player.playing {
    display: block;
}

.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    padding: clamp(1rem, 3vw, 1.5rem);
    transform: translateY(100%);
    transition: transform 0.4s ease;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.video-player-wrapper:hover .video-controls,
.video-controls.show {
    transform: translateY(0);
}

.progress-bar,
.volume-slider,
.audio-progress,
.audio-volume-slider,
.progress-bar-container {
    background: rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-sm);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.progress-bar {
    width: 100%;
    height: clamp(4px, 1.5vw, 6px);
    margin-bottom: 0.5rem;
    min-height: 20px;
    display: flex;
    align-items: center;
}

.progress-fill,
.volume-fill,
.audio-progress-fill,
.audio-volume-fill,
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(135deg, #25f4ee 0%, #ff2f6d 100%);
    border-radius: inherit;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px rgba(37, 244, 238, 0.35);
}

.progress-fill,
.audio-progress-fill {
    width: 0%;
}

.volume-fill,
.audio-volume-fill {
    width: 100%;
}

.video-time,
.audio-time {
    display: flex;
    justify-content: space-between;
    font-size: clamp(0.7rem, 2vw, 0.8rem);
    color: var(--text-tertiary);
    margin-bottom: 1rem;
}

.control-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.control-group,
.volume-control,
.audio-volume-control {
    display: flex;
    align-items: center;
    gap: clamp(0.5rem, 2vw, 0.75rem);
    flex-wrap: wrap;
}

.control-btn,
.audio-volume-btn {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: white;
    width: clamp(40px, 10vw, 44px);
    height: clamp(40px, 10vw, 44px);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    font-size: clamp(0.8rem, 2vw, 1rem);
    min-height: 44px;
    min-width: 44px;
}

.control-btn:hover,
.control-btn:active,
.audio-volume-btn:hover,
.audio-volume-btn:active {
    background: rgba(255, 255, 255, 0.24);
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.play-btn {
    width: clamp(50px, 12vw, 60px);
    height: clamp(50px, 12vw, 60px);
    font-size: clamp(1rem, 3vw, 1.4rem);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(37, 244, 238, 0.24);
}

.volume-slider,
.audio-volume-slider {
    width: clamp(60px, 15vw, 80px);
    height: clamp(4px, 1.5vw, 6px);
    min-height: 20px;
    display: flex;
    align-items: center;
}

.download-section {
    background: rgba(16, 185, 129, 0.08);
    padding: clamp(1rem, 3vw, 1.5rem);
    margin-bottom: 1.5rem;
}

.download-header,
.audio-header {
    text-align: center;
    margin-bottom: clamp(0.8rem, 2.5vw, 1.2rem);
}

.download-title,
.audio-main-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: clamp(0.8rem, 2vw, 1rem);
}

.download-btn {
    padding: clamp(0.8rem, 3vw, 1rem) clamp(1rem, 3vw, 1.5rem);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: clamp(0.8rem, 2vw, 0.95rem);
    animation: buttonGlow 5s ease-in-out infinite;
    min-height: 48px;
    text-align: center;
}

.download-btn.hd {
    background: linear-gradient(135deg, #7c3aed 0%, #0ea5e9 40%, #ff2f6d 100%);
}

.audio-streaming {
    background: rgba(124, 58, 237, 0.1);
    padding: clamp(1rem, 3vw, 1.5rem);
}

.audio-player-section {
    display: flex;
    align-items: center;
    gap: clamp(0.8rem, 3vw, 1.2rem);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.audio-icon-wrapper {
    position: relative;
    flex-shrink: 0;
}

.audio-icon {
    width: clamp(40px, 10vw, 50px);
    height: clamp(40px, 10vw, 50px);
    background: linear-gradient(135deg, #25f4ee 0%, #ff2f6d 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: white;
    box-shadow: var(--shadow-md);
    animation: audioIconPulse 4s ease-in-out infinite;
    position: relative;
    z-index: 2;
    border: 2px solid rgba(124, 58, 237, 0.3);
}

.audio-wave {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(37, 244, 238, 0.24);
    border-radius: 50%;
    animation: audioWaveRipple 2s ease-out infinite;
}

.audio-wave:nth-child(1) {
    width: clamp(50px, 12vw, 60px);
    height: clamp(50px, 12vw, 60px);
    animation-delay: 0s;
}

.audio-wave:nth-child(2) {
    width: clamp(60px, 15vw, 75px);
    height: clamp(60px, 15vw, 75px);
    animation-delay: 0.5s;
}

.audio-wave:nth-child(3) {
    width: clamp(70px, 18vw, 90px);
    height: clamp(70px, 18vw, 90px);
    animation-delay: 1s;
}

.audio-info {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.audio-title {
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.audio-artist {
    font-size: clamp(0.75rem, 2vw, 0.85rem);
    color: var(--text-tertiary);
    margin-bottom: 1rem;
    word-break: break-word;
}

.audio-progress-container {
    width: 100%;
    margin-bottom: 1rem;
}

.audio-progress {
    height: clamp(6px, 2vw, 8px);
    margin-bottom: 0.5rem;
    min-height: 20px;
    display: flex;
    align-items: center;
}

.audio-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.8rem, 3vw, 1rem);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.audio-play-btn {
    width: clamp(44px, 10vw, 50px);
    height: clamp(44px, 10vw, 50px);
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    flex-shrink: 0;
    animation: audioPlayPulse 4s ease-in-out infinite;
    min-height: 44px;
    min-width: 44px;
}

.audio-play-btn:hover,
.audio-play-btn:active {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(37, 244, 238, 0.25);
}

.audio-volume-btn {
    color: var(--secondary-light);
}

.download-audio-section {
    text-align: center;
}

.download-audio-btn {
    padding: clamp(0.8rem, 3vw, 1rem) clamp(1rem, 3vw, 1.5rem);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: clamp(0.8rem, 2vw, 0.95rem);
    animation: buttonGlow 5s ease-in-out infinite;
    min-height: 48px;
    width: 100%;
    max-width: 300px;
    justify-content: center;
}

.download-progress {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: clamp(1rem, 3vw, 1.5rem) clamp(1.5rem, 4vw, 2rem);
    min-width: min(320px, 90vw);
    max-width: 90vw;
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    display: none;
}

.download-progress.show {
    display: block;
    animation: slideInRight 0.4s ease-out;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.progress-text {
    font-weight: 700;
    font-size: clamp(0.8rem, 2vw, 0.95rem);
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
}

.cancel-btn {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
    padding: clamp(0.4rem, 1.5vw, 0.5rem) clamp(0.8rem, 2vw, 1rem);
    font-size: clamp(0.7rem, 2vw, 0.8rem);
    backdrop-filter: blur(10px);
    min-height: 36px;
    flex-shrink: 0;
}

.cancel-btn:hover,
.cancel-btn:active {
    background: rgba(239, 68, 68, 0.25);
    transform: scale(1.05);
}

.progress-bar-container {
    width: 100%;
    height: clamp(6px, 2vw, 8px);
}

.progress-bar-fill {
    width: 0%;
    transition: width 0.3s ease;
    animation: progressGlow 3s ease-in-out infinite;
}

.error-message {
    background: rgba(255, 47, 109, 0.1);
    border: 1px solid rgba(255, 47, 109, 0.24);
    color: #ff8aad;
    padding: 16px 24px;
    border-radius: 12px;
    margin-top: 16px;
    display: none;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.fab,
.fas {
    display: inline-block;
    line-height: 1;
    font-style: normal;
    flex-shrink: 0;
}

.fa-tiktok,
.fa-paste,
.fa-play-circle,
.fa-search,
.fa-exclamation-triangle,
.fa-play,
.fa-pause,
.fa-volume-up,
.fa-volume-mute,
.fa-expand,
.fa-compress,
.fa-download,
.fa-hd-video,
.fa-music {
    line-height: 1;
}

.fa-tiktok { color: #ffffff; }
.fa-paste { color: currentColor; }
.fa-play-circle { color: currentColor; }
.fa-search { color: currentColor; }
.fa-exclamation-triangle { color: currentColor; }
.fa-play { color: currentColor; }
.fa-pause { color: currentColor; }
.fa-volume-up { color: currentColor; }
.fa-volume-mute { color: currentColor; }
.fa-expand { color: currentColor; }
.fa-compress { color: currentColor; }
.fa-download { color: currentColor; }
.fa-hd-video { color: currentColor; }
.fa-music { color: currentColor; }

button:focus-visible,
.input-field:focus-visible,
.video-thumbnail:focus-visible {
    outline: 3px solid rgba(37, 244, 238, 0.55);
    outline-offset: 3px;
}

@keyframes tiktok-aurora {
    0% { background-position: 0% 50%, 100% 50%, 50% 0%, 0% 50%; }
    50% { background-position: 100% 50%, 0% 50%, 50% 100%, 100% 50%; }
    100% { background-position: 0% 50%, 100% 50%, 50% 0%, 0% 50%; }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3), 0 0 20px rgba(37, 244, 238, 0.26); }
    50% { transform: scale(1.05); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), 0 0 30px rgba(255, 47, 109, 0.32); }
}
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes avatarPulse { 0%, 100% { box-shadow: 0 0 0 rgba(37, 244, 238, 0); } 50% { box-shadow: 0 0 22px rgba(37, 244, 238, 0.22); } }
@keyframes valueGlow { 0%, 100% { opacity: 1; } 50% { opacity: 0.86; } }
@keyframes gridMove { from { background-position: 0 0; } to { background-position: 30px 30px; } }
@keyframes borderFlow { 0%, 100% { opacity: 0.75; } 50% { opacity: 1; } }
@keyframes titlePulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.15); } }
@keyframes playButtonPulse { 0%, 100% { box-shadow: var(--shadow-xl), 0 0 22px rgba(37, 244, 238, 0.24); } 50% { box-shadow: var(--shadow-xl), 0 0 34px rgba(255, 47, 109, 0.34); } }
@keyframes buttonGlow { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.08); } }
@keyframes audioIconPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes audioWaveRipple { 0% { opacity: 0.65; transform: translate(-50%, -50%) scale(0.85); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.25); } }
@keyframes audioPlayPulse { 0%, 100% { box-shadow: var(--shadow-md), 0 0 0 rgba(37, 244, 238, 0); } 50% { box-shadow: var(--shadow-lg), 0 0 22px rgba(37, 244, 238, 0.26); } }
@keyframes progressGlow { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.16); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }

@media (max-height: 500px) and (orientation: landscape) {
    .container_tiktok {
        padding: 1rem 0;
    }

    .header {
        margin-bottom: 1rem;
    }

    .logo {
        flex-direction: row;
        gap: 1rem;
    }

    .logo-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .video-player-wrapper {
        max-width: min(200px, 30vw);
    }

    .video-stats {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.5rem;
    }

    .stat-item {
        min-height: 60px;
        padding: 0.5rem;
    }

    .stat-value {
        font-size: 1rem;
    }

    .stat-label {
        font-size: 0.6rem;
    }
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-icon,
    .author-avatar,
    .audio-icon,
    .thumbnail-play-btn,
    .audio-play-btn {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .video-player-wrapper,
    .search-section,
    .video-section,
    .download-section,
    .audio-streaming {
        animation: none !important;
    }
}

@media (prefers-contrast: high) {
    :root {
        --glass-bg: rgba(0, 0, 0, 0.9);
        --glass-border: rgba(255, 255, 255, 0.8);
        --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.8);
        --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.9);
        --shadow-xl: 0 16px 60px rgba(0, 0, 0, 1);
    }

    .input-field,
    .search-btn,
    .download-btn,
    .audio-play-btn {
        border: 2px solid var(--text-primary);
    }
}

@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #000000 0%, var(--bg-primary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%, var(--card-bg) 100%);
    }
}

@media print {
    body {
        background: white !important;
        color: black !important;
    }

    .container_tiktok {
        max-width: none;
        padding: 0;
    }

    .video-player-wrapper,
    .download-section,
    .audio-streaming,
    .download-progress {
        display: none !important;
    }

    .search-section,
    .video-section {
        background: white !important;
        border: 1px solid black !important;
        box-shadow: none !important;
    }
}

@media (max-width: 992px) {
    .tiktok_body {
        padding: 20px 14px;
    }

    .container_tiktok {
        padding: 28px 0;
    }

    .logo {
        gap: 1rem;
    }

    .logo-icon {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    .logo-text {
        font-size: clamp(2rem, 7vw, 2.6rem);
    }

    .subtitle {
        font-size: 1rem;
    }

    .search-section,
    .loading,
    .video-section,
    .download-section,
    .audio-streaming {
        padding: 2rem;
    }

    .input-field {
        padding: 1.2rem 1.5rem !important;
        font-size: 1rem !important;
    }

    .paste-btn,
    .search-another-btn {
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
    }

    .search-btn {
        padding: 1.2rem 2rem;
        font-size: 1rem;
    }

    .author-section {
        flex-direction: column;
        text-align: center;
    }

    .video-stats {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.8rem;
    }

    .video-streaming-area {
        padding: 2rem;
    }

    .video-player-wrapper {
        max-width: min(350px, 80vw);
    }

    .download-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .download-progress {
        min-width: 280px;
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .tiktok_body {
        padding: 18px 12px;
    }

    .container_tiktok {
        padding: 24px 0;
    }

    .logo-text {
        font-size: clamp(1.8rem, 8vw, 2.35rem);
    }

    .subtitle {
        font-size: 0.9rem;
        padding: 0 0.5rem;
    }

    .search-section,
    .loading,
    .video-section,
    .download-section,
    .audio-streaming {
        padding: 1.5rem;
    }

    .input-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .paste-btn,
    .search-btn,
    .search-another-btn {
        width: 100%;
        justify-content: center;
    }

    .video-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.7rem;
    }

    .video-streaming-area {
        padding: 1.5rem;
    }

    .video-player-wrapper {
        max-width: min(300px, 90vw);
    }

    .control-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
    }

    .control-group {
        width: 100%;
        justify-content: center;
    }

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

    .download-btn {
        width: 100%;
    }

    .audio-player-section {
        flex-direction: column;
        gap: 0.8rem;
    }

    .download-audio-btn {
        max-width: 100%;
    }

    .download-progress {
        bottom: 1rem;
        right: 1rem;
        min-width: unset;
        width: calc(100% - 2rem);
        padding: 0.8rem 1rem;
    }
}

@media (max-width: 600px) {
    .tiktok_body {
        padding: 16px 10px;
    }

    .container_tiktok {
        padding: 20px 0;
    }

    .logo-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .logo-text {
        font-size: clamp(1.6rem, 9vw, 2rem);
        letter-spacing: 0;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .search-section,
    .loading,
    .video-section,
    .download-section,
    .audio-streaming {
        padding: 1.2rem;
    }

    .input-field {
        padding: 0.9rem 1rem !important;
        font-size: 0.9rem !important;
    }

    .paste-btn,
    .search-btn,
    .search-another-btn {
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
        min-height: 44px;
    }

    .loading-spinner {
        width: 70px;
        height: 70px;
    }

    .spinner-ring:nth-child(1) {
        width: 70px;
        height: 70px;
    }

    .spinner-ring:nth-child(2) {
        width: 52px;
        height: 52px;
        top: 9px;
        left: 9px;
    }

    .spinner-ring:nth-child(3) {
        width: 34px;
        height: 34px;
        top: 18px;
        left: 18px;
    }

    .video-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
        padding: 0 0.5rem;
    }

    .video-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .stat-item {
        padding: 0.8rem;
        min-height: 70px;
    }

    .video-streaming-area {
        padding: 1.2rem;
    }

    .video-player-wrapper {
        max-width: min(280px, 92vw);
    }

    .download-title,
    .audio-main-title {
        font-size: 1rem;
        gap: 0.3rem;
    }

    .audio-volume-slider,
    .volume-slider {
        width: 54px;
    }

    .download-progress {
        bottom: 0.8rem;
        right: 0.8rem;
        width: calc(100% - 1.6rem);
    }

    .error-message {
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 400px) {
    .tiktok_body {
        padding: 14px 8px;
    }

    .container_tiktok {
        padding: 16px 0;
    }

    .logo {
        flex-direction: column;
        gap: 0.8rem;
    }

    .logo-icon {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .logo-text {
        font-size: clamp(1.45rem, 9vw, 1.8rem);
        line-height: 1.18;
    }

    .subtitle {
        font-size: 0.8rem;
        margin-top: 0.3rem;
    }

    .search-section,
    .loading,
    .video-section,
    .download-section,
    .audio-streaming {
        padding: 1rem;
    }

    .input-field {
        padding: 0.8rem 0.9rem !important;
        font-size: 0.85rem !important;
    }

    .paste-btn,
    .search-btn,
    .search-another-btn {
        font-size: 0.8rem;
        padding: 0.7rem;
    }

    .video-stats {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }

    .stat-item {
        padding: 0.7rem;
        min-height: 60px;
    }

    .video-streaming-area {
        padding: 1rem;
    }

    .video-player-wrapper {
        max-width: min(250px, 95vw);
        width: 100%;
    }

    .control-btn,
    .play-btn {
        min-width: 36px;
        min-height: 36px;
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }

    .play-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    .audio-volume-slider,
    .volume-slider {
        width: 44px;
        min-height: 16px;
        height: 4px;
    }

    .download-progress {
        bottom: 0.5rem;
        right: 0.5rem;
        padding: 0.5rem 0.6rem;
        min-width: unset;
        width: calc(100% - 1rem);
    }
}

@media (max-width: 375px) {
    .container_tiktok {
        padding: 14px 0;
    }

    .logo-text {
        font-size: 1.55rem;
    }

    .subtitle {
        font-size: 0.75rem;
    }

    .search-section,
    .loading,
    .video-section,
    .download-section,
    .audio-streaming {
        padding: 0.9rem;
    }

    .input-field {
        padding: 0.7rem 0.8rem !important;
        font-size: 0.8rem !important;
    }

    .paste-btn,
    .search-btn,
    .search-another-btn {
        font-size: 0.75rem;
        padding: 0.55rem;
    }

    .author-avatar {
        width: 35px;
        height: 35px;
    }

    .video-title {
        font-size: 0.9rem;
        margin-bottom: 0.6rem;
    }

    .stat-item {
        padding: 0.6rem;
        min-height: 55px;
    }

    .video-player-wrapper {
        max-width: min(220px, 95vw);
    }

    .download-btn,
    .download-audio-btn {
        font-size: 0.75rem;
        min-height: 38px;
        padding: 0.5rem;
    }

    .progress-text {
        font-size: 0.7rem;
    }

    .cancel-btn {
        font-size: 0.55rem;
        min-height: 28px;
    }
}