/* Import Google Font 'Outfit' */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --primary-color: #5865F2;
    --accent-color: #FF0000;
    --dark-bg: #1e1e1e;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-color: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    /* Better for mobile browsers */
    /* Ensure content is centered and has breathing room */
    padding: 2rem 1rem;
    font-family: 'Outfit', sans-serif;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* Animated Gradient Background */
    background: linear-gradient(45deg, #0f0c29, #302b63, #24243e, #5865F2, #FF0000);
    background-size: 400% 400%;
    animation: gradientwechsel 20s ease infinite;
    overflow-x: hidden;
    cursor: auto;
}

@keyframes gradientwechsel {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Glassmorphism Card Container */
/* Glassmorphism Card Container */
.container {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    /* Medium padding */
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 8px 32px 0 var(--shadow-color);
    z-index: 10;
    max-width: 90%;
    width: 360px;
    /* Medium width */
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.container:hover {
    transform: translateY(-5px);
}

/* Logo */
.logo {
    width: 135px;
    /* Medium logo */
    height: 135px;
    border-radius: 22px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 18px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
    image-rendering: pixelated;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.logo:hover {
    transform: scale(1.05) rotate(3deg);
    box-shadow: 0 0 50px rgba(88, 101, 242, 0.6);
}

/* Typography */
h1 {
    font-size: 2.25rem;
    /* Medium title */
    font-weight: 700;
    margin-bottom: 0.4rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
    text-align: center;
}

.subtitle {
    font-size: 1.05rem;
    /* Medium subtitle */
    font-weight: 300;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1.8rem;
    text-align: center;
    letter-spacing: 1px;
}

/* Buttons */
.button-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
    /* Medium gap */
    width: 100%;
}

.button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 18px;
    /* Medium padding */
    font-size: 1.05rem;
    /* Medium font */
    font-weight: 600;
    color: white;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    background-size: 200% auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.button i,
.modrinth-icon {
    margin-right: 12px;
    font-size: 1.3rem;
}

.modrinth-icon {
    width: 1.3rem;
    height: 1.3rem;
    fill: currentColor;
}

/* Button Variants with Gradients */
.discord {
    background-image: linear-gradient(to right, #5865F2 0%, #4752c4 51%, #5865F2 100%);
}

.youtube {
    background-image: linear-gradient(to right, #FF0000 0%, #cc0000 51%, #FF0000 100%);
}

.github {
    background-image: linear-gradient(to right, #333333 0%, #1a1a1a 51%, #333333 100%);
}

.modrinth {
    background-image: linear-gradient(to right, #1bd96a 0%, #108a43 51%, #1bd96a 100%);
}

.button:hover {
    background-position: right center;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.4);
}

.button:active {
    transform: translateY(-1px);
}

footer {
    margin-top: 2.5rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    body {
        /* On mobile, avoid forced centering which cuts off content on small screens */
        justify-content: flex-start;
        padding-top: 4rem;
        /* Safe distance from top */
        padding-bottom: 4rem;
        /* Safe distance from bottom */
        height: auto;
        min-height: 100vh;
        /* Allow scrolling */
    }

    .container {
        width: 90%;
        max-width: 380px;
        padding: 2rem 1.5rem;
        /* Tighter padding inside card */
        border-radius: 20px;
    }

    .logo {
        width: 110px;
        /* Smaller logo */
        height: 110px;
        margin-bottom: 12px;
        border-width: 3px;
    }

    h1 {
        font-size: 1.8rem;
        /* Smaller title */
        margin-bottom: 0.2rem;
    }

    .subtitle {
        font-size: 0.95rem;
        margin-bottom: 1.2rem;
    }

    .button {
        padding: 12px 16px;
        /* Touch-friendly but compact */
        font-size: 1rem;
    }
}

/* Admin Modal */
.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    width: 600px;
    /* Wider */
    max-width: 90%;
    background: rgba(30, 30, 30, 0.85);
    /* Semi-transparent dark */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    border-radius: 24px;
    padding: 2rem;
    animation: modalOpen 0.3s ease-out;
}

@keyframes modalOpen {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.close {
    position: absolute;
    top: 20px;
    right: 25px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 28px;
    transition: color 0.3s;
}

.close:hover {
    color: white;
}

.admin-input {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 1.1rem;
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

.admin-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Upload Area */
.upload-area {
    width: 100%;
    padding: 3rem;
    /* Larger drop zone */
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.02);
    color: rgba(255, 255, 255, 0.7);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(88, 101, 242, 0.1);
    color: white;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-top: 15px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary-color);
    transition: width 0.3s;
}

/* Link Box */
.link-box {
    display: flex;
    gap: 10px;
    width: 100%;
}

.link-box input {
    flex: 1;
    padding: 8px;
    border-radius: 6px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: white;
}

.copy-btn {
    padding: 8px 12px;
    border-radius: 6px;
    border: none;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
}

.copy-btn:hover {
    background: #4752c4;
}

/* File List */
.file-list {
    width: 100%;
    margin-top: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 15px;
    max-height: 300px;
    /* Taller list */
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: background 0.2s;
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.file-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    font-size: 1rem;
    font-weight: 500;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
    transition: all 0.2s;
}

.icon-btn:hover {
    transform: scale(1.1);
}

.icon-btn.copy:hover {
    color: #5865F2;
    /* Blue */
}

.icon-btn.delete:hover {
    color: #FF0000;
    /* Red */
}

/* Make footer clickable */
footer {
    cursor: pointer;
    transition: color 0.3s;
}

/* Toast Notification Container */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Toast Item */
.toast {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px 20px;
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
    animation: slideIn 0.3s ease-out forwards;
    opacity: 0;
    transform: translateX(100%);
}

.toast.success {
    border-left: 4px solid #2ecc71;
}

.toast.error {
    border-left: 4px solid #e74c3c;
}

.toast.info {
    border-left: 4px solid #3498db;
}

.toast.hide {
    animation: fadeOut 0.3s ease-in forwards;
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Confirmation Modal */
.modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.btn-danger {
    background: #ff4444;
    color: white;
}

.btn-danger:hover {
    background: #cc0000;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

footer:hover {
    color: white;
    text-decoration: underline;
}

/* Inline Error Message */
.error-msg {
    color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.2);
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 0.9rem;
    display: none;
    align-items: center;
    gap: 8px;
}

.error-msg.show {
    display: flex;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* Falling Items Animation */
@keyframes fall {
    from {
        transform: translateY(-50px) rotate(0deg);
    }

    to {
        transform: translateY(110vh) rotate(360deg);
    }
}