/* Snapchat Downloader - Advanced UI/UX v2.2 */

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.2);
}

* {
    box-sizing: border-box;
}

.svd2-container {
    min-height: auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.svd2-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    padding: 40px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.svd2-header {
    text-align: center;
    margin-bottom: 32px;
}

.svd2-title {
    font-size: 32px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.svd2-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    margin: 0;
    font-weight: 400;
}

.svd2-search-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
    margin-bottom: 20px;
}

.svd2-input-wrapper {
    position: relative;
    flex: 1;
}

#svd2_url {
    width: 100%;
    padding: 16px 50px 16px 20px;
    font-size: 15px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 14px;
    background: white;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    font-family: inherit;
    height: 100%;
}

#svd2_url:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

#svd2_url::placeholder {
    color: #a0aec0;
}

.svd2-icon-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-gradient);
    border: none;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.svd2-icon-btn:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.svd2-icon-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.svd2-icon-btn svg {
    width: 20px;
    height: 20px;
    stroke: white;
    fill: none;
    transition: all 0.3s ease;
}

.svd2-icon-btn .paste-icon {
    display: block;
}

.svd2-icon-btn .clear-icon {
    display: none;
}

.svd2-icon-btn.has-content .paste-icon {
    display: none;
}

.svd2-icon-btn.has-content .clear-icon {
    display: block;
}

.svd2-icon-btn.has-content {
    background: var(--secondary-gradient);
}

.svd2-download-btn {
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    font-family: inherit;
    white-space: nowrap;
    min-width: 150px;
}

.svd2-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.5);
}

.svd2-download-btn:active {
    transform: translateY(0);
}

.svd2-download-btn.loading {
    background: linear-gradient(135deg, #a0aec0 0%, #718096 100%);
    cursor: not-allowed;
    pointer-events: none;
}

.svd2-download-btn.loading .btn-icon {
    animation: spin 1s linear infinite;
}

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

.btn-icon {
    width: 20px;
    height: 20px;
    stroke: white;
    transition: all 0.3s ease;
}

.svd2-status {
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    padding: 12px 20px;
    border-radius: 12px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.svd2-status.show {
    opacity: 1;
    transform: translateY(0);
}

.svd2-status.loading {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.svd2-status.success {
    background: rgba(79, 172, 254, 0.1);
    color: #4facfe;
    border: 1px solid rgba(79, 172, 254, 0.3);
}

.svd2-status.error {
    background: rgba(245, 87, 108, 0.1);
    color: #f5576c;
    border: 1px solid rgba(245, 87, 108, 0.3);
}

.svd2-result {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.svd2-item {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow-md);
    animation: fadeInScale 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.svd2-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    border-color: rgba(102, 126, 234, 0.3);
}

.svd2-item video {
    width: 100%;
    border-radius: 12px;
    background: #000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.svd2-item img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    object-fit: cover;
    display: block;
}

.svd2-image-item img {
    background: #f7fafc;
}

.svd2-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding: 12px 24px;
    background: var(--primary-gradient);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    width: 100%;
    cursor: pointer;
}

.svd2-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    text-decoration: none;
}

.svd2-download:active {
    transform: translateY(0);
}

.svd2-download::after {
    content: '↓';
    font-size: 18px;
    font-weight: bold;
}

.svd2-load-more-container {
    text-align: center;
    margin-top: 30px;
}

.svd2-load-more-btn {
    padding: 16px 40px;
    font-size: 16px;
    font-weight: 600;
    background: var(--success-gradient);
    color: white;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.3);
    font-family: inherit;
}

.svd2-load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(79, 172, 254, 0.4);
}

.svd2-load-more-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .svd2-result {
        grid-template-columns: 1fr;
    }
    
    .svd2-search-row {
        flex-direction: column;
    }
    
    .svd2-download-btn {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .svd2-box {
        padding: 24px;
        border-radius: 20px;
    }
    
    .svd2-title {
        font-size: 26px;
    }
    
    .svd2-subtitle {
        font-size: 14px;
    }
    
    #svd2_url {
        padding: 14px 50px 14px 16px;
        font-size: 14px;
    }
    
    .svd2-download-btn {
        padding: 16px 24px;
        font-size: 15px;
    }
    
    .svd2-item {
        padding: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
