:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --success-color: #4cc9f0;
    --danger-color: #f72585;
    --warning-color: #f8961e;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-radius: 10px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
    padding: 20px;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 30px;
    margin-bottom: 30px;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.upload-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.upload-area {
    border: 2px dashed #ccc;
    border-radius: var(--border-radius);
    width: 100%;
    margin-bottom: 20px;
    transition: var(--transition);
    cursor: pointer;
    background-color: #f9f9f9;
    position: relative;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary-color);
    background-color: #f0f4ff;
}

.upload-content {
    padding: 25px 20px;
}

.upload-icon {
    font-size: 2.5rem;
    color: #777;
    margin-bottom: 10px;
}

.upload-text {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 1.1rem;
    font-weight: 500;
}

.file-hint {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.file-info {
    margin: 15px 0;
    padding: 12px 15px;
    background-color: #f1f3f4;
    border-radius: 5px;
    display: none;
    width: 100%;
    text-align: center;
}

.file-info.show {
    display: block;
}

.file-details {
    text-align: left;
    margin-top: 10px;
    padding: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    font-size: 0.9rem;
}

.file-details h4 {
    margin-bottom: 8px;
    color: var(--dark-color);
    font-size: 1rem;
}

.file-details ul {
    list-style-type: none;
    padding-left: 0;
}

.file-details li {
    margin-bottom: 4px;
}

.file-details li strong {
    display: inline-block;
    width: 35%;
}

input[type="file"] {
    display: none;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn i {
    margin-right: 8px;
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
    width: 100%;
}

.progress-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.progress-bar {
    width: 70%;
    height: 12px;
    background-color: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    margin-right: 15px;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 40px;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.result-section h2, .history-section h2 {
    margin-bottom: 20px;
    color: var(--dark-color);
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
}

tr:hover {
    background-color: #f8f9fa;
}

.link-cell {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.link-url {
    flex: 1;
    min-width: 200px;
    word-break: break-all;
    margin-right: 10px;
}

.copy-btn {
    white-space: nowrap;
}

.pagination {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    gap: 10px;
}

.pagination button {
    padding: 8px 15px;
    background-color: #f1f3f4;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.pagination button.active {
    background-color: var(--primary-color);
    color: white;
}

.pagination button:hover:not(.active) {
    background-color: #ddd;
}

.empty-history {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.empty-history i {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
    color: #ccc;
}

#aboutBtn {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

#aboutBtn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

#updateLog {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

#updateLog .header {
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

#updateLog .content {
    padding: 20px;
}

#updateLog .close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .card {
        padding: 20px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    th, td {
        padding: 10px 5px;
        font-size: 0.9rem;
    }
    
    .link-cell {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .link-url {
        margin-bottom: 10px;
    }
    
    .upload-content {
        padding: 20px 15px;
    }
    
    .upload-text {
        font-size: 1rem;
    }
    
    .file-hint {
        font-size: 0.8rem;
    }
    
    .progress-bar {
        width: 60%;
    }
}