/**
 * ChatLite v4.0 - Complete Styles
 * True P2P Architecture
 */

/* ==================== Reset & Variables ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    
    /* Colors */
    --primary: #667eea;
    --primary-dark: #5568d3;
    --primary-light: #8b9cff;
    
    /* Background */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    
    /* Text */
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-tertiary: #adb5bd;
    --text-inverse: #ffffff;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
    --shadow-xl: 0 12px 48px rgba(0,0,0,0.2);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    
    /* Safe Area */
    --safe-top: env(safe-area-inset-top);
    --safe-bottom: env(safe-area-inset-bottom);
    --safe-left: env(safe-area-inset-left);
    --safe-right: env(safe-area-inset-right);
}

/* ==================== Dark Mode ==================== */
body.dark-mode {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2a2a2a;
    --bg-tertiary: #3a3a3a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-tertiary: #808080;
}

body.dark-mode .message.received {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

body.dark-mode .room-item,
body.dark-mode .dialog,
body.dark-mode .native-notification {
    background: var(--bg-secondary);
}

/* ==================== Base Styles ==================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    height: 100vh;
    transition: background 0.3s, color 0.3s;
}

.screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

/* ==================== Loading Screen ==================== */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeOut 0.5s ease 1s forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        pointer-events: none;
    }
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-logo {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.loading-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    margin: 20px auto;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 14px;
    opacity: 0.9;
}

/* ==================== Login Screen ==================== */
#login-screen {
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 48px;
    animation: slideDown 0.6s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
}

.logo-icon {
    font-size: 80px;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
}

.logo-title {
    font-size: 48px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
    letter-spacing: -2px;
}

.logo-subtitle {
    font-size: 16px;
    color: rgba(255,255,255,0.9);
}

.profile-image-selector {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 32px;
}

.profile-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: var(--shadow-lg);
}

.profile-image-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.profile-image-btn:hover {
    transform: scale(1.1);
}

.login-form {
    animation: slideUp 0.6s ease 0.2s both;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
}

.login-footer {
    margin-top: 32px;
    animation: fadeIn 0.6s ease 0.4s both;
}

@keyframes fadeIn {
    from { opacity: 0; }
}

.feature-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    color: white;
    font-weight: 500;
}

/* ==================== Input Fields ==================== */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-field {
    width: 100%;
    padding: 18px 20px;
    padding-right: 50px;
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    font-size: 16px;
    background: rgba(255,255,255,0.95);
    color: var(--text-primary);
    transition: all 0.3s;
    outline: none;
}

.input-field:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.input-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    opacity: 0.5;
    pointer-events: none;
}

/* ==================== Buttons ==================== */
.btn-primary {
    width: 100%;
    padding: 18px 32px;
    background: white;
    color: var(--primary);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-large {
    padding: 20px 32px;
    font-size: 18px;
}

.btn-secondary {
    padding: 14px 28px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--bg-secondary);
}

.btn-icon-only {
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon-only:hover {
    background: rgba(0,0,0,0.05);
}

.btn-icon-only:active {
    transform: scale(0.95);
}

.btn-icon-only.recording {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%) !important;
    color: white !important;
    animation: pulse-recording 1s infinite !important;
    box-shadow: 0 0 0 4px rgba(245, 87, 108, 0.3) !important;
}

@keyframes pulse-recording {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 4px rgba(245, 87, 108, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(245, 87, 108, 0.2);
    }
}

/* ==================== Header ==================== */
.header {
    background: white;
    padding: 16px 20px;
    padding-top: calc(16px + var(--safe-top));
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--bg-tertiary);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    flex: 1;
}

.header-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-tertiary);
    animation: pulse 2s infinite;
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(0.95);
    }
}

.status-text {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ==================== Search ==================== */
.search-container {
    padding: 12px 20px;
    background: white;
    border-bottom: 1px solid var(--bg-tertiary);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 16px;
    font-size: 18px;
    opacity: 0.5;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 2px solid var(--bg-tertiary);
    border-radius: var(--radius-full);
    font-size: 15px;
    background: var(--bg-secondary);
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* ==================== Action Buttons ==================== */
.action-buttons {
    display: flex;
    gap: 12px;
    padding: 12px 20px;
    background: white;
    border-bottom: 1px solid var(--bg-tertiary);
}

.btn-action {
    flex: 1;
    padding: 12px 20px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: var(--shadow-md);
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-action:active {
    transform: translateY(0);
}

.btn-action .icon {
    font-size: 18px;
}

/* ==================== Room List ==================== */
.rooms-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
    background: var(--bg-secondary);
}

.room-item {
    background: white;
    padding: 16px;
    border-radius: var(--radius-lg);
    margin-bottom: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.room-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.room-item:active {
    transform: scale(0.98);
}

.room-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.room-info {
    flex: 1;
    min-width: 0;
}

.room-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.room-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.room-time {
    font-size: 12px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.room-preview {
    font-size: 14px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==================== Chat Screen ==================== */
.chat-header {
    background: white;
    padding: 12px 16px;
    padding-top: calc(12px + var(--safe-top));
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--bg-tertiary);
}

.btn-back {
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-back:hover {
    background: rgba(102, 126, 234, 0.1);
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-user-info {
    flex: 1;
    min-width: 0;
}

.chat-user-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-user-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.typing-indicator {
    padding: 8px 20px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 13px;
    font-style: italic;
    border-bottom: 1px solid var(--bg-tertiary);
}

/* ==================== Messages ==================== */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    padding-bottom: calc(20px + var(--safe-bottom));
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-wrapper {
    display: flex;
    gap: 8px;
    max-width: 80%;
    animation: messageIn 0.3s ease;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
}

.message-wrapper.sent {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-wrapper.received {
    align-self: flex-start;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-username {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.message {
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: var(--shadow-sm);
}

.message.sent {
    background: var(--gradient-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.received {
    background: white;
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.message-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
}

.message-time {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* Reply Reference */
.reply-reference {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    padding: 8px;
    background: rgba(0,0,0,0.05);
    border-radius: var(--radius-md);
}

.reply-line {
    width: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.reply-content {
    flex: 1;
    min-width: 0;
}

.reply-username {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 2px;
}

.reply-text {
    font-size: 13px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Voice Message */
.voice-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    min-width: 200px;
}

.voice-message.sent {
    background: var(--gradient-primary);
    color: white;
}

.voice-message.received {
    background: white;
    color: var(--text-primary);
}

.voice-play-btn {
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.voice-waveform {
    flex: 1;
    height: 24px;
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}

.voice-duration {
    font-size: 12px;
    font-weight: 600;
}

/* File Message */
.file-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    min-width: 280px;
    box-shadow: var(--shadow-sm);
}

.file-message.sent {
    background: var(--gradient-primary);
    color: white;
}

.file-message.received {
    background: white;
    color: var(--text-primary);
}

.file-icon {
    font-size: 36px;
    line-height: 1;
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-size: 12px;
    opacity: 0.8;
}

.file-download-btn {
    padding: 8px 16px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--radius-md);
    color: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}

.file-download-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

.file-message.received .file-download-btn {
    background: var(--primary);
    color: white;
    border: none;
}

/* Reply Box */
.reply-box {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--bg-tertiary);
}

.reply-box .reply-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 4px;
}

.reply-cancel-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== Chat Input ==================== */
.chat-input-container {
    background: white;
    padding: 12px 16px;
    padding-bottom: calc(12px + var(--safe-bottom));
    border-top: 1px solid var(--bg-tertiary);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.05);
}

.chat-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 8px 12px;
}

.message-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px;
    font-size: 16px;
    resize: none;
    max-height: 120px;
    overflow-y: auto;
    font-family: inherit;
    color: var(--text-primary);
}

.message-input:focus {
    outline: none;
}

.btn-send {
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--gradient-primary);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
}

.btn-send:not(:disabled):hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.btn-send:disabled {
    background: var(--bg-tertiary);
    cursor: not-allowed;
    opacity: 0.5;
}

/* ==================== Emoji Picker ==================== */
.emoji-picker {
    position: fixed;
    bottom: calc(80px + var(--safe-bottom));
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 360px;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    max-height: 400px;
    overflow: hidden;
}

.emoji-header {
    padding: 16px;
    border-bottom: 1px solid var(--bg-tertiary);
    font-weight: 600;
    text-align: center;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    padding: 12px;
    max-height: 340px;
    overflow-y: auto;
}

.emoji-item {
    width: 100%;
    aspect-ratio: 1;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.emoji-item:hover {
    background: var(--bg-secondary);
    transform: scale(1.2);
}

/* ==================== Dialogs ==================== */
.dialog-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.dialog {
    background: white;
    border-radius: var(--radius-xl);
    max-width: 440px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
}

.dialog-header {
    padding: 24px 24px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--bg-tertiary);
}

.dialog-title {
    font-size: 22px;
    font-weight: 700;
}

.dialog-close {
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.dialog-close:hover {
    background: var(--bg-secondary);
}

.dialog-body {
    padding: 24px;
}

.dialog-description {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

.dialog-footer {
    padding: 16px 24px 24px;
    display: flex;
    gap: 12px;
}

.dialog-footer button {
    flex: 1;
}

/* Profile Section */
.profile-image-section {
    text-align: center;
    margin-bottom: 24px;
}

.profile-preview-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 16px;
    border: 4px solid var(--bg-tertiary);
}

.profile-image-btn-large {
    padding: 10px 24px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

/* My ID Box */
.my-id-box {
    margin-top: 24px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--bg-tertiary);
}

.my-id-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.my-id-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.my-id-code {
    flex: 1;
    padding: 10px 12px;
    background: white;
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--primary);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-copy {
    width: 44px;
    height: 44px;
    padding: 0;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: var(--shadow-md);
}

/* Member Selection */
.member-selection-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 20px;
    margin-bottom: 12px;
}

.member-selection {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: 12px;
}

.member-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.member-checkbox:hover {
    background: var(--bg-secondary);
}

.member-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.member-checkbox img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* ==================== Notifications ==================== */
.notification {
    position: fixed;
    top: calc(20px + var(--safe-top));
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 16px 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 5000;
    max-width: 90%;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
    border-left: 4px solid var(--primary);
}

.notification.success {
    background: var(--success);
    color: white;
}

.notification.error {
    background: var(--error);
    color: white;
}

.notification.info {
    background: var(--info);
    color: white;
}

.native-notification {
    position: fixed;
    top: calc(20px + var(--safe-top));
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 400px;
    background: white;
    border-radius: var(--radius-xl);
    padding: 16px;
    box-shadow: var(--shadow-xl);
    z-index: 5000;
    animation: slideDown 0.4s ease;
    border-left: 4px solid var(--primary);
}

.native-notification-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.native-notification-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.native-notification-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
}

.native-notification-body {
    font-size: 15px;
    color: var(--text-primary);
    margin-left: 56px;
    line-height: 1.5;
}

/* ==================== Empty State ==================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    padding: 40px 20px;
    text-align: center;
}

.empty-state-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.empty-state-text {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 280px;
}

/* ==================== Scrollbar ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* ==================== Responsive ==================== */
@media (min-width: 768px) {
    .logo-icon {
        font-size: 100px;
    }
    
    .logo-title {
        font-size: 56px;
    }
    
    .message-wrapper {
        max-width: 65%;
    }
}

@media (min-width: 1024px) {
    .screen {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
        box-shadow: var(--shadow-xl);
    }
    
    body {
        background: var(--bg-tertiary);
    }
}

@media (max-width: 375px) {
    .logo-title {
        font-size: 40px;
    }
    
    .message {
        font-size: 14px;
        padding: 10px 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (display-mode: standalone) {
    body {
        background: var(--bg-primary);
    }
}

@supports (-webkit-touch-callout: none) {
    .header {
        padding-top: max(16px, var(--safe-top));
    }
}