:root {
    --primary-color: #6366f1;
    --secondary-color: #ec4899;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --dark-bg: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border-color: #334155;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--dark-bg) 0%, #1a1f2e 100%);
    color: var(--text-primary);
    min-height: 100vh;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    color: var(--text-secondary);
    font-size: 1.1em;
    margin-bottom: 20px;
}

.admin-btn {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
}

.admin-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
}

.close {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: var(--text-primary);
}

.login-form {
    margin-top: 20px;
}

.login-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 1em;
}

.login-form input::placeholder {
    color: var(--text-secondary);
}

.login-form button {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
}

.login-form button:hover {
    background: var(--secondary-color);
}

.error {
    color: var(--danger-color);
    margin-top: 10px;
}

/* Admin Panel */
.admin-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}

.admin-panel.hidden {
    display: none;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.logout-btn {
    padding: 8px 16px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.logout-btn:hover {
    opacity: 0.8;
}

.admin-section {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.admin-section h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 1em;
}

.form-group input::placeholder {
    color: var(--text-secondary);
}

.add-btn {
    padding: 12px 24px;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.add-btn:hover {
    background: #059669;
    transform: translateY(-2px);
}

.message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 6px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    text-align: center;
}

.message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* Links List */
.links-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.link-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s;
}

.link-card:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.link-card h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
    word-break: break-all;
}

.link-card .badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.85em;
    margin-right: 8px;
    margin-bottom: 8px;
}

.link-card .badge.proxy {
    background: var(--secondary-color);
}

.link-card .actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.open-btn,
.copy-btn,
.delete-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 0.9em;
}

.open-btn {
    background: var(--primary-color);
    color: white;
}

.open-btn:hover {
    background: #7c7ee6;
}

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

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

.delete-btn {
    background: var(--danger-color);
    color: white;
}

.delete-btn:hover {
    background: #dc2626;
}

/* User View */
.user-view {
    margin-top: 30px;
}

.filter-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.filter-section h2 {
    margin-bottom: 20px;
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.filter-select {
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
}

.empty-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 1.1em;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    .links-list {
        grid-template-columns: 1fr;
    }

    .filters {
        grid-template-columns: 1fr;
    }

    .admin-section {
        padding: 15px;
    }

    .link-card .actions {
        flex-direction: column;
    }

    .open-btn,
    .copy-btn,
    .delete-btn {
        width: 100%;
    }
}
