:root {
    --bg-color: #0f111a;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --input-bg: rgba(15, 17, 26, 0.6);
    --error: #ef4444;
    --success: #10b981;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* Background Animated Blobs */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #3b82f6;
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: #8b5cf6;
    bottom: -200px;
    right: -100px;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(50px, 50px) scale(1.1); }
    66% { transform: translate(-30px, 20px) scale(0.9); }
}

.container {
    width: 100%;
    max-width: 1000px;
    padding: 3rem 1.5rem;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.input-group {
    margin-bottom: 1.5rem;
}

.admin-section .input-group {
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

input {
    width: 100%;
    padding: 1rem;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.slug-wrapper {
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.slug-wrapper:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.prefix {
    padding: 1rem;
    color: var(--text-secondary);
    background: rgba(0,0,0,0.2);
    font-size: 1rem;
}

.slug-wrapper input {
    border: none;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.slug-wrapper input:focus {
    box-shadow: none;
}

button {
    width: 100%;
    padding: 1rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

button:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px rgba(59, 130, 246, 0.5);
}

button:active {
    transform: translateY(0);
}

/* Loader */
.loader {
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top: 2px solid white;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

/* Messages */
.message {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

.message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.history-section .message {
    margin-top: -0.25rem;
    margin-bottom: 1.5rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Table */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    font-size: 0.95rem;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.link-short {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    word-break: break-all;
    display: inline-block;
    max-width: 250px;
}

.link-short:hover {
    text-decoration: underline;
}

.link-original {
    color: var(--text-secondary);
    max-width: 250px;
    word-break: break-all;
    display: inline-block;
}

.clicks-badge {
    background: rgba(255,255,255,0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icon-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: auto;
    display: inline-flex;
}

.icon-btn:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    transform: translateY(0);
    box-shadow: none;
}

.icon-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

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

.delete-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    color: var(--error);
    border-color: rgba(239, 68, 68, 0.35);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(3, 7, 18, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-panel {
    width: min(100%, 440px);
    background: #151824;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
    padding: 1.5rem;
    animation: modalIn 0.18s ease-out;
}

.modal-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--error);
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.24);
}

.modal-content h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.modal-content p {
    color: var(--text-secondary);
    line-height: 1.5;
}

.modal-slug {
    margin-top: 0.9rem;
    padding: 0.75rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary) !important;
    word-break: break-all;
    font-size: 0.92rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.modal-btn {
    width: auto;
    min-width: 110px;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    box-shadow: none;
}

.modal-btn:hover {
    transform: translateY(0);
    box-shadow: none;
}

.modal-btn.secondary {
    color: var(--text-primary);
    background: transparent;
    border: 1px solid var(--glass-border);
}

.modal-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

.modal-btn.danger {
    background: var(--error);
}

.modal-btn.danger:hover {
    background: #dc2626;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 768px) {
    .container {
        padding: 1.5rem 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .glass-panel {
        padding: 1.5rem;
    }
    
    th, td {
        padding: 0.75rem;
    }

    .modal-actions {
        flex-direction: column-reverse;
    }

    .modal-btn {
        width: 100%;
    }
}
