:root {
    --primary-gradient: linear-gradient(135deg, #1f2937 0%, #4b5563 100%);
    --primary-color: #111827;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-color: #111827;
    --text-muted: #6b7280;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --card-border: rgba(229, 231, 235, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-image:
        radial-gradient(at 0% 0%, rgba(255, 255, 255, 0.8) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(255, 255, 255, 0.8) 0px, transparent 50%);
}

.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    animation: float 25s infinite ease-in-out;
}

.bg-orb-1 {
    width: 40vw;
    height: 40vw;
    background: rgba(229, 231, 235, 0.8);
    top: -10%;
    left: 20%;
    animation-delay: 0s;
}

.bg-orb-2 {
    width: 50vw;
    height: 50vw;
    background: rgba(209, 213, 219, 0.6);
    bottom: -5%;
    right: 10%;
    animation-delay: -5s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(30px, -20px);
    }
}

/* Navigation */
.top-nav {
    position: absolute;
    top: 2rem;
    left: 2rem;
    z-index: 100;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--text-color);
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.nav-link svg {
    width: 18px;
    height: 18px;
}

.container {
    width: 90%;
    max-width: 500px;
    /* Smaller container for this tool */
    z-index: 10;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow);
}

h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

p.subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Login Section */
#loginSection {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qr-placeholder {
    width: 250px;
    height: 250px;
    background: #f9fafb;
    border: 2px dashed #e5e7eb;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.qr-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qr-loading {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Main Section */
#mainSection {
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2rem;
    padding: 8px 16px;
    background: #f3f4f6;
    border-radius: 50px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5e7eb;
}

.user-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color);
}

.moyu-btn {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: none;
    background: #ffffff;
    box-shadow:
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05),
        inset 0 0 0 8px #f3f4f6;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.moyu-btn::before {
    content: '🐟';
    font-size: 80px;
    display: block;
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

.moyu-btn span {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
}

.moyu-btn:hover {
    transform: scale(1.05);
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04),
        inset 0 0 0 4px #e5e7eb;
}

.moyu-btn:hover::before {
    transform: rotate(15deg) scale(1.1);
}

.moyu-btn:active {
    transform: scale(0.95);
}

.moyu-btn.clocked-in {
    background: #f0fdf4;
    /* Light green */
    box-shadow: inset 0 0 0 8px #dcfce7;
    cursor: default;
    pointer-events: none;
}

.moyu-btn.clocked-in::before {
    content: '✅';
}

.status-text {
    margin-top: 2rem;
    font-size: 1.1rem;
    color: var(--text-muted);
    min-height: 1.6em;
}

/* Config Button */
.config-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 10;
}

.config-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-color);
}

.logout-btn {
    position: absolute;
    top: 20px;
    right: 60px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 10;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-overlay.open {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: scale(0.95);
    transition: transform 0.3s;
}

.modal-overlay.open .modal-content {
    transform: scale(1);
}

.contact-list {
    margin: 1.5rem 0;
    max-height: 250px;
    overflow-y: auto;
}

.contact-item {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
    background: #f9fafb;
    padding: 12px;
    border-radius: 12px;
}

.contact-info {
    flex: 1;
    text-align: left;
}

.contact-name {
    font-weight: 600;
    font-size: 0.95rem;
    display: block;
}

.contact-email {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
}

.btn-icon {
    border: none;
    background: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 4px;
}

.btn-icon:hover {
    color: #ef4444;
}

.add-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    outline: none;
    font-size: 0.9rem;
    background: #f9fafb;
}

.form-input:focus {
    border-color: #111827;
    background: #fff;
}

.action-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.action-btn:hover {
    opacity: 0.9;
}

/* Mobile Blocker */
#mobile-blocker {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--primary-color);
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 2rem;
    text-align: center;
}

#mobile-blocker svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    color: #ef4444;
}

#mobile-blocker h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

#mobile-blocker p {
    color: #9ca3af;
    line-height: 1.6;
}