#qrcode {
    margin: 1rem auto;
}
.message-copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.8;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.message-copy-btn:hover {
    background: var(--primary-hover);
    opacity: 1;
    transform: scale(1.1);
}
.collapsible-box {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    margin-bottom: 1.5rem;
}
.collapsible-header {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    gap: 0.5rem;
}
.collapsible-content {
    display: block;
    transition: max-height 0.3s ease;
}
.btn-sm {
    padding: 0.3rem 0.7rem !important;
    font-size: 0.9rem !important;
    border-radius: var(--radius-sm) !important;
}

.btn-secondary {
    background: var(--error-color) !important;
}

.session-status {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin: 1rem 0;
    text-align: center;
}

.session-status .device-count {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.session-status .session-id {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.session-actions {
    text-align: center;
    margin: 1rem 0;
}
/* Sulivaa main styles migrated from main.go */
:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 1rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100"><path d="M0,0v46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1047.62,9.26,1064,6.91V0Z" fill="rgba(255,255,255,0.1)"/></svg>') repeat-x;
    background-size: 1000px 100px;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

.main-content {
    padding: 2rem;
}

.section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section h3 {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.qr-container {
    text-align: center;
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border-color);
}


#qrcode {
    margin: 1rem auto;
}

.link-display {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.link-display h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.link-url {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    background: var(--bg-secondary);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    word-break: break-all;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.status {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    display: none;
    transition: all 0.3s ease;
}

.status.waiting {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.status.connected {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.status.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.device-info {
    margin: 1rem 0;
    padding: 1rem;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: var(--radius-md);
    font-weight: 500;
    color: #0c4a6e;
    display: none;
    transition: all 0.3s ease;
}

.device-info .device-count {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.device-info .device-list {
    font-size: 0.9rem;
    opacity: 0.8;
}

.session-indicator {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: var(--success-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    display: none;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.session-indicator.connected {
    display: block;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.messages-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.messages-header {
    background: var(--bg-secondary);
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-primary);
}

#messages {
    padding: 1rem;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
}

.message {
    margin: 0.75rem 0;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    word-break: break-word;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
    position: relative;
}

.message:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.message-copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-copy-btn:hover {
    background: var(--primary-hover);
    opacity: 1;
    transform: scale(1.1);
}

.message.from-self {
    background: #dbeafe;
    border-left-color: var(--primary-color);
    margin-left: 2rem;
}

.message.from-other {
    background: #f3f4f6;
    border-left-color: var(--success-color);
    margin-right: 2rem;
}

.message strong {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

.input-group {
    margin: 1rem 0;
}

.input-group label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--bg-primary);
}

.input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-with-btn {
    display: flex;
    gap: 0.75rem;
    align-items: end;
}

.input-with-btn .input {
    flex: 1;
}

.empty-state {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    padding: 2rem;
}

.mobile-section {
    display: none;
}

@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }

    .header {
        padding: 1.5rem;
    }

    .header h1 {
        font-size: 2rem;
    }

    .main-content {
        padding: 1.5rem;
    }

    .section {
        padding: 1rem;
    }

    .mobile-section {
        display: block;
    }
    
    .desktop-section {
        display: none;
    }

    .input-with-btn {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .message.from-self {
        margin-left: 1rem;
    }

    .message.from-other {
        margin-right: 1rem;
    }

    .session-indicator {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 1rem;
    }

    .btn {
        min-height: 44px; /* Better touch targets */
        font-size: 1rem;
    }

    .qr-container {
        padding: 1rem;
    }

    #qrcode {
        margin: 0.5rem auto;
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

@media (max-width: 768px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .feature-item {
        padding: 0.75rem;
    }
    
    .feature-item i {
        font-size: 1.5rem;
    }
    
    .feature-item h4 {
        font-size: 0.8rem;
    }
    
    .feature-item p {
        font-size: 0.7rem;
    }
}

@media (max-width: 400px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .feature-item {
        padding: 0.5rem;
    }
}

.feature-item {
    text-align: center;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.feature-item i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.feature-item h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.feature-item p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* End migrated Sulivaa styles */
