/* Upload Page Styles */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    min-height: 70vh;
}

.upload-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    border-radius: 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.upload-area {
    border: 2px dashed var(--primary);
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    margin-bottom: 20px;
}

.upload-area.active {
    border-color: var(--secondary);
    background: rgba(99, 102, 241, 0.1);
}

.upload-icon {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.upload-area.active .upload-icon {
    color: var(--secondary);
    transform: scale(1.1);
}

.file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-prompt {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 10px;
}

.upload-details {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.upload-max-size {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 5px;
    background: rgba(99, 102, 241, 0.2);
    padding: 3px 10px;
    border-radius: 5px;
    display: inline-block;
}

.tab-container {
    margin-bottom: 20px;
    display: flex;
    border-bottom: 1px solid var(--glass-border);
}

.tab {
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 500;
    position: relative;
}

.tab.active {
    color: var(--primary);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.text-editor {
    width: 100%;
    min-height: 200px;
    background: rgba(15, 15, 35, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 15px;
    color: var(--text-primary);
    font-family: 'Inter', monospace;
    resize: vertical;
    margin-bottom: 20px;
}

.upload-btn {
    background: linear-gradient(to right, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

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

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

.upload-btn.disabled {
    background: #4f4f6f;
    cursor: not-allowed;
}

.progress-container {
    width: 100%;
    background: rgba(15, 15, 35, 0.5);
    border-radius: 12px;
    height: 12px; /* Increased height to better match the cancel button */
    margin-top: 20px;
    overflow: visible; /* Changed to visible to allow the cancel button to extend beyond */
    display: none;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(45deg, 
        var(--primary) 0%, 
        var(--secondary) 25%, 
        var(--accent) 50%,
        var(--secondary) 75%,
        var(--primary) 100%);
    background-size: 200% 200%;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 12px;
    animation: shimmer 2s infinite linear;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

@keyframes shimmer {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

.selected-file {
    margin-top: 15px;
    display: none;
    align-items: center;
    background: rgba(15, 15, 35, 0.5);
    border-radius: 8px;
    padding: 10px;
}

.selected-file-icon {
    font-size: 24px;
    color: var(--primary);
    margin-right: 10px;
}

.selected-file-name {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.selected-file-size {
    color: var(--text-secondary);
    font-size: 12px;
    margin-left: 10px;
}

.remove-file {
    color: var(--secondary);
    cursor: pointer;
    margin-left: 10px;
    font-size: 18px;
}

.status-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    display: none;
}

.status-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.status-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.login-prompt {
    text-align: center;
    padding: 40px;
}

.login-btn {
    display: inline-block;
    background: linear-gradient(to right, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.file-result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    background: rgba(15, 15, 35, 0.5);
    display: none;
}

.file-link {
    color: var(--primary);
    word-break: break-all;
}

.copy-link {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 10px;
}

.permission-denied {
    text-align: center;
    padding: 40px;
}

.upload-status-container {
    margin-top: 20px;
    max-height: 600px;
    overflow-y: auto;
    padding: 15px;
    background: rgba(10, 10, 25, 0.3);
    border-radius: 12px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
    scrollbar-width: thin;
    scrollbar-color: var(--primary) rgba(15, 15, 35, 0.5);
}

.upload-status-container::-webkit-scrollbar {
    width: 8px;
}

.upload-status-container::-webkit-scrollbar-track {
    background: rgba(15, 15, 35, 0.5);
    border-radius: 10px;
}

.upload-status-container::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.upload-status-container h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.file-upload-status {
    position: relative;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    animation: fadeIn 0.3s ease-in-out;
    background: rgba(15, 15, 35, 0.5);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-left: 3px solid var(--primary);
}

.file-upload-status:hover {
    background: rgba(20, 20, 40, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

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

@keyframes slide-in {
    0% { opacity: 0; transform: translateX(-20px); }
    100% { opacity: 1; transform: translateX(0); }
}

.file-upload-status:last-child {
    margin-bottom: 0;
}

/* Pulse animation for progress bar */
@keyframes pulse-glow {
    0% { box-shadow: 0 0 5px rgba(99, 102, 241, 0.6); }
    50% { box-shadow: 0 0 15px rgba(99, 102, 241, 0.8); }
    100% { box-shadow: 0 0 5px rgba(99, 102, 241, 0.6); }
}

.progress-container .progress-bar.active {
    animation: shimmer 2s infinite linear, pulse-glow 1.5s infinite;
}

footer {
    margin-top: auto;
    padding: 20px 0;
    border-top: 1px solid var(--glass-border);
}

.custom-url-container {
    margin-top: 15px;
    display: flex;
    align-items: center;
    background: rgba(15, 15, 35, 0.5);
    border-radius: 8px;
    padding: 10px;
}

.custom-url-input {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
    background: rgba(25, 25, 45, 0.5);
    color: var(--text-primary);
    flex-grow: 1;
    outline: none;
}

.custom-url-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.custom-url-label {
    margin-right: 10px;
    white-space: nowrap;
    color: var(--text-secondary);
}

.custom-url-badge {
    display: inline-block;
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 12px;
    margin-left: 10px;
}

.file-link-card {
    background: rgba(20, 20, 40, 0.7);
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    border-left: 3px solid var(--primary);
    transition: all 0.3s ease;
}

.file-link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    background: rgba(25, 25, 45, 0.8);
}

.file-link-title {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.file-link-title i {
    color: var(--primary);
    margin-right: 8px;
    font-size: 18px;
}

.file-link-url {
    background: rgba(15, 15, 35, 0.7);
    border-radius: 6px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.file-link-url a {
    flex-grow: 1;
    color: var(--primary);
    word-break: break-all;
    text-decoration: none;
    transition: all 0.2s ease;
}

.file-link-url a:hover {
    color: var(--secondary);
}

.copy-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.copy-btn:hover {
    background: var(--secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.copy-btn i {
    margin-right: 5px;
}

.custom-url-editor {
    margin-top: 15px;
    animation: fadeIn 0.3s ease;
}

.custom-url-edit-container {
    display: flex;
    align-items: center;
    background: rgba(30, 30, 60, 0.85);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(99,102,241,0.08);
    border: 1.5px solid var(--primary);
    padding: 0;
    margin-bottom: 0;
    width: 100%;
    max-width: 420px;
    transition: box-shadow 0.2s;
}

.custom-url-edit-container:focus-within {
    box-shadow: 0 0 0 2px var(--primary);
}

.custom-url-domain {
    background: rgba(99,102,241,0.08);
    color: var(--primary);
    padding: 10px 14px;
    border-radius: 8px 0 0 8px;
    border: none;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.custom-url-edit-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 15px;
    padding: 10px 12px;
    border-radius: 0;
    min-width: 0;
}

.custom-url-apply {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 0 8px 8px 0;
    padding: 10px 18px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.custom-url-apply:hover {
    background: var(--secondary);
}

.custom-url-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
    margin-left: 2px;
    margin-bottom: 0;
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background-color: var(--primary);
    animation: confetti-fall 5s ease-out forwards;
    z-index: 9999;
    pointer-events: none;
}

@keyframes confetti-fall {
    0% { transform: translateY(-100px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.pulse-animation {
    animation: pulse 1s ease-in-out;
}

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

.url-updated-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(16, 185, 129, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    animation: slide-in-up 0.3s forwards, slide-out-down 0.3s 3s forwards;
}

@keyframes slide-in-up {
    0% { transform: translateY(100px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes slide-out-down {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(100px); opacity: 0; }
}

/* Improved styles for URL editing */
.edit-url-btn {
    background: linear-gradient(to right, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    margin-top: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.edit-url-btn i {
    margin-right: 6px;
    position: relative;
    z-index: 2;
}

.edit-url-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: all 0.6s ease;
}

.edit-url-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.4);
}

.edit-url-btn:hover:before {
    left: 100%;
}

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

/* Cancel mode for edit URL button */
.edit-url-btn.cancel-mode {
    background: linear-gradient(to right, #ef4444, #dc2626);
}

.edit-url-btn.cancel-mode:hover {
    background: linear-gradient(to right, #dc2626, #b91c1c);
}

/* Inline URL editing styles */
.inline-url-edit {
    display: flex;
    align-items: center;
    position: relative;
    gap: 0;
    margin-top: 15px;
}

.inline-url-prefix {
    color: var(--text-secondary);
    font-weight: 500;
    opacity: 0.9;
    user-select: none;
}

.inline-url-input {
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--primary);
    color: var(--primary);
    font-weight: 600;
    padding: 4px 6px;
    margin: 0 2px;
    border-radius: 0;
    min-width: 120px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 0 rgba(99, 102, 241, 0.2);
}

@keyframes pulse-glow-input {
    0% { box-shadow: 0 3px 0 var(--primary); }
    50% { box-shadow: 0 3px 0 var(--secondary), 0 0 10px var(--primary); }
    100% { box-shadow: 0 3px 0 var(--primary); }
}

.inline-url-input:focus {
    outline: none;
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 3px 0 var(--primary);
    animation: pulse-glow-input 1.5s infinite;
}

.inline-url-suffix {
    color: var(--text-secondary);
    font-weight: 500;
    opacity: 0.9;
    user-select: none;
}

.inline-url-edit-active a {
    display: none; 
}

.inline-url-edit-active .inline-url-editor {
    display: inline-flex;
}

.inline-url-editor {
    display: none;
    align-items: center;
    animation: fadeIn 0.2s ease;
    flex-grow: 1;
}

.inline-url-badge {
    display: inline-block;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.cancel-upload-btn {
    position: absolute;
    right: -6px; /* Position slightly outside container to avoid overflow issues */
    top: 50%;
    transform: translateY(-50%);
    background: rgba(239, 68, 68, 0.85);
    color: white;
    border: none;
    border-radius: 4px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.9;
    z-index: 10;
    padding: 0; /* Remove any default padding */
    line-height: 1; /* Fix line height issues */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cancel-upload-btn:hover {
    background: rgb(239, 68, 68);
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
    color: #ffffff;
}

.cancel-upload-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* Make sure the progress container is positioned relatively for the absolute positioning of the cancel button */
.progress-container {
    position: relative;
}

.cancel-upload-btn i {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Animation for fading out cancelled uploads */
@keyframes fadeOutLeft {
    0% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(-20px); }
}

.file-upload-status.cancelled {
    animation: fadeOutLeft 0.5s forwards;
}

/* Make sure the upload status container has a min-height when empty */
.upload-status-container:empty {
    display: none !important;
}
