:root {
    --primary: #4a6cf7;
    --primary-hover: #3a5ce7;
    --primary-light: rgba(74, 108, 247, 0.1);
    --secondary: #7b90ff;
    --success: #0acf97;
    --danger: #ff7477;
    --dark: #1e293b;
    --darker: #0f172a;
    --light: #f8fafc;
    --gray: #64748b;
    --light-gray: #e2e8f0;
    --border: 1px solid var(--light-gray);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
    --card-radius: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background: linear-gradient(135deg, #f0f4ff, #e6edff);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--dark);
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 800px;
    background-color: white;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
	    margin-bottom: 60px;
}

.header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 35px 30px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: "";
    position: absolute;
    top: -100px;
    left: -50px;
    width: 250px;
    height: 250px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.header::after {
    content: "";
    position: absolute;
    bottom: -80px;
    right: -40px;
    width: 180px;
    height: 180px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.header-content {
    position: relative;
    z-index: 2;
}

.logo {
    font-size: 42px;
    margin-bottom: 15px;
    color: white;
}

.header h1 {
    font-size: 30px;
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header p {
    font-size: 16px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

.content {
    padding: 30px;
    position: relative;
    min-height: 400px;
}

.platform-section {
    transition: all 0.4s ease;
    position: relative;
    z-index: 10;
}

.section-title {
    text-align: center;
    margin-bottom: 25px;
    font-weight: 700;
    font-size: 24px;
    color: var(--darker);
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary);
    border-radius: 5px;
}

.platform-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 18px;
    margin-bottom: 15px;
}

.platform-card {
    background-color: white;
    border: var(--border);
    border-radius: 12px;
    padding: 20px 12px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.platform-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    border-color: var(--primary);
}

.platform-card.selected {
    background-color: var(--primary-light);
    border-color: var(--primary);
}

.platform-icon {
    font-size: 36px;
    margin-bottom: 12px;
    color: var(--primary);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 64px;
    height: 64px;
    background: rgba(74, 108, 247, 0.08);
    border-radius: 50%;
    transition: var(--transition);
}

.platform-card:hover .platform-icon {
    background: rgba(74, 108, 247, 0.15);
    transform: scale(1.08);
}

.platform-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--darker);
}

.parse-section {
    position: absolute;
    top: 30px;
    left: 30px;
    right: 30px;
    background: white;
    border-radius: var(--card-radius);
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    z-index: 20;
    opacity: 0;
    transform: translateY(20px);
    visibility: hidden;
    transition: all 0.4s ease;
}

.parse-section.active {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.selected-platform {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    background-color: var(--primary-light);
    padding: 15px;
    border-radius: 12px;
    position: relative;
}

.selected-platform .platform-card {
    padding: 12px;
    pointer-events: none;
    transform: none !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05) !important;
    margin-right: 20px;
    width: 140px;
}

.selected-platform .platform-card.selected {
    background-color: white;
}

.reselection-btn {
    background-color: white;
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.reselection-btn:hover {
    background-color: rgba(74, 108, 247, 0.05);
    transform: translateY(-2px);
}

.input-group {
    display: flex;
    position: relative;
    margin-bottom: 15px;
}

.url-input {
    flex: 1;
    padding: 16px 20px 16px 48px;
    border: var(--border);
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.url-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.2);
}

.url-input::placeholder {
    color: var(--gray);
    opacity: 0.7;
}

.url-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 20px;
}

.parse-btn {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 8px;
    padding: 16px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    margin-top: 5px;
    box-shadow: 0 4px 10px rgba(74, 108, 247, 0.3);
}

.parse-btn:hover {
    background: linear-gradient(to right, var(--primary-hover), #6b83ff);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(74, 108, 247, 0.4);
}

.parse-btn:active {
    transform: translateY(1px);
}

.results-container {
    min-height: 200px;
    margin-top: 30px;
    display: none;
    animation: fadeIn 0.5s;
}

.results-container.active {
    display: block;
}

.loading {
    text-align: center;
    padding: 50px 20px;
    border-radius: 12px;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(74, 108, 247, 0.2);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    margin: 0 auto 25px;
    animation: spin 1s linear infinite;
}

.loading p {
    font-weight: 500;
    color: var(--darker);
    margin: 5px 0;
}

.error-box {
    background-color: rgba(255, 116, 119, 0.08);
    border: 1px solid var(--danger);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
}

.results-box {
    background-color: white;
    border-radius: var(--card-radius);
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.video-info {
    margin-bottom: 25px;
}

.video-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
    color: var(--darker);
}

.video-preview {
    width: 100%;
    aspect-ratio: 16/9;
    background-color: #f1f5f9;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 25px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.video-player {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.video-details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    background-color: var(--light);
    padding: 15px;
    border-radius: 10px;
    font-size: 14px;
}

.detail-item {
    text-align: center;
    flex: 1;
}

.detail-label {
    color: var(--gray);
    margin-bottom: 5px;
}

.detail-value {
    font-weight: 600;
    color: var(--darker);
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.btn {
    padding: 15px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 16px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(to right, var(--primary-hover), #6b83ff);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(74, 108, 247, 0.2);
}

.btn-outline {
    background-color: white;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background-color: rgba(74, 108, 247, 0.05);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

footer {
    text-align: center;
    padding: 25px;
    font-size: 14px;
    color: var(--gray);
    background-color: rgba(0,0,0,0.02);
}

.tips {
    text-align: center;
    color: var(--gray);
    margin-top: 10px;
    font-size: 14px;
}

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

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

@media (max-width: 768px) {
    .platform-cards {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .header {
        padding: 30px 20px;
    }

    .header h1 {
        font-size: 26px;
    }

    .content {
        padding: 25px 20px;
    }

    .parse-section {
        top: 20px;
        left: 20px;
        right: 20px;
        padding: 20px;
    }

    .section-title {
        font-size: 22px;
    }

    .video-details {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .platform-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .selected-platform {
        flex-direction: column;
        text-align: center;
    }

    .selected-platform .platform-card {
        margin-right: 0;
        margin-bottom: 15px;
        width: 100%;
        max-width: 140px;
    }

    .btn {
        font-size: 14px;
        padding: 12px;
    }

    .video-preview {
        aspect-ratio: 16/11;
    }

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

.download-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    display: none;
}

.loading-text {
    font-size: 18px;
    color: #333;
    padding: 20px 40px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}
