:root {
    --bg-color: #0d1117;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --glass-bg: rgba(33, 38, 45, 0.4);
    --glass-border: rgba(240, 246, 252, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --primary-color: #58a6ff;
    --primary-glow: rgba(88, 166, 255, 0.5);
    --vip-color: #d1b82e;
    --vip-glow: rgba(209, 184, 46, 0.5);
    --success-color: #2ea043;
    --danger-color: #f85149;
    --card-radius: 20px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 60px 20px;
    position: relative;
    overflow-x: hidden;
}

/* Background animated blobs */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.5;
    animation: float 20s infinite ease-in-out;
}

.blob-1 {
    top: 10%;
    left: 20%;
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #1f4287, #278ea5);
    animation-delay: 0s;
}

.blob-2 {
    bottom: 20%;
    right: 15%;
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #44107a, #ff1361);
    animation-delay: -5s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-50px) scale(1.1);
    }
}

.container {
    width: 100%;
    max-width: 700px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

.gradient-text {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #ffffff, #8b949e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.badge {
    font-size: 0.9rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #fff;
}

.badge:not(.size-badge):not(.type-badge):not(.resume-badge) {
    background: linear-gradient(135deg, var(--primary-color), #278ea5);
    font-size: 1rem;
    margin-left: 10px;
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 25px;
}

/* Glass panel design */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    padding: 30px;
    box-shadow: var(--glass-shadow);
    transition: var(--transition);
}

.glass-panel:hover {
    transform: translateY(-2px);
    border-color: rgba(240, 246, 252, 0.2);
}

/* VIP Toggle */
.vip-toggle-container {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    gap: 15px;
}

.label {
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.vip-label {
    background: linear-gradient(90deg, #d1b82e, #f5d742);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

/* Toggle Switch CSS */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 34px;
    border: 1px solid var(--glass-border);
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 3px;
    background-color: var(--text-primary);
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background: linear-gradient(135deg, #d1b82e, #f5d742);
    box-shadow: 0 0 15px var(--vip-glow);
}

input:checked+.slider:before {
    transform: translateX(26px);
}

/* Input Section */
.input-group {
    display: flex;
    gap: 15px;
}

input[type="url"],
input[type="text"],
textarea {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px 20px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

input[type="url"]:focus,
input[type="text"]:focus,
textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 12px;
    padding: 15px 25px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#detect-btn {
    background: var(--primary-color);
    color: #000;
    box-shadow: 0 4px 15px var(--primary-glow);
    white-space: nowrap;
}

#detect-btn:hover {
    background: #6cb0ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

#detect-btn:active {
    transform: translateY(0);
}

/* Loading Spinner */
.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    border-top-color: #000;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none !important;
}

.error-msg {
    color: var(--danger-color);
    margin-top: 15px;
    font-size: 0.9rem;
    background: rgba(248, 81, 73, 0.1);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(248, 81, 73, 0.2);
}

/* Result Section */
.batch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
}

.batch-header h2 {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Custom Scrollbar for file list */
.file-list::-webkit-scrollbar {
    width: 6px;
}

.file-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.file-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.file-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

.file-item {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.file-item:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(240, 246, 252, 0.2);
}

.file-item-top {
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.file-details {
    flex: 1;
    overflow: hidden;
}

.file-details h3 {
    margin-bottom: 8px;
    word-break: break-all;
    font-size: 1.1rem;
    line-height: 1.3;
}

.meta-data {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.size-badge {
    background: rgba(88, 166, 255, 0.15);
    color: var(--primary-color);
    border: 1px solid rgba(88, 166, 255, 0.3);
}

.type-badge {
    background: rgba(139, 148, 158, 0.15);
    color: var(--text-secondary);
    border: 1px solid rgba(139, 148, 158, 0.3);
}

.resume-badge {
    background: rgba(46, 160, 67, 0.15);
    color: var(--success-color);
    border: 1px solid rgba(46, 160, 67, 0.3);
}

.status-badge {
    background: rgba(209, 184, 46, 0.15);
    color: var(--vip-color);
    border: 1px solid rgba(209, 184, 46, 0.3);
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.primary-action {
    flex: 2;
    background: var(--primary-color);
    color: #000;
    box-shadow: 0 4px 15px var(--primary-glow);
    font-size: 1.1rem;
}

.primary-action:hover {
    background: #6cb0ff;
    transform: translateY(-2px);
}

.primary-action.vip-mode {
    background: linear-gradient(135deg, #d1b82e, #f5d742);
    box-shadow: 0 4px 15px var(--vip-glow);
}

.primary-action.vip-mode:hover {
    filter: brightness(1.1);
}

.secondary-action {
    flex: 1;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.secondary-action:hover {
    background: rgba(255, 255, 255, 0.1);
}

.speed-indicator {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Shortlink Output */
.shortlink-container {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

#shortlink-input {
    background: rgba(46, 160, 67, 0.1);
    border-color: rgba(46, 160, 67, 0.3);
    color: var(--success-color);
    font-weight: 600;
}

#copy-btn {
    background: var(--success-color);
    color: #fff;
    box-shadow: 0 4px 15px rgba(46, 160, 67, 0.3);
}

/* History */
.history-section {
    padding: 25px 30px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.history-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.text-btn {
    background: none;
    color: var(--text-secondary);
    padding: 5px 10px;
}

.text-btn:hover {
    color: var(--danger-color);
    background: rgba(248, 81, 73, 0.1);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    transition: var(--transition);
}

.history-item:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(240, 246, 252, 0.2);
}

.history-main {
    overflow: hidden;
}

.history-name {
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-url {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-actions {
    display: flex;
    gap: 10px;
}

.history-dl-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 8px 15px;
    font-size: 0.9rem;
}

.history-dl-btn:hover {
    background: var(--primary-color);
    color: #000;
}

.empty-state {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
    font-style: italic;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    .input-group {
        flex-direction: column;
    }

    .action-buttons {
        flex-direction: column;
    }

    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .history-actions {
        width: 100%;
        justify-content: flex-end;
    }
}