:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --error: #ef4444;
    --success: #10b981;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding-top: 4rem;
}

/* Background animated blobs */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

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

.blob-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: #3b82f6;
    animation-delay: 0s;
}

.blob-2 {
    bottom: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: #8b5cf6;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 50px) scale(1.2); }
}

.top-nav {
    position: absolute;
    top: 1rem;
    right: 2rem;
    z-index: 20;
}

.nav-btn {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

header {
    text-align: center;
}

.logo {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}

.logo span {
    color: var(--primary);
}

.subtitle {
    font-size: 1.1rem;
    color: #94a3b8;
    font-weight: 300;
}

/* Glassmorphism panel */
.glass-panel {
    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;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.main-panel {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.input-group {
    display: flex;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

input[type="url"], input[type="text"], input[type="password"] {
    flex-grow: 1;
    background: transparent;
    border: none;
    padding: 1rem 1.2rem;
    color: var(--text-color);
    font-size: 1.1rem;
    font-family: inherit;
    outline: none;
}

input[type="url"]::placeholder, input[type="text"]::placeholder, input[type="password"]::placeholder {
    color: #64748b;
}

.primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(139, 92, 246, 0.3);
}

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

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

.error-message {
    color: var(--error);
    margin-top: 1rem;
    font-size: 0.9rem;
    min-height: 1.2rem;
    text-align: center;
}

/* Result Area */
.result-container {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-container p {
    color: #94a3b8;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.result-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

#short-url {
    color: var(--primary);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    word-break: break-all;
}

#short-url:hover {
    text-decoration: underline;
}

.icon-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-color);
}

.toast {
    margin-top: 1rem;
    text-align: center;
    color: var(--success);
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 400px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #94a3b8;
}

.close-btn:hover {
    color: white;
}

.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-content input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}

.modal-content .primary-btn {
    padding: 1rem;
}

/* Dashboard */
.dashboard-panel {
    width: 100%;
}

.dashboard-panel h2 {
    margin-bottom: 1.5rem;
}

.table-responsive {
    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: #94a3b8;
    font-weight: 600;
}

td a {
    color: var(--primary);
    text-decoration: none;
}

td a:hover {
    text-decoration: underline;
}

.action-btns {
    display: flex;
    gap: 0.5rem;
}

footer {
    text-align: center;
    font-size: 0.85rem;
    color: #64748b;
    margin-top: auto;
    padding: 2rem 0;
}

@media (max-width: 640px) {
    .input-group {
        flex-direction: column;
        background: transparent;
        border: none;
        padding: 0;
    }
    
    .input-group input[type="url"] {
        background: rgba(15, 23, 42, 0.6);
        border: 1px solid var(--glass-border);
        border-radius: 12px;
        margin-bottom: 1rem;
        width: 100%;
    }
    
    .input-group button[type="submit"] {
        width: 100%;
        padding: 1rem;
    }
}
