* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 30px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform: translateY(0);
    transition: transform 0.3s ease;
    margin-bottom: 20px;
}

.container:hover {
    transform: translateY(-5px);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.description {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
    line-height: 1.5;
}

.input-group {
    margin-bottom: 25px;
}

input[type="url"] {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    outline: none;
}

input[type="url"]:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    font-weight: 500;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

button:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

button:active {
    transform: scale(0.98);
}

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: scale(1);
}

.result {
    margin-top: 30px;
    display: none;
    animation: fadeIn 0.5s ease;
}

.result.show {
    display: block;
}

.file-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
}

.file-info p {
    margin-bottom: 8px;
    color: #444;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error {
    color: #e74c3c;
    text-align: center;
    margin-top: 20px;
    display: none;
    animation: shake 0.5s;
    padding: 12px;
    background: #ffeaea;
    border-radius: 8px;
    border-left: 4px solid #e74c3c;
}

.error.show {
    display: block;
}

.loading {
    display: none;
    text-align: center;
    margin: 20px 0;
}

.loading.show {
    display: block;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 15px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-radius: 50%;
    border-top: 4px solid #667eea;
    animation: spin 1s linear infinite;
}

.loading-duration {
    text-align: center;
    font-size: 16px;
    color: #667eea;
    font-weight: 500;
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.duration-number {
    display: inline-block;
    min-width: 25px;
    height: 25px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 25px;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

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

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.download-link {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 25px;
    background: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.3s;
    text-align: center;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.download-link:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    max-width: 500px;
}

.info-box {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    font-size: 13px;
}

.info-box ul {
    text-align: left;
    margin-top: 10px;
    padding-left: 20px;
}

.info-box li {
    margin-bottom: 5px;
}

.server-message {
    margin-top: 15px;
    padding: 10px;
    background: #e3f2fd;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
    display: none;
}

.server-message.show {
    display: block;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    margin-top: 15px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
}

/* Tombol View */
.view-button {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 25px;
    background: #ff9800;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.3s;
    text-align: center;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    border: none;
    font-size: 16px;
}

.view-button:hover {
    background: #f57c00;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Preview Container */
.preview-container {
    margin-top: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background: white;
    display: none;
    max-height: 400px;
    overflow: auto;
}

.preview-container.show {
    display: block;
    animation: fadeIn 0.5s ease;
}

.preview-container img,
.preview-container video {
    max-width: 100%;
    max-height: 300px;
    display: block;
    margin: 0 auto;
}

.preview-container audio {
    width: 100%;
    margin: 10px 0;
}

.preview-container iframe {
    width: 100%;
    height: 300px;
    border: none;
    border-radius: 4px;
}

.preview-container .text-content {
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 14px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
    max-height: 300px;
    overflow: auto;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.button-group .download-link,
.button-group .view-button {
    width: 50%;
    margin-top: 0;
}

.unsupported-type {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* Styling untuk kode JavaScript */
.js-code {
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    max-height: 300px;
}

.js-code .keyword {
    color: #ff79c6;
}

.js-code .function {
    color: #50fa7b;
}

.js-code .string {
    color: #f1fa8c;
}

.js-code .comment {
    color: #6272a4;
}

.js-code .number {
    color: #bd93f9;
}

.js-code .operator {
    color: #ff79c6;
}

.js-code .bracket {
    color: #f8f8f2;
}

/* Tombol Copy */
.copy-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s;
}

.copy-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.code-container {
    position: relative;
}
