/* Global Styles - Walkie Talkie Theme */
:root {
    --primary-color: #2E3440;
    --primary-dark: #1E2228;
    --secondary-color: #EBCB8B;
    --accent-color: #88C0D0;
    --speaker-color: #434C5E;
    --background: linear-gradient(135deg, #4C566A 0%, #5E81AC 100%);
    --surface: #3B4252;
    --text-primary: #ECEFF4;
    --text-secondary: #D8DEE9;
    --danger: #BF616A;
    --success: #A3BE8C;
    --border-radius: 12px;
    --shadow: 0 4px 8px rgba(0,0,0,0.3);
    --shadow-elevated: 0 8px 16px rgba(0,0,0,0.4);
    --incoming-call-color: #A3BE8C;
    --metallic-gradient: linear-gradient(145deg, #4C566A 0%, #434C5E 50%, #3B4252 100%);
    --button-gradient: linear-gradient(145deg, #5E81AC 0%, #434C5E 100%);
}

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

html {
    background: var(--background);
    min-height: 100vh;
}

body {
    font-family: 'Roboto Mono', 'Courier New', monospace;
    background: var(--background);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
    max-height: 100vh;
}

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

::-webkit-scrollbar-track {
    background: var(--primary-dark);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--metallic-gradient);
    border-radius: 10px;
    border: 2px solid var(--primary-dark);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--button-gradient);
}

/* Firefox Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--speaker-color) var(--primary-dark);
}

/* Screen Management */
.screen {
    display: none;
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100); /* iOS Safari fix */
}

.screen.active {
    display: block;
}

/* Auth Screen */
.auth-container {
    min-height: 100vh;
    min-height: -webkit-fill-available; /* iOS Safari fix */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    position: relative;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.logo {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.logo-img {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
}

.logo h1 {
    font-size: 24px;
    font-weight: 500;
}

.auth-form {
    display: none;
    background: var(--surface);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-elevated);
    width: 100%;
    max-width: 400px;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 20px;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--primary-dark);
    border-radius: var(--border-radius);
    font-size: 16px; /* Prevent zoom on iOS */
    -webkit-appearance: none;
    -webkit-border-radius: var(--border-radius);
    box-sizing: border-box;
    transition: all 0.3s ease;
    background: var(--surface);
    color: var(--text-primary);
    font-family: 'Roboto Mono', monospace;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(136, 192, 208, 0.3);
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    font-weight: 500;
}

.btn-primary {
    background: var(--button-gradient);
    color: var(--text-primary);
    width: 100%;
    border: 2px solid var(--primary-dark);
    box-shadow: var(--shadow);
    font-family: 'Orbitron', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    white-space: nowrap;
}

.setup-btn {
    background: linear-gradient(145deg, #81A1C1 0%, #5E81AC 100%);
    color: var(--text-primary);
    border: 1px solid var(--accent-color);
    font-size: 11px;
}

.settings-btn {
    background: linear-gradient(145deg, var(--accent-color) 0%, #5E81AC 100%);
    color: var(--text-primary);
    border: 1px solid var(--accent-color);
    font-size: 11px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.settings-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.logout-btn {
    background: linear-gradient(145deg, var(--danger) 0%, #a54d5d 100%);
    color: var(--text-primary);
    border: 1px solid var(--danger);
    font-size: 11px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    background: linear-gradient(145deg, #d63447 0%, var(--danger) 100%);
}

.setup-btn:hover {
    background: linear-gradient(145deg, #88C0D0 0%, #81A1C1 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.btn-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-elevated);
    position: fixed;
    bottom: 80px;
    right: 20px;
}

.btn-fab svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

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

/* Walkie-Talkie Container */
#mainScreen {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    position: relative;
    background: var(--background);
    border-radius: 20px;
    margin: 5px;
    box-shadow: 
        inset 0 0 20px rgba(0,0,0,0.3),
        0 0 30px rgba(0,0,0,0.5),
        0 10px 40px rgba(0,0,0,0.4);
    border: 3px solid var(--primary-dark);
    overflow: auto; /* Allow scrolling on mobile */
    max-width: calc(100vw - 10px);
    max-height: calc(100vh - 10px);
}

/* Walkie-Talkie Speaker Grille */
#mainScreen::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 20px;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 3px,
        var(--primary-dark) 3px,
        var(--primary-dark) 5px
    );
    border-radius: 10px;
    z-index: 1000;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

/* Walkie-Talkie Side Details */
#mainScreen::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 30%;
    width: 15px;
    height: 40%;
    background: var(--metallic-gradient);
    border-radius: 0 8px 8px 0;
    box-shadow: inset -2px 0 4px rgba(0,0,0,0.3);
    z-index: 1001;
}

/* iOS keyboard handling */
body.keyboard-open #mainScreen {
    height: 50vh; /* Adjust when keyboard is open */
}

.app-header {
    background: var(--metallic-gradient);
    color: var(--text-primary);
    padding: 25px 15px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    border-bottom: 2px solid var(--primary-dark);
    position: relative;
    flex-shrink: 0;
}

/* LCD Display Effect */
.header-left h1 {
    font-family: 'Orbitron', monospace;
    font-size: 16px;
    font-weight: 700;
    color: var(--secondary-color);
    text-shadow: 0 0 8px var(--secondary-color);
    letter-spacing: 2px;
    background: rgba(0,0,0,0.3);
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--primary-dark);
}

.header-left h1 {
    font-size: 20px;
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Connection Status Indicator */
.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.connection-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.connection-status.online .status-dot {
    background-color: #A3BE8C;
    box-shadow: 0 0 6px rgba(163, 190, 140, 0.6);
}

.connection-status.offline .status-dot {
    background-color: #BF616A;
    box-shadow: 0 0 6px rgba(191, 97, 106, 0.6);
}

.connection-status.online {
    color: #A3BE8C;
}

.connection-status.offline {
    color: #BF616A;
}

.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

/* Incoming Call Indicator */
.incoming-call-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    background-color: var(--incoming-call-color);
    animation: flash-pulse 1s infinite;
    cursor: pointer;
    transition: transform 0.2s;
}

.incoming-call-indicator:hover {
    transform: scale(1.2);
}

.incoming-call-indicator svg {
    fill: white;
    animation: shake 0.5s infinite;
}

@keyframes flash-pulse {
    0% {
        background-color: var(--incoming-call-color);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
        transform: scale(1);
    }
    50% {
        background-color: #66BB6A;
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
        transform: scale(1.1);
    }
    100% {
        background-color: var(--incoming-call-color);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
        transform: scale(1);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px) rotate(-5deg); }
    75% { transform: translateX(2px) rotate(5deg); }
}

.user-info {
    font-size: 14px;
}

.notification-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    background-color: #666;
    position: relative;
}

.notification-status.connected {
    background-color: var(--success);
}

.notification-status.connecting {
    background-color: orange;
    animation: pulse 1.5s ease-in-out infinite;
}

.notification-status.error {
    background-color: var(--danger);
}

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

/* Bottom Navigation */
.bottom-nav {
    background: var(--metallic-gradient);
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 70px;
    box-shadow: 
        0 -4px 8px rgba(0,0,0,0.3),
        inset 0 2px 4px rgba(255,255,255,0.1);
    position: fixed;
    bottom: 10px;
    left: 13px;
    right: 13px;
    z-index: 100;
    border-radius: 15px;
    border: 2px solid var(--primary-dark);
    margin: 0;
}

/* Control Knobs on Bottom */
.bottom-nav::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    height: 25px;
    background: var(--speaker-color);
    border-radius: 50%;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
    border: 2px solid var(--primary-dark);
}

.bottom-nav::after {
    content: '';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    height: 25px;
    background: var(--speaker-color);
    border-radius: 50%;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
    border: 2px solid var(--primary-dark);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 10px;
    margin: 5px;
    position: relative;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
    margin-bottom: 4px;
}

.nav-item span {
    font-size: 12px;
}

/* Content Area */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 90px;
    background: rgba(0,0,0,0.1);
    border-radius: 15px;
    margin: 10px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.3);
}

.view {
    display: none;
    padding: 20px;
}

.view.active {
    display: flex;
    flex-direction: column;
}

/* View Header */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 5px;
    flex-shrink: 0;
}

.view-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-family: 'Orbitron', monospace;
    font-weight: 700;
}

/* PTT View */
.ptt-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    padding: 10px;
}

.recipient-selector {
    background: var(--metallic-gradient);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-elevated);
    margin-bottom: 20px;
    cursor: pointer;
    min-height: 60px;
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    border: 2px solid var(--primary-dark);
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.recipient-selector:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.recipient-selector:active {
    background-color: #e3f2fd;
    border-color: var(--primary-color);
    transform: scale(0.98);
}

.selected-recipient {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-size: 16px;
    font-weight: 500;
}

.dropdown-icon {
    width: 24px;
    height: 24px;
    fill: var(--text-secondary);
}

/* PTT Button */
.ptt-button-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: 300px;
    gap: 15px;
}

.ptt-button {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: var(--button-gradient);
    color: var(--text-primary);
    border: 6px solid var(--primary-dark);
    box-shadow: 
        0 0 30px rgba(94, 129, 172, 0.4),
        inset 0 0 20px rgba(255,255,255,0.1),
        0 10px 30px rgba(0,0,0,0.6);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    touch-action: manipulation;
    outline: none;
    position: relative;
    font-family: 'Orbitron', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* PTT Button Ring Effect */
.ptt-button::before {
    content: '';
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* PTT Button Grip Texture */
.ptt-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    border-radius: 50%;
    background: repeating-conic-gradient(
        from 0deg,
        transparent 0deg 2deg,
        rgba(255,255,255,0.1) 2deg 4deg
    );
    pointer-events: none;
}

.ptt-button:active,
.ptt-button.recording,
.ptt-button.pressed,
.ptt-button.active {
    background: linear-gradient(145deg, var(--secondary-color) 0%, #D08770 100%) !important;
    transform: scale(1.05) !important;
    box-shadow: 
        0 0 40px rgba(235, 203, 139, 0.8),
        inset 0 0 30px rgba(255,255,255,0.2),
        0 5px 20px rgba(0,0,0,0.8) !important;
    color: var(--primary-dark) !important;
}

.ptt-button:active::before,
.ptt-button.recording::before,
.ptt-button.pressed::before,
.ptt-button.active::before {
    opacity: 1 !important;
    animation: ripple 1.5s infinite !important;
}

/* Maximum specificity override for iOS visual feedback */
html body .ptt-button:active,
html body .ptt-button.recording,
html body .ptt-button.pressed,
html body .ptt-button.active,
html body #pttButton:active,
html body #pttButton.recording,
html body #pttButton.pressed,
html body #pttButton.active {
    background: linear-gradient(145deg, #EBCB8B 0%, #D08770 100%) !important;
    transform: scale(1.05) !important;
    box-shadow: 
        0 0 40px rgba(235, 203, 139, 0.8),
        inset 0 0 30px rgba(255,255,255,0.2),
        0 5px 20px rgba(0,0,0,0.8) !important;
    color: #2E3440 !important;
    border-color: #EBCB8B !important;
}

/* PTT Button Disabled State */
.ptt-button.disabled,
.ptt-button:disabled {
    background: linear-gradient(145deg, #555555 0%, #444444 100%);
    color: #888888;
    cursor: not-allowed;
    box-shadow: 
        0 0 10px rgba(0,0,0,0.2),
        inset 0 0 10px rgba(0,0,0,0.3),
        0 5px 15px rgba(0,0,0,0.4);
    transform: none;
    opacity: 0.6;
}

/* PTT Button Incoming Call State */
.ptt-button.incoming-call {
    background: linear-gradient(145deg, var(--incoming-call-color) 0%, #81A868 100%);
    color: var(--primary-dark);
    cursor: not-allowed;
    box-shadow: 
        0 0 30px rgba(163, 190, 140, 0.8),
        inset 0 0 20px rgba(255,255,255,0.2),
        0 10px 30px rgba(0,0,0,0.6);
    animation: incoming-call-pulse 1s infinite alternate;
}

.ptt-button.incoming-call::before {
    opacity: 1;
    border-color: var(--incoming-call-color);
    animation: incoming-call-ring 2s infinite;
}

/* Incoming call animations */
@keyframes incoming-call-pulse {
    0% { 
        box-shadow: 
            0 0 30px rgba(163, 190, 140, 0.8),
            inset 0 0 20px rgba(255,255,255,0.2),
            0 10px 30px rgba(0,0,0,0.6);
    }
    100% { 
        box-shadow: 
            0 0 50px rgba(163, 190, 140, 1.0),
            inset 0 0 30px rgba(255,255,255,0.3),
            0 15px 40px rgba(0,0,0,0.8);
    }
}

@keyframes incoming-call-ring {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.ptt-button.disabled:hover,
.ptt-button:disabled:hover {
    transform: none;
    box-shadow: 
        0 0 10px rgba(0,0,0,0.2),
        inset 0 0 10px rgba(0,0,0,0.3),
        0 5px 15px rgba(0,0,0,0.4);
}

.ptt-button.disabled::before,
.ptt-button:disabled::before {
    opacity: 0;
    animation: none;
}

/* Whisper Button */
.whisper-button {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(145deg, #4C566A 0%, #3B4252 100%);
    color: #D8DEE9;
    border: 3px solid #5E81AC;
    box-shadow: 
        0 0 15px rgba(94, 129, 172, 0.3),
        inset 0 0 10px rgba(255,255,255,0.1),
        0 5px 15px rgba(0,0,0,0.4);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    position: relative;
    text-align: center;
    padding: 8px;
}

.whisper-button:hover {
    transform: scale(1.05);
    box-shadow: 
        0 0 25px rgba(94, 129, 172, 0.5),
        inset 0 0 15px rgba(255,255,255,0.2),
        0 8px 20px rgba(0,0,0,0.5);
}

.whisper-button:active,
.whisper-button.recording {
    background: linear-gradient(145deg, #88C0D0 0%, #5E81AC 100%);
    transform: scale(0.95);
    box-shadow: 
        0 0 20px rgba(136, 192, 208, 0.6),
        inset 0 0 20px rgba(255,255,255,0.3),
        0 3px 10px rgba(0,0,0,0.6);
    color: #2E3440;
}

.whisper-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.whisper-text {
    font-size: 10px;
    margin-top: 2px;
}

.whisper-button.disabled {
    background: linear-gradient(145deg, #555555 0%, #444444 100%);
    color: #888888;
    cursor: not-allowed;
    box-shadow: 
        0 0 5px rgba(0,0,0,0.2),
        inset 0 0 5px rgba(0,0,0,0.3),
        0 2px 8px rgba(0,0,0,0.3);
    transform: none;
    opacity: 0.6;
}


/* Permission Message */
.permission-message {
    margin-top: 15px;
    padding: 12px 20px;
    background: rgba(255, 193, 7, 0.9);
    color: #333;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    max-width: 300px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    animation: fadeIn 0.5s ease-in-out;
}

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

/* iOS-specific recording banner */
.ios-recording-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(90deg, #ff4444, #ff0000);
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.5);
    z-index: 10000;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    animation: slideDown 0.3s ease-out;
}

.ios-recording-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.ios-recording-pulse {
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    animation: pulse-white 1s infinite;
}

.ios-recording-text {
    font-family: 'Orbitron', monospace;
    font-weight: 900;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse-white {
    0%, 100% { 
        transform: scale(1); 
        opacity: 1;
    }
    50% { 
        transform: scale(1.5); 
        opacity: 0.6;
    }
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.ptt-icon {
    width: 60px;
    height: 60px;
    fill: currentColor;
}

.ptt-text {
    font-size: 18px;
    font-weight: 500;
}

/* Removed conflicting recording indicator styles - using fixed positioned version instead */

/* Enhanced recording dot for better iOS visibility */
.recording-dot {
    width: 20px;
    height: 20px;
    background: linear-gradient(45deg, #ff4444, #ff0000);
    border-radius: 50%;
    box-shadow: 
        0 0 10px rgba(255, 68, 68, 0.8),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
    animation: pulse-strong 0.8s infinite ease-in-out;
    -webkit-animation: pulse-strong 0.8s infinite ease-in-out;
}

/* Stronger pulse animation for iOS */
@keyframes pulse-strong {
    0%, 100% { 
        transform: scale(1); 
        opacity: 1;
        box-shadow: 0 0 10px rgba(255, 68, 68, 0.8);
    }
    50% { 
        transform: scale(1.3); 
        opacity: 0.7;
        box-shadow: 0 0 20px rgba(255, 68, 68, 1);
    }
}

@-webkit-keyframes pulse-strong {
    0%, 100% { 
        -webkit-transform: scale(1); 
        opacity: 1;
        box-shadow: 0 0 10px rgba(255, 68, 68, 0.8);
    }
    50% { 
        -webkit-transform: scale(1.3); 
        opacity: 0.7;
        box-shadow: 0 0 20px rgba(255, 68, 68, 1);
    }
}
}

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

/* Message History */
.message-history {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    background-color: var(--surface);
    border-radius: var(--border-radius);
    margin-top: 20px;
}

.history-header {
    font-weight: bold;
    font-size: 1.1em;
    color: #333;
    text-align: center;
    padding: 8px 0;
    border-bottom: 2px solid var(--primary);
    margin-bottom: 12px;
    background: #fff;
    border-radius: 6px;
}

.message-item {
    background: var(--metallic-gradient);
    border-radius: var(--border-radius);
    padding: 12px;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
    border: 1px solid var(--primary-dark);
    color: var(--text-primary);
}

.message-item.global-message {
    border-left: 4px solid #28a745;
    background: linear-gradient(135deg, #fff 0%, #f8fff9 100%);
}

.message-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.message-sender {
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.message-recipient {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 6px;
    font-style: italic;
}

.message-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.play-audio-btn {
    background: var(--primary);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.play-audio-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.play-audio-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.play-audio-btn svg {
    fill: white;
}

.message-duration {
    font-weight: 500;
    color: #666;
}

.message-time {
    color: #999;
    font-size: 0.9em;
    margin-left: auto;
}

/* Lists */
.contact-list,
.group-list {
    margin-top: 20px;
}

.contact-item,
.group-item {
    background: var(--metallic-gradient);
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 10px;
    box-shadow: var(--shadow-elevated);
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--primary-dark);
    color: var(--text-primary);
}

.contact-item:hover,
.group-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    border-color: var(--accent-color);
}

/* Double-tap feedback for contact selection */
.contact-item.contact-tap-feedback {
    background: linear-gradient(145deg, #88C0D0 0%, #5E81AC 100%);
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(136, 192, 208, 0.4);
    border-color: var(--secondary-color);
    animation: contactTapPulse 0.3s ease-out;
}

@keyframes contactTapPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1.05); }
}

.contact-avatar,
.group-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
}

.contact-info,
.group-info {
    flex: 1;
}

.contact-name,
.group-name {
    font-weight: 500;
    margin-bottom: 5px;
}

.contact-status,
.group-type {
    font-size: 14px;
    color: var(--text-secondary);
}

.online-indicator {
    width: 10px;
    height: 10px;
    background-color: var(--success);
    border-radius: 50%;
    margin-left: auto;
}

/* Search Bar */
.search-bar {
    margin-top: 20px;
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    z-index: 1;
    color: var(--text-secondary);
    pointer-events: none;
}

.search-bar input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 1px solid var(--accent-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    background: var(--surface);
    color: var(--text-primary);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(235, 203, 139, 0.2);
}

.search-bar input::placeholder {
    color: var(--text-secondary);
}

/* Profile View */
.profile-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    background: var(--metallic-gradient);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-elevated);
    border: 2px solid var(--primary-dark);
}

.profile-avatar {
    margin-bottom: 30px;
}

.profile-avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin-bottom: 15px;
}

.profile-info {
    margin-bottom: 30px;
}

.profile-info h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.profile-info p {
    color: var(--text-secondary);
}

/* Client Health Section Styles */
.client-health-section {
    margin: 30px 0;
    background-color: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
    border: 2px solid rgba(136, 192, 208, 0.3);
}

.client-health-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.client-health-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-color);
}

.health-score-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.health-score {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.health-level {
    font-size: 14px;
    font-weight: 500;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Health level colors */
.health-level.poor { color: var(--danger); }
.health-level.fair { color: #EBCB8B; }
.health-level.good { color: var(--success); }
.health-level.excellent { color: var(--accent-color); }

.health-progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--primary-dark);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.health-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--danger) 0%, #EBCB8B 30%, var(--success) 70%, var(--accent-color) 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.security-protocols {
    margin: 20px 0;
}

.protocols-loading {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 20px;
}

.protocol-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.protocol-item:last-child {
    border-bottom: none;
}

.protocol-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.protocol-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.protocol-details {
    flex: 1;
}

.protocol-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.protocol-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.protocol-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.protocol-status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.protocol-status-badge.enabled {
    background-color: rgba(163, 190, 140, 0.2);
    color: var(--success);
    border: 1px solid rgba(163, 190, 140, 0.3);
}

.protocol-status-badge.disabled {
    background-color: rgba(191, 97, 106, 0.2);
    color: var(--danger);
    border: 1px solid rgba(191, 97, 106, 0.3);
}

.protocol-points {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.protocol-manage-btn {
    background: rgba(136, 192, 208, 0.2);
    border: 1px solid rgba(136, 192, 208, 0.3);
    color: var(--accent-color);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.2s ease;
}

.protocol-manage-btn:hover {
    background: rgba(136, 192, 208, 0.3);
    border-color: rgba(136, 192, 208, 0.5);
    transform: scale(1.05);
}

.health-recommendations {
    margin-top: 20px;
    padding: 15px;
    background-color: rgba(235, 203, 139, 0.1);
    border-radius: var(--border-radius);
    border-left: 4px solid #EBCB8B;
}

.health-recommendations h5 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #EBCB8B;
}

.recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recommendation-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.recommendation-icon {
    font-size: 16px;
}

.recommendation-points {
    margin-left: auto;
    font-weight: 600;
    color: var(--accent-color);
}

.health-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.health-actions .btn {
    flex: 1;
    padding: 10px;
    font-size: 12px;
}

.health-last-updated {
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 15px;
    font-style: italic;
}

/* Profile Settings Styles */
.profile-settings {
    margin: 30px 0;
    background-color: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.settings-header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 20px;
    border-bottom: 1px solid var(--primary-dark);
}

.settings-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.settings-content {
    padding: 20px;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    gap: 12px;
}

.setting-checkbox {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--accent-color);
}

.setting-text {
    font-weight: 500;
    color: var(--text-primary);
}

.setting-description {
    margin-top: 8px;
    margin-left: 30px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Admin Section Styles */
.admin-section {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid var(--secondary-color);
    box-shadow: var(--shadow);
}

.admin-header h4 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-weight: bold;
    text-align: center;
}

.admin-actions {
    display: flex;
    justify-content: center;
}

.btn-admin {
    background: linear-gradient(145deg, var(--secondary-color) 0%, #D08770 100%);
    color: var(--primary-dark);
    font-weight: bold;
    border: none;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.btn-admin:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-elevated);
    background: linear-gradient(145deg, #EBCB8B 0%, var(--secondary-color) 100%);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--metallic-gradient);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    position: relative;
    -webkit-overflow-scrolling: touch;
    border: 3px solid var(--primary-dark);
    box-shadow: var(--shadow-elevated);
    color: var(--text-primary);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Theme Selector Styles */
.theme-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    padding: 10px;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 100px;
}

.theme-option:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.theme-option.active {
    border-color: var(--success);
    background: rgba(163, 190, 140, 0.1);
}

.theme-preview {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-bottom: 10px;
    border: 2px solid currentColor;
    background: var(--primary-color);
}

.theme-preview.talky-theme {
    background: linear-gradient(45deg, #2E3440, #EBCB8B);
}

.theme-preview.tron-theme {
    background: linear-gradient(45deg, #000000, #00FFFF);
}

.theme-preview.rangers-theme {
    background: linear-gradient(45deg, #0038A8, #CE1126, #FFFFFF);
}

/* Tabs */
.recipient-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background-color: #f5f5f5;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: all 0.3s;
}

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

/* Loading Indicator */
.loading-indicator {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.loading-indicator.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Recording Indicator - Fixed positioning for iOS */
.recording-indicator {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ff4444, #cc0000);
    color: white;
    padding: 15px 25px;
    border-radius: 25px;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
    animation: recordingPulse 2s ease-in-out infinite;
    /* Force iOS compatibility */
    -webkit-transform: translateX(-50%);
    -webkit-animation: recordingPulse 2s ease-in-out infinite;
    will-change: opacity, transform;
    /* iOS Safari specific fixes */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000px;
    perspective: 1000px;
    /* Remove backdrop-filter for iOS compatibility */
    background: rgba(255, 68, 68, 0.95);
}

/* Ensure recording indicator shows when displayed */
#recordingIndicator[style*="block"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.recording-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Roboto Mono', monospace;
}

.recording-icon {
    font-size: 18px;
    animation: recordingBlink 1s ease-in-out infinite;
}

.recording-text {
    font-weight: 600;
    font-size: 16px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.recording-duration {
    font-weight: 700;
    font-size: 18px;
    font-family: 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 8px;
    min-width: 50px;
    text-align: center;
}

.recording-recipient {
    font-size: 14px;
    opacity: 0.9;
    font-style: italic;
}

@keyframes recordingPulse {
    0%, 100% { 
        transform: translateX(-50%) scale(1); 
        box-shadow: 0 4px 12px rgba(255, 68, 68, 0.4);
    }
    50% { 
        transform: translateX(-50%) scale(1.02); 
        box-shadow: 0 6px 16px rgba(255, 68, 68, 0.6);
    }
}

@keyframes recordingBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
}

.toast {
    background-color: #333;
    color: white;
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 10px;
    box-shadow: var(--shadow-elevated);
    animation: slideIn 0.3s;
}

.toast.success {
    background-color: var(--success);
}

.toast.error {
    background-color: var(--danger);
    color: white;
    font-weight: 500;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    /* Remove margins and borders that cause layout issues */
    #mainScreen {
        margin: 0;
        border-radius: 0;
        border: none;
        box-shadow: none;
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100);
        max-height: none;
        max-width: none;
    }
    
    /* Improve content scrolling */
    .content {
        margin: 5px;
        padding: 15px;
        padding-bottom: 100px; /* More space for mobile keyboard */
    }
    
    /* Improve header for mobile */
    .header {
        padding: 10px 15px;
        flex-shrink: 0;
    }
    
    .ptt-button {
        width: 180px;
        height: 180px;
        font-size: 16px;
    }
    
    .ptt-icon {
        width: 50px;
        height: 50px;
    }
    
    .ptt-text {
        font-size: 16px;
        font-weight: 600;
    }
    
    /* Better PTT button positioning on mobile */
    .ptt-section {
        padding: 15px;
        margin-bottom: 10px;
    }
    
    /* Larger touch targets on mobile */
    .btn {
        min-height: 48px;
        padding: 12px 20px;
        font-size: 16px;
    }
    
    .nav-item {
        min-height: 60px;
    }
    
    /* Better modal spacing on mobile */
    .modal-content {
        margin: 5px;
        max-height: calc(100vh - 10px);
        border-radius: 10px;
    }
    
    .recipient-item {
        min-height: 64px;
        padding: 20px 15px;
        font-size: 16px;
    }
}

@media (min-width: 1024px) {
    body {
        padding: 20px;
        background: radial-gradient(ellipse at center, #5E81AC 0%, #2E3440 100%);
    }
    
    #mainScreen {
        max-width: 800px;
        margin: 0 auto;
        height: calc(100vh - 40px);
        box-shadow: 
            0 0 50px rgba(0,0,0,0.8),
            inset 0 0 30px rgba(0,0,0,0.3);
    }
    
    .content {
        max-width: 100%;
        margin: 10px;
    }
    
    .bottom-nav {
        position: fixed;
        max-width: 760px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .ptt-button {
        width: 280px;
        height: 280px;
    }
    
    .ptt-icon {
        width: 80px;
        height: 80px;
    }
    
    .ptt-text {
        font-size: 22px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #121212;
        --surface: #1e1e1e;
        --text-primary: #ffffff;
        --text-secondary: #aaaaaa;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="password"] {
        background-color: var(--surface);
        color: var(--text-primary);
        border-color: #333;
    }
}

/* Additional styles for recipient modal */
.recipient-section {
    margin-bottom: 20px;
}

.recipient-section h4 {
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.recipient-item,
.group-search-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.2s;
    min-height: 60px;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.recipient-item:hover,
.group-search-item:hover {
    background-color: #f5f5f5;
}

.recipient-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.recipient-info {
    flex: 1;
}

.recipient-name {
    font-weight: 500;
}

.recipient-status {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Message history styles */
.message-item {
    margin-bottom: 10px;
    padding: 10px;
    background-color: var(--surface);
    border-radius: var(--border-radius);
    border: 1px solid #e0e0e0;
}

.message-item.error {
    background-color: #ffebee;
    border-color: var(--danger);
    color: #c62828;
}

.message-sender {
    font-weight: 500;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.message-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.play-audio-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.play-audio-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.message-duration {
    font-size: 14px;
    color: #424242;
    font-weight: 500;
}

.message-time {
    font-size: 12px;
    color: #424242;
    margin-left: auto;
    font-weight: 500;
}

/* Message status indicators */
.message-status {
    font-size: 12px;
    margin-left: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.message-status .status-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.message-status.pending {
    color: #ff9800;
    background-color: rgba(255, 152, 0, 0.1);
}

.message-status.retrying {
    color: #ff5722;
    background-color: rgba(255, 87, 34, 0.1);
    animation: pulse 1s infinite;
}

.message-status.sent {
    color: #2196F3;
    background-color: rgba(33, 150, 243, 0.1);
    padding: 4px 8px;
}

.message-status.validated {
    color: var(--success);
    background-color: rgba(76, 175, 80, 0.1);
    padding: 4px 8px;
}

.message-status.received {
    color: var(--success);
    background-color: rgba(76, 175, 80, 0.15);
    padding: 4px 8px;
}

.message-status.played {
    color: #9C27B0;
    background-color: rgba(156, 39, 176, 0.1);
    padding: 4px 8px;
}

.message-status.failed {
    color: var(--danger);
    background-color: rgba(244, 67, 54, 0.1);
    cursor: pointer;
    padding: 4px 8px;
}

.message-status.failed:hover {
    background-color: rgba(244, 67, 54, 0.2);
}

/* Empty state and error styles */
.empty-state,
.error,
.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.error {
    color: #d32f2f;
    background-color: #ffebee;
    border: 1px solid #ffcdd2;
    border-radius: var(--border-radius);
    font-weight: 500;
}

/* Contact request styles */
.contact-requests {
    background-color: #fff3cd;
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.contact-request {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.request-info {
    flex: 1;
}

.request-name {
    font-weight: 500;
}

.request-email {
    font-size: 14px;
    color: var(--text-secondary);
}

.request-actions {
    display: flex;
    gap: 10px;
}

/* Success button variant */
.btn-success {
    background-color: var(--success);
    color: white;
}

/* Group actions */
.group-actions {
    display: flex;
    gap: 10px;
}

.group-actions-bottom {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Form styles for modals */
.modal form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

/* Auth switch link */
.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}
/* APK Download Link */
.apk-download {
    margin: 20px 0;
    text-align: center;
}

.download-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 500;
}

.download-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    color: white;
    transform: translateY(-2px);
}

.download-icon {
    flex-shrink: 0;
}

/* Profile Inbox Styles */
.profile-inbox {
    margin: 30px 0;
    background-color: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.inbox-header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 20px;
    position: relative;
}

.inbox-header h4 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.inbox-badge {
    background-color: var(--secondary-color);
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.inbox-content {
    max-height: 300px;
    overflow-y: auto;
}

.inbox-loading,
.inbox-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.contact-requests-list {
    padding: 0;
}

.contact-request-item {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.2s;
}

.contact-request-item:hover {
    background-color: #f9f9f9;
}

.contact-request-item:last-child {
    border-bottom: none;
}

.request-info {
    flex: 1;
}

.request-sender {
    font-weight: 500;
    margin-bottom: 2px;
}

.request-email {
    font-size: 12px;
    color: var(--text-secondary);
}

.request-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.request-actions {
    display: flex;
    gap: 8px;
}

.request-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
    min-width: auto;
}

/* Navigation Badge Styles */
.nav-item {
    position: relative;
}

.nav-item-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    height: 100%;
}

.nav-badge {
    position: absolute;
    top: -5px;
    right: 10px;
    background-color: var(--secondary-color);
    color: white;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    z-index: 10;
}

/* Permission Dialog Styles */
.permission-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.permission-actions .btn {
    min-width: 120px;
}

.modal-body ol {
    text-align: left;
    margin: 15px 0;
    padding-left: 20px;
}

.modal-body ul {
    text-align: left;
    margin: 15px 0;
    padding-left: 20px;
}

.ios-note {
    background-color: #e3f2fd;
    padding: 10px;
    border-radius: var(--border-radius);
    font-size: 14px;
    margin-top: 15px;
    border-left: 4px solid var(--primary-color);
}

/* iOS Safari and mobile-specific adjustments */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari specific styles */
    body {
        -webkit-overflow-scrolling: touch;
        -webkit-text-size-adjust: 100%;
    }
    
    .ptt-button {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
        touch-action: manipulation;
    }
    
    /* Improve touch responsiveness */
    .btn, .nav-item, .recipient-item, .contact-item, .group-item {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    /* Better audio button interaction */
    .play-audio-btn {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        transition: transform 0.1s ease;
    }
    
    .play-audio-btn:active {
        transform: scale(0.95);
    }
}

@media screen and (-webkit-min-device-pixel-ratio: 2) {
    /* High DPI displays (including iOS) */
    .ptt-button {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* Improve touch targets on iOS */
    .btn, .nav-item {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better modal display on mobile */
    .modal-content {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }
    
    /* Improve input focus on iOS */
    input[type="text"],
    input[type="email"],
    input[type="password"] {
        font-size: 16px; /* Prevents zoom on iOS */
        -webkit-appearance: none;
        border-radius: var(--border-radius);
    }
}

/* Additional iOS Safari fixes */
@media screen and (max-device-width: 812px) and (-webkit-device-pixel-ratio: 3) {
    /* iPhone X and newer models */
    .app-header {
        padding-top: env(safe-area-inset-top, 15px);
        padding-left: env(safe-area-inset-left, 20px);
        padding-right: env(safe-area-inset-right, 20px);
    }
    
    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    
    .content {
        padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    }
}

/* Enhance touch feedback for iOS */
@media (hover: none) and (pointer: coarse) {
    /* Touch devices (primarily mobile) */
    .ptt-button:active {
        transform: scale(1.05);
        transition: transform 0.1s ease;
        box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    }
    
    .btn:active {
        transform: translateY(1px);
        transition: transform 0.1s ease;
    }
    
    .nav-item:active {
        background-color: rgba(0, 0, 0, 0.05);
        transition: background-color 0.1s ease;
    }
    
    .recipient-selector:active {
        background-color: #f0f0f0;
        transform: scale(0.98);
        transition: all 0.1s ease;
    }
    
    /* Better hover states for touch */
    .contact-item:active,
    .group-item:active,
    .recipient-item:active {
        background-color: #e3f2fd;
        transform: scale(0.98);
        transition: all 0.1s ease;
    }
    
    /* Make modal items more touch-friendly */
    .recipient-item {
        min-height: 60px;
    }
    
    /* Enhanced iOS touch feedback for simple contact items */
    .simple-contact-item {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
        touch-action: manipulation;
        min-height: 50px;
        transition: all 0.1s ease;
        border-radius: 8px;
        margin: 2px 0;
    }
    
    .simple-contact-item:active {
        background-color: #e3f2fd !important;
        transform: scale(0.98) !important;
    }
    
    /* Better visual feedback for contact selection */
    .simple-contact-item.selected {
        background-color: #007AFF !important;
        color: white !important;
        transform: scale(1.02);
        box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
    }
}

/* Pulsing Avatar Overlay */
.pulsing-avatar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.pulsing-avatar-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pulsing-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid #ffffff;
    animation: avatarPulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
}

.avatar-pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border: 3px solid rgba(76, 175, 80, 0.6);
    border-radius: 50%;
    animation: ringPulse 1.5s ease-in-out infinite;
}

.pulsing-avatar-name {
    color: white;
    font-size: 24px;
    font-weight: bold;
    margin-top: 20px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

@keyframes avatarPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 30px rgba(76, 175, 80, 0.8);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
    }
}

@keyframes ringPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0;
    }
}

/* Additional contact and layout fixes */
.contacts-list-container {
    background: var(--metallic-gradient) !important;
    border: 2px solid var(--primary-dark) !important;  
    box-shadow: var(--shadow-elevated) !important;
    color: var(--text-primary) !important;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.selected-contact-display {
    background: var(--metallic-gradient) !important;
    border: 2px solid var(--accent-color) !important;
    padding: 15px !important;
    border-radius: var(--border-radius) !important;
    margin-bottom: 20px !important;
    text-align: center !important;
    font-weight: bold !important;
    color: var(--text-primary) !important;
    box-shadow: var(--shadow) !important;
}

#simpleContactsList {
    padding: 10px !important;
    max-height: 150px;
    overflow-y: auto;
}

.simple-contact-item {
    display: flex !important;
    align-items: center !important;
    padding: 10px 15px !important;
    background: rgba(255,255,255,0.1) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--primary-dark) !important;
    border-radius: 8px !important;
    margin: 2px 0 !important;
    transition: all 0.2s ease !important;
}

.simple-contact-item:hover {
    background: rgba(255,255,255,0.2) !important;
    transform: translateY(-1px) !important;
}

/* Responsive fixes */
@media (max-width: 768px) {
    /* Fix iPhone layout issues */
    body {
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    #mainScreen {
        margin: 0;
        border-radius: 0;
        border: none;
        box-shadow: none;
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100);
        max-height: none;
        max-width: none;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    
    .app-header {
        padding: env(safe-area-inset-top, 20px) 15px 15px;
        padding-top: max(env(safe-area-inset-top), 20px);
        flex-shrink: 0;
        position: relative;
        z-index: 100;
    }
    
    .header-right {
        gap: 8px;
    }
    
    .connection-status {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    .connection-status .status-text {
        display: none; /* Hide text on mobile, just show dot */
    }
    
    .logout-btn {
        padding: 4px 8px;
        font-size: 10px;
        display: flex;
        align-items: center;
    }
    
    .content {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 10px;
        margin: 0;
    }
    
    .bottom-nav {
        flex-shrink: 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
}

/* Group Member Styles */
.group-members-list {
    max-height: 400px;
    overflow-y: auto;
}

.member-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--primary-dark);
    transition: background-color 0.2s ease;
}

.member-item:hover {
    background-color: rgba(255,255,255,0.05);
}

.member-item:last-child {
    border-bottom: none;
}

.member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    border: 2px solid var(--primary-dark);
}

.member-info {
    flex: 1;
}

.member-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.member-status {
    font-size: 12px;
    color: var(--text-secondary);
}

.member-status.online {
    color: var(--success);
}

.member-status.offline {
    color: var(--text-secondary);
}

.member-actions {
    display: flex;
    gap: 8px;
}

.modal-footer {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid var(--primary-dark);
    margin-top: 15px;
}
EOF < /dev/null


/* === CONTACT ITEM ENHANCEMENTS === */
.simple-contact-item {
    position: relative;
    border-radius: 8px;
    margin: 2px 0;
}

.simple-contact-item.message-received {
    background-color: #fffbcc !important;
    border: 2px solid #ffd54f !important;
}

.replay-button {
    transition: all 0.3s ease;
    display: none !important;
    background: #2196F3 !important;
    color: white !important;
    border: none !important;
    padding: 6px 10px !important;
    border-radius: 20px !important;
    margin-right: 10px !important;
    cursor: pointer !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    z-index: 10 !important;
    position: relative !important;
}

.replay-button:hover {
    background: #1976D2 !important;
    transform: scale(1.1);
}

.replay-button:active {
    transform: scale(0.95);
}

.replay-button.visible {
    display: block !important;
}

/* Mobile keyboard fixes */
@media (max-width: 768px) {
    /* Fix iOS keyboard issues */
    body {
        position: fixed;
        width: 100%;
    }
    
    .screen {
        position: relative;
        width: 100%;
        height: 100vh;
        height: -webkit-fill-available;
        overflow: hidden;
    }
    
    .auth-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        height: -webkit-fill-available;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 20px;
        box-sizing: border-box;
    }
    
    /* Prevent body scroll when keyboard appears */
    body.keyboard-open {
        position: fixed;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }
    
    /* Input field fixes */
    input[type="text"],
    input[type="email"],
    input[type="password"] {
        font-size: 16px !important; /* Prevent zoom */
        -webkit-text-size-adjust: 100%;
        -webkit-appearance: none;
        border-radius: 8px;
        background-color: white;
        color: #333;
    }
    
    /* Fix form positioning when keyboard appears */
    .auth-form {
        margin: auto 0;
        max-width: 100%;
        padding: 20px;
    }
}


/* Settings Menu Styles */
.settings-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-menu-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: var(--surface);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.settings-menu-item:hover {
    background: #434C5E;
    border-color: var(--accent-color);
    transform: translateX(4px);
}

.settings-item-icon {
    font-size: 24px;
    margin-right: 15px;
    width: 32px;
    text-align: center;
}

.settings-item-content {
    flex: 1;
}

.settings-item-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.settings-item-description {
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.8;
}

.settings-item-arrow {
    font-size: 20px;
    color: var(--accent-color);
    margin-left: 10px;
}

/* Settings Submenu Styles */
.settings-submenu {
    display: none;
    background: var(--primary-color);
    padding: 0;
    overflow-y: auto;
}

.settings-submenu.active {
    display: block;
}

.settings-submenu-header {
    display: flex;
    align-items: center;
    padding: 20px 15px;
    background: var(--surface);
    border-bottom: 1px solid #434C5E;
    position: sticky;
    top: 0;
    z-index: 10;
}

.settings-submenu-header .back-btn {
    background: transparent;
    border: none;
    color: var(--accent-color);
    font-size: 16px;
    cursor: pointer;
    margin-right: 15px;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.3s;
}

.settings-submenu-header .back-btn:hover {
    background: rgba(136, 192, 208, 0.1);
}

.settings-submenu-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-submenu-content {
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Setting Item Styles */
.setting-item {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 20px;
    border: 1px solid transparent;
    transition: border-color 0.3s;
}

.setting-item:hover {
    border-color: var(--accent-color);
}

.setting-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
}

.setting-label-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.setting-checkbox {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.setting-text {
    color: var(--text-primary);
    font-weight: 500;
}

.setting-description {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    opacity: 0.8;
    line-height: 1.4;
}

.setting-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    text-align: left;
}

.setting-button:hover .setting-text {
    color: var(--accent-color);
}

.setting-arrow {
    color: var(--accent-color);
    font-size: 18px;
}

.setting-select {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    background: var(--primary-color);
    color: var(--text-primary);
    border: 1px solid #434C5E;
    border-radius: 6px;
    font-size: 14px;
}

.setting-select:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Theme Options */
.theme-options {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: var(--primary-color);
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s;
    min-width: 100px;
}

.theme-option:hover {
    border-color: var(--accent-color);
}

.theme-option.active {
    border-color: var(--success);
    background: rgba(163, 190, 140, 0.1);
}

.theme-preview {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.tron-preview {
    background: linear-gradient(135deg, #2E3440 0%, #5E81AC 100%);
}

.rangers-preview {
    background: linear-gradient(135deg, #1a2332 0%, #4a6741 100%);
}

.talky-preview {
    background: linear-gradient(135deg, #2c1810 0%, #8b4513 100%);
}

.theme-option span {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

/* Schedule Settings */
.schedule-settings {
    margin-top: 15px;
    padding: 15px;
    background: var(--primary-color);
    border-radius: 8px;
    border: 1px solid #434C5E;
}

.time-range {
    display: flex;
    gap: 20px;
    align-items: center;
}

.time-range label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.time-range input[type='time'] {
    padding: 6px 10px;
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid #434C5E;
    border-radius: 4px;
    font-size: 14px;
}

.time-range input[type='time']:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Responsive Design */
@media (max-width: 480px) {
    .theme-options {
        justify-content: center;
    }
    
    .theme-option {
        min-width: 80px;
    }
    
    .time-range {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .settings-submenu-header {
        padding: 15px 10px;
    }
    
    .settings-submenu-content {
        padding: 15px 10px;
    }
}

/* Tor Network Management Dialog Styles */
.tor-management-dialog {
    max-width: 700px;
    font-family: var(--font-family);
}

.tor-management-dialog h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
}

.tor-status-info {
    background-color: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 20px;
}

.tor-status-info h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-color);
}

.tor-status-info p {
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.4;
}

.tor-status-info code {
    background-color: var(--surface);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--primary-color);
}

.tor-no-info {
    text-align: center;
    padding: 20px;
    background-color: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.tor-instructions {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 20px;
}

.tor-instructions h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-color);
}

.tor-instructions ol {
    margin: 0 0 15px 0;
    padding-left: 20px;
}

.tor-instructions li {
    margin: 8px 0;
    line-height: 1.4;
}

.tor-instructions a {
    color: var(--primary-color);
    text-decoration: none;
}

.tor-instructions a:hover {
    text-decoration: underline;
}

.tor-instructions p {
    margin: 10px 0 0 0;
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

.tor-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.tor-actions .btn {
    min-width: 140px;
    padding: 10px 15px;
    font-size: 14px;
}

/* Responsive adjustments for Tor dialog */
@media (max-width: 768px) {
    .tor-management-dialog {
        max-width: 100%;
        margin: 10px;
    }
    
    .tor-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .tor-actions .btn {
        width: 100%;
        max-width: 250px;
    }
    
    .tor-instructions ol {
        padding-left: 15px;
    }
}

/* Anonymous Mode Management Dialog Styles */
.anonymous-mode-dialog {
    max-width: 700px;
    font-family: var(--font-family);
}

.anonymous-mode-dialog h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
}

.anonymous-status-info {
    background-color: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 20px;
}

.anonymous-status-info h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-color);
}

.anonymous-status-info p {
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.4;
}

.anonymous-no-info {
    text-align: center;
    padding: 20px;
    background-color: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.anonymous-instructions {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 20px;
}

.anonymous-instructions h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-color);
}

.anonymous-instructions ol {
    margin: 0 0 15px 0;
    padding-left: 20px;
}

.anonymous-instructions li {
    margin: 8px 0;
    line-height: 1.4;
}

.anonymous-instructions p {
    margin: 10px 0 0 0;
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

.anonymous-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.anonymous-actions .btn {
    min-width: 140px;
    padding: 10px 15px;
    font-size: 14px;
}

/* Responsive adjustments for Anonymous Mode dialog */
@media (max-width: 768px) {
    .anonymous-mode-dialog {
        max-width: 100%;
        margin: 10px;
    }
    
    .anonymous-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .anonymous-actions .btn {
        width: 100%;
        max-width: 250px;
    }
    
    .anonymous-instructions ol {
        padding-left: 15px;
    }
}

/* Metadata Protection Management Dialog Styles */
.metadata-protection-dialog {
    max-width: 750px;
    font-family: var(--font-family);
}

.metadata-protection-dialog h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
}

.metadata-status-info {
    background-color: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 20px;
}

.metadata-status-info h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-color);
}

.metadata-status-info p {
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.4;
}

.metadata-no-info {
    text-align: center;
    padding: 20px;
    background-color: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.metadata-instructions {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 20px;
}

.metadata-instructions h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-color);
}

.metadata-instructions ol {
    margin: 0 0 15px 0;
    padding-left: 20px;
}

.metadata-instructions li {
    margin: 8px 0;
    line-height: 1.4;
}

.metadata-instructions p {
    margin: 10px 0 0 0;
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

.metadata-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.metadata-actions .btn {
    min-width: 140px;
    padding: 10px 15px;
    font-size: 14px;
}

/* Responsive adjustments for Metadata Protection dialog */
@media (max-width: 768px) {
    .metadata-protection-dialog {
        max-width: 100%;
        margin: 10px;
    }
    
    .metadata-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .metadata-actions .btn {
        width: 100%;
        max-width: 250px;
    }
    
    .metadata-instructions ol {
        padding-left: 15px;
    }
}

/* My Groups Section Styles */
.profile-groups {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.groups-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.groups-header h4 {
    margin: 0;
    color: var(--text-primary, #333);
}

.my-groups-content {
    max-height: 400px;
    overflow-y: auto;
}

.group-management-item {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.group-info h5 {
    margin: 0 0 5px 0;
    color: var(--text-primary, #333);
}

.group-stats {
    font-size: 0.9em;
    color: var(--text-secondary, #666);
}

.group-features {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.group-features h6 {
    margin: 0 0 10px 0;
    color: var(--text-secondary, #666);
    font-size: 0.9em;
    font-weight: 600;
}

.feature-toggles {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.feature-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.feature-toggle input[type="checkbox"] {
    cursor: pointer;
}

.feature-toggle span {
    font-size: 0.9em;
    user-select: none;
}

.groups-loading, .groups-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary, #666);
}

