@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600&display=swap');

:root {
    --primary: #60a5fa;
    --primary-hover: #3b82f6;
    --bg-gradient: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
    --card-bg: rgba(255, 255, 255, 0.8);
    --card-border: rgba(255, 255, 255, 0.6);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --glass-shadow: 0 8px 32px 0 rgba(96, 165, 250, 0.15);
    --success: #10b981;
    --error: #ef4444;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Kanit', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #334155;
    overflow-x: hidden;
}

.container {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid #ffffff;
    border-radius: 24px;
    padding: 3rem 2rem;
    box-shadow: var(--glass-shadow);
    width: 90%;
    max-width: 500px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.container::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.4) 0%, rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #818cf8, #c084fc);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

p.subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1rem;
}

.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
    position: relative;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 1rem 1.2rem;
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid var(--card-border);
    border-radius: 16px;
    font-size: 1rem;
    color: white;
    font-family: 'Kanit', sans-serif;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
    background: rgba(15, 23, 42, 0.8);
}

button {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    padding: 1rem;
    border: none;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-family: 'Kanit', sans-serif;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

button:active {
    transform: scale(0.98);
}

/* Result Box */
#result {
    margin-top: 2rem;
    padding: 0;
    display: none;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#result.success .result-card {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

#result.error .result-card {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 1rem;
}

.result-card {
    border-radius: 16px;
    padding: 1.5rem;
    text-align: left;
}

.short-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #f8fafc;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    margin-top: 1rem;
    border: 1px solid #e2e8f0;
}

.short-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1.1rem;
}

.short-link a:hover {
    text-decoration: underline;
}

.copy-btn {
    background: #f1f5f9;
    color: var(--text-main);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    width: auto;
    border-radius: 8px;
    box-shadow: none;
}

.copy-btn:hover {
    background: #e2e8f0;
    transform: none;
}

.footer-link {
    margin-top: 2rem;
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-link:hover {
    color: white;
}

/* Admin Dashboard Overrides */
.dashboard {
    max-width: 1200px;
    padding: 2rem;
}

.dashboard table {
    width: 100%;
    margin-top: 2rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.dashboard th {
    background: #f1f5f9;
    color: var(--text-muted);
    font-weight: 500;
    padding: 1.2rem 1rem;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0;
}

.dashboard td {
    padding: 1.2rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    color: var(--text-main);
}

.dashboard tr:hover {
    background: #f8fafc;
}

.action-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: inline-block;
}

.delete-btn {
    background: #fee2e2;
    color: #ef4444;
    border: 1px solid #fecaca;
}

.delete-btn:hover {
    background: #ef4444;
    color: #fff;
}

.header-top h1 {
    font-size: 1.8rem;
    margin: 0;
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    .container {
        width: 95%;
        padding: 2rem 1.5rem;
    }

    .dashboard table,
    .dashboard thead,
    .dashboard tbody,
    .dashboard th,
    .dashboard td,
    .dashboard tr {
        display: block;
    }

    .dashboard thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .dashboard tr {
        margin-bottom: 1rem;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 12px;
        padding: 1rem;
    }

    .dashboard td {
        border: none;
        position: relative;
        padding-left: 50%;
        text-align: right;
    }

    .dashboard td:before {
        position: absolute;
        top: 1.2rem;
        left: 1rem;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        content: attr(data-label);
        text-align: left;
        color: var(--text-muted);
        font-weight: 500;
    }
}