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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

nav {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-container h1 {
    font-size: 1.5rem;
    color: #667eea;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: #667eea;
}

main {
    padding: 2rem;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.card h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

input[type="text"],
input[type="url"],
input[type="password"],
textarea {
    width: 100%;
    padding: 0.875rem;
    margin-bottom: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
}

textarea {
    resize: vertical;
    font-family: inherit;
}

button {
    width: 100%;
    padding: 0.875rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background: #5568d3;
}

button:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle input:checked + .toggle-slider {
    background-color: #667eea;
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.result-url {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.result-url input {
    flex: 1;
    margin-bottom: 0;
}

.result-url button {
    width: auto;
    padding: 0.875rem 1.5rem;
}

#result {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e0e0e0;
}

#result h3 {
    margin-bottom: 0.5rem;
    color: #667eea;
}

.url-item {
    padding: 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.url-item h3 {
    color: #667eea;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.url-item p {
    margin-bottom: 0.5rem;
    color: #666;
}

.url-item .url-meta {
    font-size: 0.875rem;
    color: #999;
}

.url-item a {
    color: #667eea;
    text-decoration: none;
    word-break: break-all;
}

.url-item a:hover {
    text-decoration: underline;
}

.delete-btn {
    background: #dc3545;
    margin-top: 1rem;
}

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

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.admin-header button {
    width: auto;
    padding: 0.5rem 1.5rem;
}

.admin-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.loading {
    text-align: center;
    color: #999;
    padding: 2rem;
}

.error {
    color: #dc3545;
    margin-top: 1rem;
    text-align: center;
}

.success {
    color: #28a745;
    margin-top: 1rem;
    text-align: center;
}

.note {
    color: #ff9800;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #fff3cd;
    border-radius: 6px;
    border-left: 4px solid #ff9800;
}

.info-text {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #28a745;
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* Loading spinner for buttons */
button.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.85;
}

button.loading .btn-text {
    visibility: hidden;
}

button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .container {
        padding: 0 1rem;
    }

    .card {
        padding: 1.5rem;
    }

    .admin-header {
        flex-direction: column;
        gap: 1rem;
    }

    .admin-header button {
        width: 100%;
    }
}
