:root {
    --main-pink: #FFA1C9;
    --sky-blue: #87CEEB;
    --mint-green: #98FB98;
    --deep-purple: #9370DB;
    --light-purple: #C8A2C8;
    --bg-blur: blur(12px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(145deg, var(--sky-blue) 0%, var(--main-pink) 100%);
    min-height: 100vh;
    padding: 10px;
    position: relative;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

.main-container {
    position: relative;
    max-width: 800px;
    margin: 30px auto 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: var(--bg-blur);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.title {
    text-align: center;
    color: var(--deep-purple);
    margin-bottom: 30px;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.title i {
    background: linear-gradient(45deg, var(--deep-purple), var(--main-pink));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.input-box {
    position: relative;
    margin: 20px 0;
    background: #fff;
    border-radius: 40px;
    box-shadow: 0 3px 12px rgba(255, 161, 201, 0.2);
    overflow: hidden;
}

#urlInput {
    width: 100%;
    padding: 14px 110px 14px 45px;
    border: none;
    background: transparent;
    font-size: 15px;
    color: var(--deep-purple);
    outline: none;
}

#urlInput::placeholder {
    color: var(--light-purple);
    font-size: 14px;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--light-purple);
    font-size: 18px;
}

.parse-btn {
    position: absolute;
    right: 4px;
    top: 4px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--deep-purple), var(--main-pink));
    color: white;
    border: none;
    border-radius: 35px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    touch-action: manipulation;
    transition: all 0.3s ease;
}

.parse-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(147, 112, 219, 0.3);
}

.parse-btn:active {
    transform: scale(0.98);
}

.parse-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.media-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 15px;
    margin: 15px 0;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.media-card h2 {
    color: var(--deep-purple);
    margin-bottom: 15px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.media-card h2 i {
    font-size: 1rem;
}

.video-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.responsive-video {
    width: 100%;
    max-height: 75vh;
    border-radius: 12px;
    background: #000;
    object-fit: contain;
    display: block;
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.image-item {
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.image-item:hover {
    transform: scale(1.05);
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-item .image-number {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item .image-index {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    z-index: 1;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 25px;
    background: linear-gradient(135deg, var(--main-pink), #FF6B9D);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    margin-top: 15px;
    transition: all 0.3s ease;
    touch-action: manipulation;
}

.download-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(255, 161, 201, 0.3);
}

.download-btn:active {
    transform: scale(0.98);
}

.download-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.download-all-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 25px;
    background: linear-gradient(135deg, var(--main-pink), #FF6B9D);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    touch-action: manipulation;
}

.download-all-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(255, 161, 201, 0.3);
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading p {
    color: var(--deep-purple);
    margin-top: 10px;
    font-size: 14px;
}

.bouncing-loader {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.bouncing-loader div {
    width: 10px;
    height: 10px;
    background: var(--deep-purple);
    border-radius: 50%;
    animation: bouncing 0.6s infinite alternate;
}

.bouncing-loader div:nth-child(2) {
    animation-delay: 0.15s;
}

.bouncing-loader div:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes bouncing {
    to {
        transform: translateY(-10px);
        opacity: 0.5;
    }
}

.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    cursor: zoom-out;
    animation: fadeIn 0.3s ease;
}

.fullscreen-overlay img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
    animation: scaleIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.alert-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 30px;
    border-radius: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    color: var(--deep-purple);
    font-size: 14px;
    z-index: 9998;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateX(-50%) translateY(20px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@media (max-width: 767px) {
    .main-container {
        margin: 15px auto 15px;
        padding: 15px;
        border-radius: 15px;
    }

    .title {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    #urlInput {
        padding: 12px 90px 12px 40px;
        font-size: 14px;
    }

    .parse-btn {
        padding: 8px 15px;
        font-size: 13px;
    }

    .responsive-video {
        max-height: 60vh;
    }

    .images-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
}

@media (min-width: 768px) {
    .main-container {
        padding: 30px;
        margin: 40px auto 25px;
    }

    #urlInput {
        font-size: 16px;
        padding: 16px 130px 16px 50px;
    }

    .parse-btn {
        padding: 12px 25px;
        font-size: 15px;
    }
}