/* Name Protection Center - Styles */

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #e0e7ff;
    --secondary: #7c3aed;
    --success: #059669;
    --success-light: #ecfdf5;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --warning: #d97706;
    --bg-gradient-start: #eef2ff;
    --bg-gradient-mid: #ffffff;
    --bg-gradient-end: #faf5ff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(to bottom, var(--bg-gradient-start), var(--bg-gradient-mid), var(--bg-gradient-end));
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

/* Header */
.header {
    padding: 3rem 1rem 2rem;
}

.text-center {
    text-align: center;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.logo-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

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

.subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(8px);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.stat-badge strong {
    color: var(--primary);
    font-size: 1.1rem;
}

.stat-badge svg {
    color: var(--primary);
}

/* Sections */
.section {
    padding: 0 0 1.5rem;
}

/* Card */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(79, 70, 229, 0.08);
}

.form-card {
    background: linear-gradient(to bottom, white, rgba(238, 242, 255, 0.3));
}

.card-header {
    padding: 1.25rem 1.5rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-dark);
}

.card-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
}

/* Form */
.form {
    padding: 0 1.5rem 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-group label svg {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

.required {
    color: var(--danger);
}

input[type="text"],
input[type="password"],
input[type="number"] {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s;
    background: white;
    color: var(--text-primary);
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

input::placeholder {
    color: var(--text-muted);
}

.input-short {
    max-width: 120px;
}

.input-full {
    width: 100%;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    padding: 0.85rem;
    border-radius: var(--radius);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

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

.btn-outline {
    background: white;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.btn-outline:hover {
    background: var(--border-light);
    border-color: var(--text-muted);
}

.btn-sm {
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
}

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

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

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 0.4rem;
}

.btn-ghost:hover {
    color: var(--danger);
    background: var(--danger-light);
}

/* Message */
.message {
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: none;
}

.message.success {
    display: block;
    background: var(--success-light);
    color: var(--success);
    border: 1px solid #a7f3d0;
}

.message.error {
    display: block;
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid #fecaca;
}

.error-text {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

.text-danger {
    color: var(--danger);
}

/* List Header */
.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.list-header h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
}

.list-header h2 svg {
    color: var(--primary);
}

.count-badge {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-muted);
    background: var(--border-light);
    padding: 0.15rem 0.65rem;
    border-radius: 9999px;
}

.list-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: flex-end;
}

/* Search */
.search-box {
    position: relative;
    flex: 1;
    max-width: 280px;
}

.search-box svg:first-child {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px;
    height: 16px;
}

.search-box input {
    padding-left: 2rem;
    padding-right: 2rem;
}

.clear-btn {
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-btn:hover {
    color: var(--text-secondary);
}

/* Name List */
.name-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.name-item {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.15rem 1.35rem;
    transition: all 0.2s;
}

.name-item:hover {
    box-shadow: var(--shadow);
    border-color: rgba(79, 70, 229, 0.15);
}

.name-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.name-info {
    flex: 1;
    min-width: 0;
}

.name-title-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}

.name-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.name-nickname {
    font-size: 0.8rem;
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 0.15rem 0.6rem;
    border-radius: 9999px;
    border: 1px solid rgba(79, 70, 229, 0.1);
    white-space: nowrap;
}

.name-status {
    font-size: 0.7rem;
    background: var(--success-light);
    color: var(--success);
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    border: 1px solid #a7f3d0;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    white-space: nowrap;
}

.name-status svg {
    width: 10px;
    height: 10px;
}

.name-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.name-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.name-meta svg {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

.delete-btn {
    opacity: 0;
    transition: opacity 0.2s;
}

.name-item:hover .delete-btn {
    opacity: 1;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: #cbd5e1;
}

.empty-state p:first-of-type {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.empty-state p:last-of-type {
    font-size: 0.875rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 1rem 0;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.6rem;
    border: 1px solid var(--border);
    background: white;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.page-btn:hover {
    background: var(--border-light);
    border-color: var(--text-muted);
}

.page-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0 0.5rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 420px;
    z-index: 101;
    animation: modalIn 0.25s ease-out;
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.15rem 1.25rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--border-light);
    color: var(--text-secondary);
}

.modal-body {
    padding: 1.15rem 1.25rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    padding: 0.75rem 1.25rem 1.15rem;
}

.modal-footer .btn {
    padding: 0.55rem 1.1rem;
}

/* Admin badge */
.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    background: #fef3c7;
    color: #92400e;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    border: 1px solid #fde68a;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 1rem;
    margin-top: 1rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-left,
.footer-right {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.heart {
    color: #f87171;
    fill: #f87171;
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 640px) {
    .logo h1 {
        font-size: 1.8rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .list-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .list-actions {
        justify-content: space-between;
        width: 100%;
    }
    
    .search-box {
        max-width: none;
        flex: 1;
    }
    
    .hide-mobile {
        display: none;
    }
    
    .name-item-header {
        flex-direction: column;
    }
    
    .delete-btn {
        opacity: 1;
        align-self: flex-end;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--border-light);
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
