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

:root {
    --primary-color: #E1306C;
    --primary-hover: #C13584;
    --secondary-color: #405DE6;
    --text-color: #262626;
    --text-light: #8e8e8e;
    --bg-color: #fafafa;
    --white: #ffffff;
    --border-color: #dbdbdb;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-color);
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: var(--white);
}

.logo {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.9;
}

.download-box {
    background: var(--white);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 40px;
}

.input-section {
    margin-bottom: 30px;
}

.input-wrapper {
    display: flex;
    gap: 12px;
    flex-direction: column;
}

#videoUrl {
    width: 100%;
    padding: 16px 20px;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

#videoUrl:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(225, 48, 108, 0.1);
}

.download-button {
    padding: 16px 32px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    font-family: inherit;
}

.download-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(225, 48, 108, 0.4);
}

.download-button:active:not(:disabled) {
    transform: translateY(0);
}

.download-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.download-button.primary {
    width: 100%;
    margin-top: 20px;
}

.download-button.secondary {
    background: #808080;
    color: var(--white);
    margin-right: 0;
}

.download-button.secondary:hover:not(:disabled) {
    background: #707070;
    box-shadow: 0 4px 12px rgba(128, 128, 128, 0.4);
}

.download-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.download-actions .download-button.primary {
    margin-top: 0;
    width: 100%;
}

.download-actions .download-button.secondary {
    width: 100%;
}

.spinner {
    animation: rotate 2s linear infinite;
    width: 24px;
    height: 24px;
}

.path {
    stroke: var(--white);
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

.preview-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    animation: fadeIn 0.3s ease;
}

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

.preview-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.video-preview-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-preview-container video {
    max-height: 400px;
}

.thumbnail-container {
    width: 100%;
    max-width: 600px;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.thumbnail-container:hover {
    transform: scale(1.02);
}

.thumbnail-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-placeholder {
    color: var(--text-light);
}

.video-info {
    width: 100%;
    text-align: center;
    margin-top: 10px;
}

.video-info h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--text-color);
    word-break: break-word;
}

.duration {
    color: var(--text-light);
    font-size: 0.9rem;
}

.error-message,
.success-message {
    padding: 16px;
    border-radius: 12px;
    margin-top: 20px;
    animation: fadeIn 0.3s ease;
}

.error-message {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.success-message {
    background: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

.download-other-button {
    width: 100%;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    background: #e0e0e0;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    font-family: inherit;
}

.download-other-button:hover {
    background: #d0d0d0;
    transform: translateY(-1px);
}

.seo-content {
    background: var(--white);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    margin-top: 40px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}

.seo-content h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
}

.seo-content h3 {
    font-size: 1.5rem;
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--text-color);
}

.seo-content p {
    margin-bottom: 20px;
    color: var(--text-color);
    font-size: 1rem;
}

.seo-content ul,
.seo-content ol {
    margin-bottom: 20px;
    padding-left: 30px;
    color: var(--text-color);
}

.seo-content li {
    margin-bottom: 10px;
    line-height: 1.8;
}

.seo-content strong {
    color: var(--text-color);
    font-weight: 600;
}

@media (max-width: 640px) {
    .seo-content {
        padding: 24px;
    }
    
    .seo-content h2 {
        font-size: 1.5rem;
    }
    
    .seo-content h3 {
        font-size: 1.2rem;
    }
}

footer {
    text-align: center;
    color: var(--white);
    opacity: 0.8;
    padding: 20px;
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 12px 16px;
    background: rgba(225, 48, 108, 0.1);
    border-radius: 8px;
    color: var(--primary-color);
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease;
}

.spinner-small {
    animation: rotate 2s linear infinite;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.path-small {
    stroke: var(--primary-color);
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@media (min-width: 640px) {
    .input-wrapper {
        flex-direction: row;
    }
    
    .download-button {
        min-width: 150px;
    }
}

@media (max-width: 640px) {
    .logo {
        font-size: 2rem;
    }
    
    .download-box {
        padding: 24px;
    }
    
    .preview-content {
        flex-direction: column;
        text-align: center;
    }
}

