:root {
    --bg-color: #121416;
    --card-bg: #1e2124;
    --primary: #4eacfe;
    --primary-glow: rgba(78, 172, 254, 0.3);
    --secondary: #a855f7;
    --secondary-glow: rgba(168, 85, 247, 0.3);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --error: #ef4444;
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-family);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
}

.app-container {
    width: 100%;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

header {
    text-align: center;
    animation: fadeInDown 0.8s ease-out;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo-icon {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px var(--primary-glow));
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-muted);
    font-weight: 300;
}

main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.status-card {
    background-color: var(--card-bg);
    border-radius: 28px;
    padding: 40px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.status-card:active {
    transform: scale(0.98);
}

.status-circle {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #2a2d32, #1a1c1e);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.inner-circle {
    width: 100px;
    height: 100px;
    background: var(--card-bg);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
}

/* Animations */
.ripple {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0;
    z-index: 1;
}

.status-card.active .ripple {
    animation: rippleEffect 2s infinite;
}

@keyframes rippleEffect {
    0% {
        transform: scale(1);
        opacity: 0.4;
    }

    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

#instruction-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    padding: 0 20px;
}

.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.btn {
    border: none;
    border-radius: 20px;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn .icon {
    font-size: 1.8rem;
}

.btn .label {
    font-weight: 600;
    font-size: 1rem;
}

.btn .sub {
    font-size: 0.7rem;
    opacity: 0.6;
}

.btn.primary {
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    color: white;
    box-shadow: 0 10px 20px var(--primary-glow);
}

.btn.primary:hover {
    box-shadow: 0 15px 25px var(--primary-glow);
    transform: translateY(-2px);
}

.btn.secondary {
    background: #2a2d32;
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn.secondary:hover {
    background: #32353b;
    transform: translateY(-2px);
}

.log-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.log-section h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

#stamp-log {
    list-style: none;
}

.log-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    animation: slideInRight 0.4s ease-out;
}

.log-item:last-child {
    border-bottom: none;
}

.log-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.log-time {
    font-weight: 600;
    font-size: 1rem;
}

.log-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.log-type {
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

.log-type.entry {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.log-type.exit {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    width: 100%;
    max-width: 400px;
    background: var(--card-bg);
    border-radius: 28px;
    padding: 20px;
    text-align: center;
}

#qr-reader {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
}

.btn-close {
    background: #ef4444;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 600;
}

footer {
    text-align: center;
    padding: 20px 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

#install-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    margin-bottom: 15px;
    font-family: inherit;
    cursor: pointer;
}

#install-btn.hidden {
    display: none;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Status variants */
.status-card.success {
    border-color: var(--success);
}

.status-card.success .status-circle {
    background: linear-gradient(135deg, #10b981, #059669);
}

.status-card.success .ripple {
    background: var(--success);
}

.status-card.error {
    border-color: var(--error);
}

.status-card.error .status-circle {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.status-card.error .ripple {
    background: var(--error);
}

.hidden {
    display: none !important;
}