:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --success-color: #10b981;
    --error-color: #ef4444;
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --text-color: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    margin-bottom: 40px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--surface-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-color);
}

/* Buttons */
.btn-primary,
.logout-btn {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover,
.logout-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.4);
}

.btn-block {
    width: 100%;
}

.btn-copy {
    padding: 10px 20px;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-copy:hover {
    background: #059669;
}

.btn-action {
    padding: 8px 12px;
    background: var(--surface-color);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 6px;
    font-size: 1.2rem;
    display: inline-block;
    transition: all 0.3s ease;
    margin: 0 4px;
}

.btn-action:hover {
    background: var(--border-color);
    transform: scale(1.1);
}

.btn-delete:hover {
    background: var(--error-color);
}

/* Main Content */
main {
    display: grid;
    gap: 30px;
}

section {
    background: var(--surface-color);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

input[type="text"],
input[type="url"],
input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="url"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

small {
    display: block;
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Result Display */
.result {
    margin-top: 30px;
    padding: 20px;
    background: var(--bg-color);
    border-radius: 8px;
    border: 2px solid var(--success-color);
}

.result p {
    margin-bottom: 10px;
    font-weight: 600;
}

.short-url-display {
    display: flex;
    gap: 0;
}

.short-url-display input {
    flex: 1;
    border-radius: 8px 0 0 8px;
    border-right: none;
}

/* Messages */
.success {
    padding: 16px;
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid var(--success-color);
    border-radius: 8px;
    color: var(--success-color);
    margin-bottom: 20px;
    font-weight: 600;
}

.error {
    padding: 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--error-color);
    border-radius: 8px;
    color: var(--error-color);
    margin-bottom: 20px;
    font-weight: 600;
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-color);
}

th {
    padding: 16px;
    text-align: left;
    font-weight: 700;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

tr:hover {
    background: var(--bg-color);
}

.short-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

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

.long-url a {
    color: var(--text-secondary);
    text-decoration: none;
}

.long-url a:hover {
    color: var(--text-color);
}

.no-urls {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.login-box {
    background: var(--surface-color);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    text-align: center;
}

.login-box h1 {
    margin-bottom: 10px;
}

.login-subtitle {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.login-box .form-group {
    text-align: left;
}

/* Error Page */
.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.error-container {
    text-align: center;
    padding: 40px;
}

.error-container h1 {
    font-size: 6rem;
    margin-bottom: 20px;
}

.error-container p {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    table {
        font-size: 0.875rem;
    }
    
    th, td {
        padding: 10px 8px;
    }
    
    .btn-action {
        font-size: 1rem;
        padding: 6px 10px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

section {
    animation: fadeIn 0.5s ease;
}
