/* Reset และพื้นฐาน */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

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

/* ส่วนหัว */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

header h1 {
    color: #ff0000;
    font-size: 2.8rem;
    margin-bottom: 10px;
}

header .subtitle {
    color: #666;
    font-size: 1.2rem;
}

/* การ์ดหลัก */
.converter-card {
    background: #fff;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.converter-card h2 {
    color: #333;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

/* การแจ้งเตือน */
.alert {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.alert i {
    margin-right: 10px;
    font-size: 1.2rem;
}

.alert.error {
    background-color: #ffeaea;
    color: #d32f2f;
    border-left: 5px solid #d32f2f;
}

.alert.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border-left: 5px solid #2e7d32;
}

/* ฟอร์ม */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 1.1rem;
}

.form-group input[type="url"] {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.form-group input[type="url"]:focus {
    border-color: #ff0000;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.1);
}

/* ตัวเลือกรูปแบบ */
.format-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.format-option {
    flex: 1;
    min-width: 150px;
}

.format-option input[type="radio"] {
    display: none;
}

.format-content {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    border: 2px solid #ddd;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.format-content i {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #666;
}

.format-content span {
    font-weight: 600;
    color: #333;
}

.format-option input[type="radio"]:checked+.format-content {
    border-color: #ff0000;
    background-color: rgba(255, 0, 0, 0.05);
}

.format-option input[type="radio"]:checked+.format-content i {
    color: #ff0000;
}

/* ปุ่มแปลง */
.convert-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(to right, #ff0000, #ff5252);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.convert-btn:hover {
    background: linear-gradient(to right, #e60000, #ff3d3d);
    transform: translateY(-3px);
    box-shadow: 0 7px 15px rgba(255, 0, 0, 0.2);
}

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

/* ตัวอย่างวิดีโอ */
.video-preview {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 2px solid #f0f0f0;
}

.video-preview h3 {
    margin-bottom: 20px;
    color: #333;
}

.video-info {
    display: flex;
    gap: 20px;
    background: #f9f9f9;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.thumbnail {
    flex: 0 0 200px;
}

.thumbnail img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.video-details {
    flex: 1;
    min-width: 300px;
}

.video-details h4 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: #333;
}

.video-details p {
    margin-bottom: 10px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ตัวเลือกดาวน์โหลด */
.download-options h4 {
    margin-bottom: 15px;
    color: #333;
}

.download-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.download-btn {
    flex: 1;
    min-width: 200px;
    padding: 18px;
    border: none;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.mp3-btn {
    background: linear-gradient(to right, #4CAF50, #8BC34A);
    color: white;
}

.mp4-btn {
    background: linear-gradient(to right, #2196F3, #03A9F4);
    color: white;
}

.download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 15px rgba(0, 0, 0, 0.15);
}

.mp3-btn:hover {
    background: linear-gradient(to right, #3d8b40, #7cb342);
}

.mp4-btn:hover {
    background: linear-gradient(to right, #1976D2, #0288D1);
}

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

/* ความคืบหน้า */
.progress-container {
    margin-top: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
}

.progress-container h4 {
    margin-bottom: 15px;
    color: #333;
}

.progress-bar {
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, #4CAF50, #8BC34A);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 10px;
}

#progress-text {
    text-align: center;
    color: #666;
}

/* คำแนะนำ */
.instructions {
    background: #fff;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.instructions h3 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.instructions ol {
    padding-left: 20px;
    margin-bottom: 25px;
}

.instructions li {
    margin-bottom: 10px;
    color: #555;
    line-height: 1.6;
}

.warning {
    background: #fff8e1;
    border-left: 5px solid #ffc107;
    padding: 20px;
    border-radius: 10px;
}

.warning h4 {
    color: #ff9800;
    margin-bottom: 10px;
}

.warning p {
    color: #666;
    margin-bottom: 8px;
    line-height: 1.5;
}

/* ส่วนท้าย */
footer {
    text-align: center;
    padding: 25px;
    color: #666;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

footer p {
    margin-bottom: 10px;
}

.copyright {
    font-size: 0.9rem;
    color: #999;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.2rem;
    }

    .video-info {
        flex-direction: column;
    }

    .thumbnail {
        flex: 0 0 auto;
    }

    .download-btn {
        min-width: 100%;
    }

    .format-option {
        min-width: 100%;
    }
}