/* ============================================
   RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #ec4899;
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
    --chat-bg: #f0f2f5;
    --sent-bubble: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --received-bubble: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --success: #10b981;
    --danger: #ef4444;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--chat-bg);
    height: 100vh;
    overflow: hidden;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   INDEX PAGE
   ============================================ */
.index-page {
    overflow-y: auto;
}



.index-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    z-index: 1;
    display: none !important;
}

.index-header::after {
    content: '';
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    z-index: 1;
    display: none !important;
} 

.index-header-content {
    position: relative;
    z-index: 2;
    
}



.index-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
    text-shadow: 0 0 20px rgba(96, 165, 250, 0.6), 0 2px 10px rgba(0, 0, 0, 0.5);
}

.user-badge {
   display: flex;
    align-items: center;
    gap: 0.75rem;
    backdrop-filter: blur(10px);
    padding: 0.75rem 1rem;
    border-radius: 50px;
    width: fit-content;
    position: relative;
    z-index: 2;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    color: var(--primary);
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

.user-details {
    display: inline-block;
  
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #ffffff;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.3), 0 2px 5px rgba(0, 0, 0, 0.5);
}

.user-status {
    font-size: 0.8rem;
    opacity: 0.9;
    color: #86efac;
    text-shadow: 0 0 10px rgba(134, 239, 172, 0.5);
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    margin-top: -1.5rem;
    position: relative;
    z-index: 2;
}

.action-card {
    background: white;
    border: none;
    border-radius: 16px;
    padding: 1rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.2s;
    font-size: 0.8rem;
    color: var(--text-primary);
    font-weight: 500;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.action-card:active {
    transform: translateY(0);
}

.action-icon {
    font-size: 1.8rem;
}

.action-card.delete-card {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 2px solid #ef4444;
}
.action-card.delete-card:hover {
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
}
.action-card.delete-card .action-icon {
    color: #dc2626;
}
.action-card.delete-card span {
    color: #dc2626;
    font-weight: 600;
}

.section {
    padding: 0 1rem 1rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.section-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.see-all {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.empty-state-card {
    background: white;
    border-radius: 16px;
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.empty-state-card p {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.empty-state-card small {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.recent-chat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    padding: 0.7rem 0.75rem;
    border-radius: 14px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.recent-chat-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.chat-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.chat-info {
    flex: 1;
    min-width: 0;
}

.chat-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.chat-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.chat-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.chat-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-preview {
    font-size: 0.85rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.chat-badge {
    background: var(--primary);
    color: white;
    border-radius: 50%;
    min-width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0 6px;
    margin-left: 0.5rem;
}

/* ============================================
   HACKER / BLOCKCHAIN TERMINAL
   ============================================ */
.hacker-terminal {
    background: rgba(5, 10, 20, 0.95);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 8px;
    padding: 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.15), inset 0 0 20px rgba(0, 0, 0, 0.8);
    max-width: 500px;
    margin: 1rem auto;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
}

.hacker-terminal::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 2;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

.terminal-header {
    background: rgba(0, 255, 136, 0.1);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(0, 255, 136, 0.2);
}

.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.red { background: #ff5f56; box-shadow: 0 0 5px #ff5f56; }
.dot.yellow { background: #ffbd2e; box-shadow: 0 0 5px #ffbd2e; }
.dot.green { background: #27c93f; box-shadow: 0 0 5px #27c93f; }

.terminal-title {
    color: rgba(0, 255, 136, 0.7);
    font-size: 0.75rem;
    margin-left: auto;
    letter-spacing: 1px;
}

.term-body {
    padding: 15px;
    min-height: 160px;
    color: #00ff88;
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.5);
    position: relative;
    z-index: 1;
}

.tl {
    margin-bottom: 4px;
    line-height: 1.2;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn { to { opacity: 1; } }

.tl.cmd { color: #00ffff; text-shadow: 0 0 8px rgba(0, 255, 255, 0.6); font-weight: bold; }
.tl.ok { color: #00ff88; text-shadow: 0 0 8px rgba(0, 255, 136, 0.6); }
.tl.live { color: #ffbd2e; text-shadow: 0 0 8px rgba(255, 189, 46, 0.6); }
.tl.hash { color: white; text-shadow: 0 0 1px rgba(189, 0, 255, 0.6); font-size: 0.8rem; word-break: break-all; }

.term-cursor {
    display: inline-block;
    width: 8px;
    height: 15px;
    background: #00ff88;
    animation: blink 1s step-end infinite;
    vertical-align: middle;
    box-shadow: 0 0 8px #00ff88;
}

@keyframes blink { 50% { opacity: 0; } }

/* ============================================
   CHAT PAGE - HEADER
   ============================================ */
.chat-top-header {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: white;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 10;
}

.btn-back, .btn-icon {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-back:hover, .btn-icon:hover {
    background: rgba(255,255,255,0.25);
}

.header-title {
    flex: 1;
    min-width: 0;
}

.header-title h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-subtitle {
    font-size: 0.75rem;
    opacity: 0.85;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-badge {
    background: var(--danger);
    color: white;
    border-radius: 50%;
    min-width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0 5px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ============================================
   CHAT PAGE - MAIN (SIDEBAR & CONTACTS)
   ============================================ */
.chat-main {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
    background: black;
}

.sidebar {
    width: 320px;
    background: white;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 50;
}

.sidebar-header {
    padding: 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--border);
}

.sidebar-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.sidebar-header-top h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.btn-close-sidebar {
    background: var(--chat-bg);
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-close-sidebar:hover {
    background: var(--border);
    color: var(--text-primary);
}

.user-info-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.3rem;
}

.user-info-name {
    font-weight: 600;
    color: white;
    font-size: 0.95rem;
}

.user-info-status {
    font-size: 0.8rem;
    color: var(--success);
}

.search-box {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 0.65rem 0.75rem 0.65rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: 25px;
    font-size: 0.9rem;
    background: var(--chat-bg);
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin: 0.5rem 1rem;
    max-height: 250px;
    overflow-y: auto;
    display: none;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.search-results.show {
    display: block;
}

.search-result-item {
    padding: 0.85rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
    color: black;
}

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

.search-result-item:hover {
    background: var(--chat-bg);
}

.search-result-item.no-result {
    color: var(--text-secondary);
    cursor: default;
    font-style: italic;
}

.contacts-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
     background: linear-gradient(
        180deg,
        rgba(15, 23, 42, 0.95) 0%,
        rgba(10, 15, 25, 0.98) 100%
    );
}

.contacts-section-header {
    padding: 0.65rem 1rem;
     background: linear-gradient(
        180deg,
        rgba(15, 23, 42, 0.95) 0%,
        rgba(10, 15, 25, 0.98) 100%
    );
    border-bottom: 1px solid var(--border);
}

.contacts-section-header h3 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contacts-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.25rem;
}

.contact-item:hover {
    background: var(--chat-bg);
}

.contact-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
}

.contact-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.contact-info {
    flex: 1;
    min-width: 0;
}

.contact-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.contact-preview {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.unread-badge {
    display: inline-flex;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    font-size: 0.7rem;
    font-weight: 700;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.empty-contacts {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ============================================
   CHAT CONTENT & MESSAGES
   ============================================ */
.chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.messages-container::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 3px;
}

.empty-state {
    text-align: center;
    margin: auto;
    padding: 2rem;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.message-bubble {
    max-width: 75%;
    padding: 0.65rem 0.9rem;
    border-radius: 18px;
    word-wrap: break-word;
    position: relative;
    animation: fadeInBubble 0.25s ease-out;
    box-shadow: var(--shadow-sm);
}

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

.message-bubble.sent {
    align-self: flex-end;
    background: var(--sent-bubble);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-bubble.received {
    align-self: flex-start;
    background: var(--received-bubble);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.message-bubble img {
    max-width: 100%;
    border-radius: 12px;
    cursor: pointer;
    display: block;
}

.file-attachment {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(0,0,0,0.08);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    margin: 4px 0;
    transition: background 0.2s;
}

.message-bubble.sent .file-attachment {
    background: rgba(255,255,255,0.2);
}

.file-attachment:hover {
    background: rgba(0,0,0,0.12);
}

.message-text {
    word-wrap: break-word;
    white-space: pre-wrap;
    line-height: 1.4;
}

.message-time {
    font-size: 0.65rem;
    opacity: 0.75;
    margin-top: 4px;
    text-align: right;
}

.delete-timer {
    font-size: 0.65rem;
    opacity: 0.75;
    margin-top: 2px;
    font-style: italic;
}




.btn-emoji, .btn-attach {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 15%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.btn-emoji:hover, .btn-attach:hover {
    background: var(--chat-bg);
    color: var(--primary);
}

.btn-send {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 15%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-md);
}

.btn-send:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.emoji-picker {
    position: absolute;
    bottom: 100%;
    left: 0.75rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0.75rem;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    max-width: 320px;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    z-index: 100;
}

.emoji-item {
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px;
    text-align: center;
    border-radius: 6px;
    transition: all 0.15s;
}

.emoji-item:hover {
    background: var(--chat-bg);
    transform: scale(1.2);
}





.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
    border-radius: 12px;
    min-width: 60px;
    position: relative;
}

.nav-item:hover {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
}

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

.nav-item.active .nav-icon {
    transform: scale(1.1);
}

.nav-icon {
    font-size: 1.4rem;
    transition: transform 0.2s;
}

.nav-label {
    font-size: 0.7rem;
    font-weight: 600;
}

.nav-badge {
    position: absolute;
    top: 0px;
    right: 2px;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid white;
    animation: pulse-badge 2s infinite;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.4);
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ============================================
   MODALS & FORMS
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.2s;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 450px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s;
}

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

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: #334155;
    border-radius: 20px 20px 0 0;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: var(--chat-bg);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--border);
    color: var(--text-primary);
}

.modal-content > *:not(.modal-header) {
    padding: 0 1.5rem;
}

.settings-section {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
}

.settings-section:last-of-type {
    border-bottom: none;
}

.settings-section h4 {
    margin-bottom: 0.75rem;
    color: white;
    font-size: 0.95rem;
}

.settings-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: white;
    font-size: 0.9rem;
}

.settings-section select {
    width: 100%;
    padding: 0.65rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    padding: 1.25rem 1.5rem !important;
    border-top: 1px solid var(--border);
    background: #334155;
    border-radius: 0 0 20px 20px;
    margin-top: 50px;
}

.btn-primary, .btn-secondary, .btn-danger {
    padding: 0.7rem 1.25rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    border: none;
    transition: all 0.2s;
    flex: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-secondary {
    background: var(--chat-bg);
    color: var(--text-primary);
}
.btn-secondary:hover { background: var(--border); }

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

.btn-full { width: 100%; }

.form-group {
    padding: 1rem 0;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.user-checkboxes {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.5rem;
}

.user-checkboxes label {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s;
    font-weight: normal;
}

.user-checkboxes label:hover {
    background: var(--chat-bg);
}

.user-checkboxes input[type="checkbox"] {
    margin-right: 0.5rem;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.groups-list {
    margin-top: 0.75rem;
}

.group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--chat-bg);
    border-radius: 10px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.group-item:hover {
    background: #e5e7eb;
}

.group-item-name {
    font-weight: 600;
    color: var(--text-primary);
}

.group-item-members {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s;
}

.close-image {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
}

.members-count-badge {
    background: linear-gradient(135deg, #10b981 0%, #6366f1 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.members-count-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* ============================================
   BULLETPROOF LAYOUT & MOBILE FIXES
   ============================================ */
.app-wrapper {
    height: 100dvh; /* Rešava problem sakrivanja iza browser UI-a na mobilnom */
    display: flex;
    flex-direction: column;
    overflow: auto;
}

.chat-top-header {
    flex-shrink: 0;
    z-index: 50;
}

.chat-main {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
    min-height: 0; /* KLJUČNO: Sprečava flexbox overflow bug */
}

.chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* KLJUČNO: Dozvoljava messages-container da se skroluje */
    width: 100%;
    position: relative;
    overflow: hidden;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0; /* Sprečava da poruke guraju input-area van ekrana */
    padding: 1rem;
    padding-bottom: 0.5rem;
    scroll-behavior: smooth;
}





.bottom-nav {
    flex-shrink: 0;
    z-index: 100;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        width: 85%;
        max-width: 320px;
        z-index: 200;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .chat-content {
        width: 100%;
        height: 100%;
    }
    
    .message-bubble {
        max-width: 85%;
    }
    
    .quick-actions {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        padding: 1rem 0.75rem;
    }
    
    .action-card {
        padding: 0.75rem 0.25rem;
        font-size: 0.7rem;
    }
    
    .action-icon {
        font-size: 1.5rem;
    }
    
    .section {
        padding: 0 0.75rem 0.75rem;
    }
    
    .emoji-picker {
        grid-template-columns: repeat(6, 1fr);
        max-width: 90vw;
    }
    
    .input-area input[type="text"] {
        font-size: 16px; /* Sprečava zoom na iOS */
    }
    
    .nav-item {
        min-width: 50px;
        padding: 0.35rem 0.5rem;
    }
    
    .nav-icon {
        font-size: 1.25rem;
    }
    
    .nav-label {
        font-size: 0.65rem;
    }

    .chat-main {
        height: calc(100vh - 110px); /* Prilagodi visini header-a i bottom-nav */
    }
    
    
}

@media (hover: none) {
    .btn-emoji, .btn-attach, .btn-send, .btn-back, .btn-icon {
        min-width: 30px;
        min-height: 30px;
    }
    
    .contact-item {
        padding: 0.85rem 0.75rem;
    }
}



body.dark-theme .app-wrapper {
    background: #1e293b;
}



body.dark-theme .quick-actions .action-card {
    background: #334155;
    color: #e5e7eb;
    border: 1px solid #475569;
}

body.dark-theme .quick-actions .action-card:hover {
    background: #475569;
}

body.dark-theme .section {
    background: #1e293b;
}

body.dark-theme .section-header h2 {
    color: #e5e7eb;
}

body.dark-theme .see-all {
    color: #60a5fa;
}

body.dark-theme .recent-chat-item,
body.dark-theme .group-item {
    background: #334155;
    color: #e5e7eb;
}

body.dark-theme .recent-chat-item:hover,
body.dark-theme .group-item:hover {
    background: #475569;
}

body.dark-theme .chat-name,
body.dark-theme .group-item-name {
    color: #f3f4f6;
}

body.dark-theme .chat-preview,
body.dark-theme .group-item-members {
    color: #9ca3af;
}

body.dark-theme .chat-time {
    color: #9ca3af;
}

body.dark-theme .empty-state-card {
    background: #334155;
    color: #9ca3af;
}



body.dark-theme .nav-item {
    color: #9ca3af;
}

body.dark-theme .nav-item.active {
    color: #60a5fa;
}

body.dark-theme .user-details .user-name {
    color: #f3f4f6;
}

body.dark-theme .user-details .user-status {
    color: #86efac;
}

body.dark-theme .chat-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #312e81 100%);
    color: #f3f4f6;
    border-bottom: 1px solid #334155;
}

body.dark-theme .chat-header h2 {
    color: #f3f4f6;
}

body.dark-theme .sidebar {
    background: #1e293b;
    border-right: 1px solid #334155;
}

body.dark-theme .search-box input {
    background: #334155;
    border-color: #475569;
    color: #e5e7eb;
}

body.dark-theme .search-box input::placeholder {
    color: #6b7280;
}

body.dark-theme .contact-item {
    background: #334155;
    color: #e5e7eb;
    border-bottom: 1px solid #475569;
}

body.dark-theme .contact-item:hover {
    background: #475569;
}

body.dark-theme .contact-item.active {
    background: #475569;
    border-left: 3px solid #60a5fa;
}

body.dark-theme .contact-name {
    color: #f3f4f6;
}

body.dark-theme .contact-preview {
    color: #9ca3af;
}

body.dark-theme .unread-badge {
    background: #ef4444;
    color: white;
}

body.dark-theme .chat-area,
body.dark-theme .messages-container {
    background: #0f172a;
}

body.dark-theme .message-bubble.sent {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: white;
}

body.dark-theme .message-bubble.received {
    background: #334155;
    color: #e5e7eb;
}

body.dark-theme .message-time {
    color: #9ca3af;
}









body.dark-theme .modal {
    background: rgba(0, 0, 0, 0.7);
}

body.dark-theme .modal-content {
    background: #1e293b;
    color: #e5e7eb;
}

body.dark-theme .modal-header {
    border-bottom: 1px solid #334155;
}

body.dark-theme .modal-header h3 {
    color: #f3f4f6;
}

body.dark-theme .form-group label {
    color: #e5e7eb;
}

body.dark-theme .form-group input,
body.dark-theme .form-group select {
    background: #334155;
    border-color: #475569;
    color: #e5e7eb;
}

body.dark-theme .btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: white;
}

body.dark-theme .btn-secondary {
    background: #475569;
    color: #e5e7eb;
}

body.dark-theme .btn-danger {
    background: #1e293b;
    color: white;
}

body.dark-theme .login-page {
    background: linear-gradient(135deg, #1e3a8a 0%, #312e81 100%);
}

body.dark-theme .login-card {
    background: #1e293b;
    color: #e5e7eb;
}

body.dark-theme .login-header h1 {
    color: #f3f4f6;
}

body.dark-theme .login-header p {
    color: #9ca3af;
}

body.dark-theme .input-group input {
    background: #334155;
    border-color: #475569;
    color: #e5e7eb;
}

body.dark-theme .input-group input:focus {
    background: #1e293b;
    border-color: #60a5fa;
}

body.dark-theme .input-group input::placeholder {
    color: #6b7280;
}

body.dark-theme .action-card.delete-card {
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.3) 0%, rgba(153, 27, 27, 0.3) 100%);
    border: 1px solid rgba(239, 68, 68, 0.4);
}

body.dark-theme .action-card.delete-card:hover {
    background: linear-gradient(135deg, rgba(153, 27, 27, 0.5) 0%, rgba(185, 28, 28, 0.5) 100%);
    border-color: rgba(239, 68, 68, 0.7);
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.4);
}

body.dark-theme .action-card.delete-card .action-icon {
    color: #f87171;
    text-shadow: 0 0 15px rgba(248, 113, 113, 0.6);
}

body.dark-theme .action-card.delete-card span {
    color: #fca5a5;
    font-weight: 600;
}

/* ============================================
   MODERNE SVG IKONE
   ============================================ */
.icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    display: inline-block;
    vertical-align: middle;
}

.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }

body.dark-theme .icon {
    stroke: #e5e7eb;
}

/* ============================================
   GLASOVNE PORUKE
   ============================================ */
.voice-btn {
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.2s;
}

.voice-btn:hover {
    background: #f3f4f6;
    color: #6366f1;
}

.voice-btn.recording {
    background: #fee2e2;
    color: #dc2626;
    animation: pulseRecord 1s infinite;
}

@keyframes pulseRecord {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.voice-recording-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

.voice-recording-box {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    min-width: 280px;
}

.voice-recording-icon {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid #ef4444;
    animation: pulseRing 1.5s infinite;
}

@keyframes pulseRing {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.voice-recording-timer {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
    font-variant-numeric: tabular-nums;
}

.voice-recording-hint {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.btn-stop-recording {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-stop-recording:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.voice-message-player {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 200px;
    padding: 0.25rem 0;
}

.voice-play-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    transition: all 0.2s;
    flex-shrink: 0;
}

.voice-play-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.voice-play-btn .icon {
    width: 16px;
    height: 16px;
}

.voice-waveform {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    height: 24px;
}

.voice-waveform span {
    display: block;
    width: 3px;
    background: currentColor;
    opacity: 0.5;
    border-radius: 2px;
    height: 30%;
}

.voice-waveform span:nth-child(1) { height: 40%; }
.voice-waveform span:nth-child(2) { height: 70%; }
.voice-waveform span:nth-child(3) { height: 50%; }
.voice-waveform span:nth-child(4) { height: 90%; }
.voice-waveform span:nth-child(5) { height: 60%; }
.voice-waveform span:nth-child(6) { height: 80%; }
.voice-waveform span:nth-child(7) { height: 45%; }
.voice-waveform span:nth-child(8) { height: 95%; }
.voice-waveform span:nth-child(9) { height: 55%; }
.voice-waveform span:nth-child(10) { height: 35%; }

.voice-waveform.playing span {
    animation: waveAnim 0.8s infinite ease-in-out;
    opacity: 1;
}

.voice-waveform.playing span:nth-child(1) { animation-delay: 0s; }
.voice-waveform.playing span:nth-child(2) { animation-delay: 0.1s; }
.voice-waveform.playing span:nth-child(3) { animation-delay: 0.2s; }
.voice-waveform.playing span:nth-child(4) { animation-delay: 0.3s; }
.voice-waveform.playing span:nth-child(5) { animation-delay: 0.4s; }
.voice-waveform.playing span:nth-child(6) { animation-delay: 0.5s; }
.voice-waveform.playing span:nth-child(7) { animation-delay: 0.6s; }
.voice-waveform.playing span:nth-child(8) { animation-delay: 0.7s; }
.voice-waveform.playing span:nth-child(9) { animation-delay: 0.15s; }
.voice-waveform.playing span:nth-child(10) { animation-delay: 0.25s; }

@keyframes waveAnim {
    0%, 100% { transform: scaleY(0.4); }
    50% { transform: scaleY(1); }
}

.voice-duration {
    font-size: 0.8rem;
    opacity: 0.8;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

body.dark-theme .voice-btn:hover { background: #334155; }
body.dark-theme .voice-btn.recording { background: rgba(239, 68, 68, 0.2); }
body.dark-theme .voice-recording-box { background: #1e293b; }
body.dark-theme .voice-recording-timer { color: #f3f4f6; }
body.dark-theme .voice-recording-hint { color: #9ca3af; }

/* ============================================
   DUGME ZA BRISANJE FAJLOVA
   ============================================ */
.btn-delete-file {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}

.message-bubble:hover .btn-delete-file {
    opacity: 1;
}

.btn-delete-file:hover {
    background: #dc2626;
    transform: scale(1.1);
}

body.dark-theme .btn-delete-file {
    background: rgba(220, 38, 38, 0.8);
}

body.dark-theme .btn-delete-file:hover {
    background: #b91c1c;
}

body.dark-theme .bottom-nav-index {
    background: #1e293b;
}

/*Dodato za back chat*/



/* ============================================
   PREMIUM BLOCKCHAIN CHAT POZADINA (Glow + Raster + Animacija)
   ============================================ */
body.dark-theme .chat-area,
body.dark-theme .messages-container {
    /* Duboka tamna osnova */
    background-color: #080a10;
    
    /* 1. RASTER (Mreža) - veoma suptilna, tehnička */
    background-image: 
        linear-gradient(rgba(59, 130, 246, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center center;
    
    /* Fiksira pozadinu da ne "skače" pri skrolovanju */
    background-attachment: fixed;
    position: relative;
    overflow: hidden; /* Sprečava da animacija izlazi van okvira */
}

/* 2. SPORA ANIMACIJA GLOW-a (Plavi blockchain sjaj odozgo) 
body.dark-theme .messages-container::before {
    content: '';
    position: absolute;
    top: -30%;
    left: -20%;
    width: 140%;
    height: 140%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.07) 0%, rgba(139, 92, 246, 0.04) 40%, transparent 70%);
    animation: blockchainDrift 25s infinite ease-in-out alternate;
    pointer-events: none; 
    z-index: 0;
}*/

/* 3. SPORA ANIMACIJA GLOW-a (Zeleni sjaj odozdo za kontrast) 
body.dark-theme .messages-container::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -20%;
    width: 140%;
    height: 140%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.06) 0%, rgba(6, 182, 212, 0.03) 40%, transparent 70%);
    animation: blockchainDriftReverse 30s infinite ease-in-out alternate;
    pointer-events: none;
    z-index: 0;
}*/

/* 4. ANIMACIJE (Sporo, elegantno "disanje" i pomeranje mreže) */
@keyframes blockchainDrift {
    0% { transform: translate(0, 0) scale(1); opacity: 0.8; }
    100% { transform: translate(5%, 8%) scale(1.15); opacity: 1; }
}

@keyframes blockchainDriftReverse {
    0% { transform: translate(0, 0) scale(1); opacity: 0.8; }
    100% { transform: translate(-5%, -8%) scale(1.15); opacity: 1; }
}

/* 5. OSIGURANJE: Poruke i elementi chata moraju biti IZNAD animirane pozadine */
body.dark-theme .message-bubble,
body.dark-theme .date-separator,
body.dark-theme .typing-indicator,
body.dark-theme .chat-input-area {
    position: relative;
    z-index: 1;
}

/* Dodatni efekat: Blagi sjaj na samoj poruci kada se pojavi (opciono, za premium osećaj) */
body.dark-theme .message-bubble.sent {
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
body.dark-theme .message-bubble.received {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ============================================
   PREMIUM CHAT TOP HEADER - Blockchain Glassmorphism
   ============================================ */
body.dark-theme .chat-top-header {
    /* Glassmorphism osnova */
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(10, 15, 25, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    
    /* Premium border sa gradijentom */
    border-bottom: 1px solid transparent;
    background-clip: padding-box;
    position: relative;
    
    /* Duboka senka za odvajanje od chata */
    box-shadow: 
        0 4px 30px rgba(0, 0, 0, 0.4),
        0 1px 0 rgba(255, 255, 255, 0.05) inset;
    
    z-index: 10;
    padding: 0.75rem 1rem;
}

/* ✅ ANIMIRANA "BLOCKCHAIN" LINIJA NA DNU HEADERA */
body.dark-theme .chat-top-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(59, 130, 246, 0.8) 20%,
        rgba(139, 92, 246, 0.8) 50%,
        rgba(16, 185, 129, 0.8) 80%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: blockchainLine 4s linear infinite;
    opacity: 0.6;
}

/* ✅ SUBTILNI GLOW IZ HEADERA (ka chatu) */
body.dark-theme .chat-top-header::before {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to bottom, rgba(59, 130, 246, 0.15), transparent);
    pointer-events: none;
    z-index: -1;
}

@keyframes blockchainLine {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   HEADER ELEMENTI (Avatar, Ime, Status)
   ============================================ */
body.dark-theme .chat-top-header .chat-partner-name {
    color: #f3f4f6;
    font-weight: 700;
    font-size: 1rem;
    text-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
    letter-spacing: 0.3px;
}

body.dark-theme .chat-top-header .chat-partner-status {
    color: #10b981;
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

body.dark-theme .chat-top-header .chat-partner-status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

/* Avatar u headeru */
body.dark-theme .chat-top-header .chat-partner-avatar,
body.dark-theme .chat-top-header .header-avatar {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border: 2px solid rgba(59, 130, 246, 0.4);
    box-shadow: 
        0 0 15px rgba(59, 130, 246, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

body.dark-theme .chat-top-header .chat-partner-avatar:hover,
body.dark-theme .chat-top-header .header-avatar:hover {
    transform: scale(1.05);
    box-shadow: 
        0 0 25px rgba(59, 130, 246, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* ============================================
   DUGMAD U HEADERU (Nazad, Podešavanja, itd.)
   ============================================ */
body.dark-theme .chat-top-header button,
body.dark-theme .chat-top-header .header-btn,
body.dark-theme .chat-top-header .back-btn {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border-radius: 10px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

body.dark-theme .chat-top-header button:hover,
body.dark-theme .chat-top-header .header-btn:hover,
body.dark-theme .chat-top-header .back-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
    color: #93c5fd;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

body.dark-theme .chat-top-header button svg,
body.dark-theme .chat-top-header .header-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

/* ============================================
   BOTTOM NAVIGATION - Blockchain Glassmorphism
   ============================================ */
body.dark-theme .bottom-nav,
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    
    /* Glassmorphism pozadina */
    background: linear-gradient(to top, rgba(10, 15, 25, 0.98) 0%, rgba(15, 23, 42, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    
    /* Gornji border sa sjajem */
    border-top: 1px solid rgba(59, 130, 246, 0.15);
    
    /* Duboka senka za odvajanje od sadržaja */
    box-shadow: 
        0 -4px 30px rgba(0, 0, 0, 0.5),
        0 -1px 0 rgba(255, 255, 255, 0.05) inset;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.7rem 0 calc(0.7rem + env(safe-area-inset-bottom));
    padding: 0.2rem 0 calc(0.3rem + env(safe-area-inset-bottom));
    ition: relative;
}

/* ✅ ANIMIRANA NEON LINIJA NA VRHU NAVIGACIJE */
body.dark-theme .bottom-nav::before,
.bottom-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(59, 130, 246, 0.8) 20%,
        rgba(139, 92, 246, 0.8) 50%,
        rgba(16, 185, 129, 0.8) 80%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: bottomNavLine 4s linear infinite;
    opacity: 0.7;
}

/* ✅ SUBTILNI GLOW IZNAD NAVIGACIJE */
body.dark-theme .bottom-nav::after,
.bottom-nav::after {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to top, rgba(59, 130, 246, 0.12), transparent);
    pointer-events: none;
    z-index: -1;
}

@keyframes bottomNavLine {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   NAVIGACIONE STAVKE
   ============================================ */
body.dark-theme .nav-item,
.bottom-nav .nav-item {
    background: none;
    border: none;
    color: #64748b;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 0.5rem 1rem;
    position: relative;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

/* Hover efekat */
body.dark-theme .nav-item:hover,
.bottom-nav .nav-item:hover {
    color: #60a5fa;
    transform: translateY(-2px);
}

body.dark-theme .nav-item:hover .nav-icon,
.bottom-nav .nav-item:hover .nav-icon {
    filter: drop-shadow(0 0 8px rgba(96, 165, 250, 0.6));
}

/* ✅ AKTIVNA STAVKA */
body.dark-theme .nav-item.active,
.bottom-nav .nav-item.active {
    color: #60a5fa;
}

body.dark-theme .nav-item.active .nav-icon,
.bottom-nav .nav-item.active .nav-icon {
    filter: drop-shadow(0 0 12px rgba(96, 165, 250, 0.8));
    animation: navIconPulse 2s infinite;
}

/* Animirana linija ispod aktivne stavke */
body.dark-theme .nav-item.active::after,
.bottom-nav .nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 2px;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.8);
    animation: activeLineGlow 2s infinite;
}

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

@keyframes activeLineGlow {
    0%, 100% { opacity: 1; box-shadow: 0 0 15px rgba(59, 130, 246, 0.8); }
    50% { opacity: 0.7; box-shadow: 0 0 20px rgba(59, 130, 246, 1); }
}

/* ============================================
   IKONE
   ============================================ */
body.dark-theme .nav-icon,
.bottom-nav .nav-icon {
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
}

body.dark-theme .nav-icon svg,
.bottom-nav .nav-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* ============================================
   LABLE (Tekst ispod ikona)
   ============================================ */
body.dark-theme .nav-label,
.bottom-nav .nav-label {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}

body.dark-theme .nav-item.active .nav-label,
.bottom-nav .nav-item.active .nav-label {
    color: #93c5fd;
    text-shadow: 0 0 10px rgba(147, 197, 253, 0.5);
}

/* ============================================
   BADGE (Unread brojač)
   ============================================ */
body.dark-theme .nav-badge,
.bottom-nav .nav-badge {
    position: absolute;
    top: 0;
    right: 50%;
    transform: translateX(12px);
    
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    
    /* Border koji se poklapa sa pozadinom navigacije */
    border: 2px solid rgba(10, 15, 25, 0.98);
    
    /* Glow efekat */
    box-shadow: 
        0 0 12px rgba(239, 68, 68, 0.6),
        0 2px 4px rgba(239, 68, 68, 0.4);
    
    animation: badgePulse 2s infinite;
    z-index: 10;
}

@keyframes badgePulse {
    0%, 100% { 
        transform: translateX(12px) scale(1); 
        box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
    }
    50% { 
        transform: translateX(12px) scale(1.1); 
        box-shadow: 0 0 18px rgba(239, 68, 68, 0.9);
    }
}

/* ============================================
   RESPONSIVE (za veće ekrane)
   ============================================ */
@media (min-width: 601px) {
    body.dark-theme .bottom-nav,
    .bottom-nav {
        border-radius: 20px 20px 0 0;
        left: 50%;
        transform: translateX(-50%);
        max-width: 600px;
    }
}

/* ============================================
   SPECIJALNI STILOVI ZA ODREĐENE DUGMAD
   ============================================ */

/* Logout dugme (crveni accent) */
body.dark-theme .nav-item.logout:hover,
.bottom-nav .nav-item.logout:hover {
    color: #f87171;
}

body.dark-theme .nav-item.logout:hover .nav-icon,
.bottom-nav .nav-item.logout:hover .nav-icon {
    filter: drop-shadow(0 0 8px rgba(248, 113, 113, 0.6));
}

/* Novo/Plus dugme (zeleni accent) */
body.dark-theme .nav-item.new-chat:hover,
.bottom-nav .nav-item.new-chat:hover {
    color: #10b981;
}

body.dark-theme .nav-item.new-chat:hover .nav-icon,
.bottom-nav .nav-item.new-chat:hover .nav-icon {
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.6));
}

/* ============================================
   SETTINGS MODAL - Blockchain Glassmorphism
   ============================================ */

/* Overlay pozadina */
body.dark-theme .modal,
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    height: 100vh;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
    animation: modalOverlayFadeIn 0.3s ease;
}

@keyframes modalOverlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Glavni modal panel */
body.dark-theme .modal-content,
.modal-content {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(10, 15, 25, 0.99) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 20px;
    
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    
    box-shadow: 
        0 25px 60px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 0 40px rgba(59, 130, 246, 0.15);
    
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.3) transparent;
}

body.dark-theme .modal-content::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
    width: 4px;
}
body.dark-theme .modal-content::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 2px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   MODAL HEADER
   ============================================ */
body.dark-theme .modal-header,
.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(59, 130, 246, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

/* Animirana neon linija ispod headera */
body.dark-theme .modal-header::after,
.modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(59, 130, 246, 0.8) 20%,
        rgba(139, 92, 246, 0.8) 50%,
        rgba(16, 185, 129, 0.8) 80%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: modalHeaderLine 4s linear infinite;
    opacity: 0.7;
}

@keyframes modalHeaderLine {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

body.dark-theme .modal-header h3,
.modal-header h3 {
    margin: 0;
    color: #f3f4f6;
    font-size: 1.1rem;
    font-weight: 700;
    text-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Pulsirajuća tačka pored naslova */
body.dark-theme .modal-header h3::before,
.modal-header h3::before {
    content: '';
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
    animation: modalDotPulse 2s infinite;
}

@keyframes modalDotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
}

/* Close dugme */
body.dark-theme .modal-close,
.modal-close {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s ease;
}

body.dark-theme .modal-close:hover,
.modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.6);
    color: #fca5a5;
    transform: rotate(90deg) scale(1.05);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

/* ============================================
   SETTINGS SECTIONS
   ============================================ */
body.dark-theme .settings-section,
.settings-section {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}

body.dark-theme .settings-section:last-of-type,
.settings-section:last-of-type {
    border-bottom: none;
}

body.dark-theme .settings-section h4,
.settings-section h4 {
    margin: 0 0 1rem 0;
    color: #e5e7eb;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

body.dark-theme .settings-section label,
.settings-section label {
    display: block;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   SELECT DROPDOWN
   ============================================ */
body.dark-theme select,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 10px;
    color: #f3f4f6;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2360a5fa' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

body.dark-theme select:focus,
select:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5);
    background-color: rgba(30, 41, 59, 0.8);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

body.dark-theme select option,
select option {
    background: #1e293b;
    color: #f3f4f6;
    padding: 0.5rem;
}

/* ============================================
   BUTTONS
   ============================================ */

/* Primary button (plavi gradijent) */
body.dark-theme .btn-primary,
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    border: none;
    padding: 0.85rem 1.5rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    position: relative;
    overflow: hidden;
}

body.dark-theme .btn-primary:hover,
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
}

body.dark-theme .btn-primary:active,
.btn-primary:active {
    transform: translateY(0);
}

/* Full width */
body.dark-theme .btn-full,
.btn-full {
    width: 100%;
}

/* Danger button (crveni gradijent) */
body.dark-theme .btn-danger,
.btn-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.15) 100%);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
    width: 100%;
}

body.dark-theme .btn-danger:hover,
.btn-danger:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(220, 38, 38, 0.25) 100%);
    border-color: rgba(239, 68, 68, 0.6);
    color: #fca5a5;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

/* Secondary button (neutralni) */
body.dark-theme .btn-secondary,
.btn-secondary {
    background: rgba(30, 41, 59, 0.6);
    color: #94a3b8;
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

body.dark-theme .btn-secondary:hover,
.btn-secondary:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(59, 130, 246, 0.4);
    color: #e5e7eb;
}

/* ============================================
   MODAL ACTIONS (Footer sa dugmadima)
   ============================================ */
body.dark-theme .modal-actions,
.modal-actions {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(59, 130, 246, 0.15);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

/* Animirana linija iznad actions */
body.dark-theme .modal-actions::before,
.modal-actions::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(239, 68, 68, 0.6) 50%,
        transparent 100%
    );
    opacity: 0.5;
}

/* ============================================
   GROUPS LIST
   ============================================ */
body.dark-theme .groups-list,
.groups-list {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

body.dark-theme .group-item-card,
.group-item-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    cursor: pointer;
}

body.dark-theme .group-item-card:hover,
.group-item-card:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateX(4px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.15);
}

body.dark-theme .group-item-name,
.group-item-name {
    color: #f3f4f6;
    font-size: 0.9rem;
    font-weight: 600;
}

body.dark-theme .group-item-members,
.group-item-members {
    color: #94a3b8;
    font-size: 0.75rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    body.dark-theme .modal-content,
    .modal-content {
        max-height: 90vh;
        border-radius: 16px;
    }
    
    body.dark-theme .modal-header,
    .modal-header {
        padding: 1rem 1.25rem;
    }
    
    body.dark-theme .settings-section,
    .settings-section {
        padding: 1rem 1.25rem;
    }
    
    body.dark-theme .modal-actions,
    .modal-actions {
        padding: 1rem 1.25rem;
    }
}

/* ============================================
   INPUT AREA - Blockchain Glassmorphism
   ============================================ */
/* 
   body.dark-theme .input-area,
.input-area {
    position: fixed;
    bottom: 70px;
    left: 0;
    right: 0;
    max-width: 600px;
    margin: 0 auto;
    background: linear-gradient(to top, rgba(10, 15, 25, 0.98) 0%, rgba(15, 23, 42, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 
        0 -4px 30px rgba(0, 0, 0, 0.5),
        0 -1px 0 rgba(255, 255, 255, 0.05) inset;
    padding: 0.75rem 1rem;
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
} */

/*doradjen*/


body.dark-theme .input-area,
.input-area {
    position: fixed;
    bottom: 70px;
    left: 0;
    right: 0;
    max-width: 600px;
    margin: 0 auto;
    background: linear-gradient(to top, rgba(10, 15, 25, 0.98) 0%, rgba(15, 23, 42, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 
        0 -4px 30px rgba(0, 0, 0, 0.5),
        0 -1px 0 rgba(255, 255, 255, 0.05) inset;
    padding: 0.75rem 1rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Mobile optimizacije */
@media (max-width: 600px) {
    body.dark-theme .input-area,
    .input-area {
        bottom: 60px;
        padding: 0.6rem 0.75rem;
        padding-bottom: calc(0.6rem + env(safe-area-inset-bottom));
        gap: 0.4rem;
    }
}

@media (max-width: 400px) {
    body.dark-theme .input-area,
    .input-area {
        bottom: 55px;
        padding: 0.5rem 0.6rem;
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
        gap: 0.35rem;
    }
}



@keyframes inputAreaLine {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   EMOJI BUTTON
   ============================================ */
body.dark-theme .btn-emoji,
.btn-emoji {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

body.dark-theme .btn-emoji:hover,
.btn-emoji:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

/* ============================================
   EMOJI PICKER
   ============================================ */
body.dark-theme .emoji-picker,
.emoji-picker {
    position: absolute;
    bottom: 60px;
    left: 1rem;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 0.75rem;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.25rem;
    max-width: 300px;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    z-index: 100;
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.3) transparent;
}

body.dark-theme .emoji-picker::-webkit-scrollbar,
.emoji-picker::-webkit-scrollbar {
    width: 4px;
}
body.dark-theme .emoji-picker::-webkit-scrollbar-thumb,
.emoji-picker::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 2px;
}

body.dark-theme .emoji-picker.show,
.emoji-picker.show {
    display: grid;
}

body.dark-theme .emoji-picker button,
.emoji-picker button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

body.dark-theme .emoji-picker button:hover,
.emoji-picker button:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: scale(1.2);
}

/* ============================================
   ATTACH BUTTON
   ============================================ */
body.dark-theme .btn-attach,
.btn-attach {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

body.dark-theme .btn-attach:hover,
.btn-attach:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.5);
    color: #c4b5fd;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

body.dark-theme .btn-attach svg,
.btn-attach svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

/* ============================================
   TEXT INPUT
   ============================================ */
body.dark-theme #messageInput,
#messageInput {
    flex: 1;
    padding: 0.5rem 0.5rem;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    color: #f3f4f6;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    min-height: 42px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body.dark-theme #messageInput:focus,
#messageInput:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(30, 41, 59, 0.8);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

body.dark-theme #messageInput::placeholder,
#messageInput::placeholder {
    color: #64748b;
}

/* ============================================
   VOICE BUTTON
   ============================================ */
body.dark-theme .voice-btn,
.voice-btn {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #34d399;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

body.dark-theme .voice-btn:hover,
.voice-btn:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.5);
    color: #6ee7b7;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

body.dark-theme .voice-btn.recording,
.voice-btn.recording {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #f87171;
    animation: voicePulse 1s infinite;
}

@keyframes voicePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 15px rgba(239, 68, 68, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 25px rgba(239, 68, 68, 0.7); }
}

body.dark-theme .voice-btn svg,
.voice-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

/* ============================================
   SEND BUTTON
   ============================================ */
body.dark-theme .btn-send,
.btn-send {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border: none;
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

body.dark-theme .btn-send:hover,
.btn-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
}

body.dark-theme .btn-send:active,
.btn-send:active {
    transform: translateY(0) scale(0.95);
}

body.dark-theme .btn-send svg,
.btn-send svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* ============================================
   CHAT AREA PADDING
   ============================================ */
body.dark-theme .chat-area,
body.dark-theme .messages-container {
    padding-bottom: 160px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 600px) {
    body.dark-theme .input-area,
    .input-area {
        bottom: 61px;
        padding: 0.2rem 0.2rem;
        gap: 0.2rem;
    }
    
    body.dark-theme .btn-emoji,
    body.dark-theme .btn-attach,
    body.dark-theme .voice-btn,
    body.dark-theme .btn-send,
    .btn-emoji,
    .btn-attach,
    .voice-btn,
    .btn-send {
        width: 38px;
        height: 38px;
    }
}

@media (min-width: 601px) {
    body.dark-theme .input-area,
    .input-area {
        border-radius: 16px 16px 0 0;
        left: 50%;
        transform: translateX(-50%);
    }
}



/* ============================================
   MESSAGES CONTAINER - Mobile Optimized
   ============================================ */
body.dark-theme .messages-container,
.messages-container {
    padding-top: 80px; /* Sprečava da poruke idu iza header-a */
    padding-bottom: 80px; /* Sprečava da poruke idu ispod input area + bottom nav */
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    min-height: calc(100vh - 240px); /* Dinamička visina */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Glatko skrolovanje na iOS */
}

/* ============================================
   MESSAGE BUBBLES - Mobile First
   ============================================ */
body.dark-theme .message-bubble,
.message-bubble {
    max-width: 85%; /* Ne prelazi 85% širine ekrana */
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    position: relative;
    word-wrap: break-word;
    word-break: break-word;
    box-sizing: border-box;
}

/* Sent poruke (desna strana) */
body.dark-theme .message-bubble.sent,
.message-bubble.sent {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #f3f4f6;
    margin-left: auto; /* Gura udesno */
    margin-right: 0;
    border-bottom-right-radius: 4px; /* Repić */
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.15);
}

/* Received poruke (leva strana) */
body.dark-theme .message-bubble.received,
.message-bubble.received {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.15);
    color: #e5e7eb;
    margin-left: 0;
    margin-right: auto; /* Gura ulevo */
    border-bottom-left-radius: 4px; /* Repić */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* ============================================
   DATE SEPARATOR
   ============================================ */
body.dark-theme .date-separator,
.date-separator {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

body.dark-theme .date-separator span,
.date-separator span {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #94a3b8;
    padding: 0.4rem 1rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* ============================================
   MESSAGE TEXT & ELEMENTS
   ============================================ */
body.dark-theme .message-text,
.message-text {
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

body.dark-theme .message-time,
.message-time {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 0.25rem;
    text-align: right;
}

body.dark-theme .message-bubble.received .message-time,
.message-bubble.received .message-time {
    text-align: left;
}

/* ============================================
   MESSAGE IMAGE
   ============================================ */
body.dark-theme .message-image,
.message-image {
    max-width: 100%;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

body.dark-theme .message-image:hover,
.message-image:hover {
    transform: scale(1.02);
}

/* ============================================
   MESSAGE FILE
   ============================================ */
body.dark-theme .message-file,
.message-file {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 10px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    text-decoration: none;
    color: #e5e7eb;
    transition: all 0.3s ease;
}

body.dark-theme .message-file:hover,
.message-file:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
}

body.dark-theme .message-file-icon,
.message-file-icon {
    width: 40px;
    height: 40px;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #60a5fa;
    flex-shrink: 0;
}

body.dark-theme .message-file-info,
.message-file-info {
    flex: 1;
    min-width: 0;
}

body.dark-theme .message-file-name,
.message-file-name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.dark-theme .message-file-size,
.message-file-size {
    font-size: 0.7rem;
    color: #94a3b8;
}

/* ============================================
   VOICE MESSAGE
   ============================================ */
body.dark-theme .voice-message,
.voice-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

body.dark-theme .voice-play-btn,
.voice-play-btn {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

body.dark-theme .voice-play-btn:hover,
.voice-play-btn:hover {
    background: rgba(16, 185, 129, 0.3);
    transform: scale(1.05);
}

body.dark-theme .voice-waveform,
.voice-waveform {
    flex: 1;
    height: 30px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #34d399;
    font-size: 0.75rem;
}

/* ============================================
   TYPING INDICATOR
   ============================================ */
body.dark-theme .typing-indicator,
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    margin-bottom: 0.75rem;
}

body.dark-theme .typing-dot,
.typing-dot {
    width: 6px;
    height: 6px;
    background: #60a5fa;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

body.dark-theme .typing-dot:nth-child(2),
.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

body.dark-theme .typing-dot:nth-child(3),
.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-8px); opacity: 1; }
}

/* ============================================
   MOBILE OPTIMIZATIONS
   ============================================ */
@media (max-width: 600px) {
    body.dark-theme .messages-container,
    .messages-container {
        padding-top: 15px; /* Manji header na mob */
        bottom: 40px;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
          flex: 1;
        margin-bottom: 10%;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important; /* Glatko skrolovanje na iOS-u */
        scroll-behavior: auto !important;
        /* Dodaje malo prostora na dnu da poruka ne bude zalepljena za ivicu tastature */
        scroll-padding-bottom: 50px !important; 
    }
    
    body.dark-theme .message-bubble,
    .message-bubble {
        max-width: 88%; /* Malo šire na mob */
        padding: 0.3rem 0.85rem;
        font-size: 0.85rem;
    }
    
    body.dark-theme .message-text,
    .message-text {
        font-size: 0.85rem;
    }
    
    body.dark-theme .message-image,
    .message-image {
        max-width: 200px; /* Ograniči veličinu slika */
    }
}

/* ============================================
   SAFE AREA (iPhone notch, itd.)
   ============================================ */
@supports (padding: max(0px)) {
    body.dark-theme .messages-container,
    .messages-container {
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
    }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
body.dark-theme .messages-container::-webkit-scrollbar,
.messages-container::-webkit-scrollbar {
    width: 4px;
}

body.dark-theme .messages-container::-webkit-scrollbar-thumb,
.messages-container::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 2px;
}

body.dark-theme .messages-container::-webkit-scrollbar-track,
.messages-container::-webkit-scrollbar-track {
    background: transparent;
}

/* ============================================
   HEADER ACTIONS (Container za badge + meni)
   ============================================ */
body.dark-theme .header-actions,
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================
   NOTIFICATION BADGE (U header-u chata)
   ============================================ */
body.dark-theme .notification-badge,
.notification-badge {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    
    /* Border koji se poklapa sa headerom */
    border: 2px solid rgba(15, 23, 42, 0.95);
    
    /* Glow efekat */
    box-shadow: 
        0 0 15px rgba(239, 68, 68, 0.6),
        0 2px 6px rgba(239, 68, 68, 0.4);
    
    animation: notifBadgePulse 2s infinite;
    cursor: pointer;
    transition: transform 0.2s ease;
}

body.dark-theme .notification-badge:hover,
.notification-badge:hover {
    transform: scale(1.15);
    box-shadow: 
        0 0 25px rgba(239, 68, 68, 0.9),
        0 2px 8px rgba(239, 68, 68, 0.6);
}

body.dark-theme .notification-badge:active,
.notification-badge:active {
    transform: scale(0.95);
}

@keyframes notifBadgePulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 0 15px rgba(239, 68, 68, 0.6);
    }
    50% { 
        transform: scale(1.08); 
        box-shadow: 0 0 22px rgba(239, 68, 68, 0.9);
    }
}

/* ============================================
   BTN-ICON (Hamburger / Meni dugme)
   ============================================ */
body.dark-theme .btn-icon,
.btn-icon {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

body.dark-theme .btn-icon:hover,
.btn-icon:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
    color: #93c5fd;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

body.dark-theme .btn-icon:active,
.btn-icon:active {
    transform: translateY(0) scale(0.95);
}

body.dark-theme .btn-icon svg,
.btn-icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

/* ============================================
   NAV BADGE (U bottom-nav)
   ============================================ */
body.dark-theme .nav-badge,
.bottom-nav .nav-badge {
    position: absolute;
    top: 0;
    right: 50%;
    transform: translateX(12px);
    
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    
    /* Border koji se poklapa sa bottom nav pozadinom */
    border: 2px solid rgba(10, 15, 25, 0.98);
    
    /* Glow efekat */
    box-shadow: 
        0 0 12px rgba(239, 68, 68, 0.6),
        0 2px 4px rgba(239, 68, 68, 0.4);
    
    animation: navBadgePulse 2s infinite;
    z-index: 10;
}

@keyframes navBadgePulse {
    0%, 100% { 
        transform: translateX(12px) scale(1); 
        box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
    }
    50% { 
        transform: translateX(12px) scale(1.1); 
        box-shadow: 0 0 18px rgba(239, 68, 68, 0.9);
    }
}

/* ============================================
   MOBILE OPTIMIZACIJE
   ============================================ */
@media (max-width: 600px) {
    body.dark-theme .header-actions,
    .header-actions {
        gap: 0.4rem;
    }
    
    body.dark-theme .btn-icon,
    .btn-icon {
        width: 36px;
        height: 36px;
        border-radius: 9px;
    }
    
    body.dark-theme .btn-icon svg,
    .btn-icon svg {
        width: 20px;
        height: 20px;
    }
    
    body.dark-theme .notification-badge,
    .notification-badge {
        min-width: 20px;
        height: 20px;
        font-size: 0.65rem;
    }
}

/* ============================================
   TOUCH FEEDBACK (za mobilne uređaje)
   ============================================ */
@media (hover: none) {
    body.dark-theme .btn-icon:active,
    .btn-icon:active {
        background: rgba(59, 130, 246, 0.3);
        transform: scale(0.92);
    }
    
    body.dark-theme .notification-badge:active,
    .notification-badge:active {
        transform: scale(0.9);
    }
}

/* ============================================
   SIDEBAR HEADER - Premium Blockchain
   ============================================ */
body.dark-theme .sidebar-header,
.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(59, 130, 246, 0.15);
    position: relative;
    background: linear-gradient(
        180deg,
        rgba(15, 23, 42, 0.95) 0%,
        rgba(10, 15, 25, 0.98) 100%
    );
}

/* ✅ ANIMIRANA NEON LINIJA NA DNU */
body.dark-theme .sidebar-header::after,
.sidebar-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(59, 130, 246, 0.9) 25%,
        rgba(139, 92, 246, 0.9) 50%,
        rgba(16, 185, 129, 0.9) 75%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: sidebarHeaderGlow 4s linear infinite;
    opacity: 0.8;
}

/* ✅ SUBTILNI GLOW ISPOD HEADERA */
body.dark-theme .sidebar-header::before,
.sidebar-header::before {
    content: '';
    position: absolute;
    bottom: -25px;
    left: 0;
    right: 0;
    height: 25px;
    background: linear-gradient(
        to bottom,
        rgba(59, 130, 246, 0.15),
        transparent
    );
    pointer-events: none;
    z-index: -1;
}

@keyframes sidebarHeaderGlow {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   HEADER TOP (Naslov + Close dugme)
   ============================================ */
body.dark-theme .sidebar-header-top,
.sidebar-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

/* ============================================
   NASLOV "MENI"
   ============================================ */
body.dark-theme .sidebar-header h3,
.sidebar-header h3 {
    margin: 0;
    color: #f3f4f6;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-shadow: 0 0 18px rgba(59, 130, 246, 0.4);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* ✅ PULSIRAJUĆA TAČKA PRED NASLOVOM */
body.dark-theme .sidebar-header h3::before,
.sidebar-header h3::before {
    content: '';
    width: 9px;
    height: 9px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 3px;
    box-shadow: 
        0 0 12px rgba(59, 130, 246, 0.7),
        0 0 20px rgba(139, 92, 246, 0.4);
    animation: sidebarDotPulse 2.5s infinite ease-in-out;
}

@keyframes sidebarDotPulse {
    0%, 100% { 
        transform: scale(1) rotate(0deg); 
        opacity: 1;
        box-shadow: 0 0 12px rgba(59, 130, 246, 0.7);
    }
    50% { 
        transform: scale(1.25) rotate(180deg); 
        opacity: 0.8;
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.9);
    }
}

/* ============================================
   CLOSE DUGME (X)
   ============================================ */
body.dark-theme .btn-close-sidebar,
.btn-close-sidebar {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    font-weight: 300;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
}

body.dark-theme .btn-close-sidebar:hover,
.btn-close-sidebar:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.6);
    color: #fca5a5;
    transform: rotate(90deg) scale(1.08);
    box-shadow: 
        0 0 20px rgba(239, 68, 68, 0.5),
        0 0 30px rgba(239, 68, 68, 0.2);
}

body.dark-theme .btn-close-sidebar:active,
.btn-close-sidebar:active {
    transform: rotate(90deg) scale(0.95);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.6);
}

/* ============================================
   MOBILE OPTIMIZACIJE
   ============================================ */
@media (max-width: 480px) {
    body.dark-theme .sidebar-header,
    .sidebar-header {
        padding: 1rem 0.85rem;
    }
    
    body.dark-theme .sidebar-header h3,
    .sidebar-header h3 {
        font-size: 0.95rem;
    }
    
    body.dark-theme .btn-close-sidebar,
    .btn-close-sidebar {
        width: 32px;
        height: 32px;
        font-size: 0.95rem;
    }
}


/* ============================================
   ACTION BUTTON (WhatsApp-style: Voice ↔ Send)
   ============================================ */
body.dark-theme .action-btn,
.action-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    flex-shrink: 0;
}

body.dark-theme .action-btn:hover,
.action-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

body.dark-theme .action-btn:active,
.action-btn:active {
    transform: scale(0.95);
}

/* Voice mode (početno stanje) */
.action-btn.voice-mode {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
}

.action-btn.voice-mode .voice-icon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.action-btn.voice-mode .send-icon {
    opacity: 0;
    transform: scale(0.5) rotate(-90deg);
}

/* Send mode (kada korisnik kuca) */
.action-btn.send-mode {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.action-btn.send-mode .voice-icon {
    opacity: 0;
    transform: scale(0.5) rotate(90deg);
}

.action-btn.send-mode .send-icon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* Ikone unutar dugmeta */
.action-btn .icon {
    width: 24px;
    height: 24px;
    position: absolute;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-btn .voice-icon {
    stroke: white;
}

.action-btn .send-icon {
    fill: white;
}

/* Recording state (kada snima glas) */
.action-btn.recording {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    animation: recordingPulse 1.5s infinite;
}

@keyframes recordingPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
    }
    50% { 
        transform: scale(1.1);
        box-shadow: 0 6px 25px rgba(239, 68, 68, 0.7);
    }
}

/* Mobile optimizacije */
@media (max-width: 600px) {
    body.dark-theme .action-btn,
    .action-btn {
        width: 44px;
        height: 44px;
    }
    
    .action-btn .icon {
        width: 22px;
        height: 22px;
    }
}

.term-new-block {
    display: inline-block;
    margin-top: 10px;
    cursor: pointer;
    user-select: none;
    font-family: monospace;
    animation: blockBlink 2s ease-in-out infinite;
}

.term-new-block:hover {
    opacity: 1;
}

@keyframes blockBlink {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}


.custom-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
}

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

.custom-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
}

.custom-modal-box {
    position: relative;
    z-index: 2;
    width: calc(100% - 40px);
    max-width: 420px;
    background: #ffffff;
    border-radius: 18px;
    padding: 28px 24px 22px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: deleteModalShow 0.2s ease-out;
}

@keyframes deleteModalShow {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.custom-modal-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-modal-icon.danger {
    background: #fee2e2;
    color: #dc2626;
}

.custom-modal-title {
    font-size: 21px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 10px;
}

.custom-modal-text {
    font-size: 15px;
    line-height: 1.5;
    color: #6b7280;
    margin-bottom: 24px;
}

.custom-modal-text strong {
    color: #dc2626;
}

.custom-modal-buttons {
    display: flex;
    gap: 10px;
}

.custom-modal-btn {
    flex: 1;
    height: 46px;
    border: 0;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.custom-modal-btn.cancel {
    background: #f3f4f6;
    color: #374151;
}

.custom-modal-btn.delete {
    background: #dc2626;
    color: #ffffff;
}

.custom-modal-btn:active {
    transform: scale(0.97);
}

/* ============================================
   NEON BLINK ANIMACIJA ZA CUSTOM TEKST
   ============================================ */
@keyframes neonBlink {
    0%, 100% {
        opacity: 1;
        text-shadow: 
            0 0 10px rgba(0, 255, 136, 0.8),
            0 0 20px rgba(0, 255, 136, 0.4),
            0 0 30px rgba(0, 255, 136, 0.2);
    }
    50% {
        opacity: 0.7;
        text-shadow: 
            0 0 5px rgba(0, 255, 136, 0.4),
            0 0 10px rgba(0, 255, 136, 0.2);
    }
}

.custom-chain-notice {
    text-align: center;
    padding: 0.5rem;
    margin: 0.5rem 0;
    color: #00ff88;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 1px;
    animation: neonBlink 2s ease-in-out infinite;
}


/* ============================================
   ✅ OVERLAY ZA BRISANJE (Blokira ekran)
   ============================================ */
#nuke-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85); /* Tamna pozadina */
    z-index: 999999; /* Iznad svega */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    backdrop-filter: blur(5px); /* Zamućenje pozadine */
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Dok je nevidljiv, ne blokira */
}

/* Kada dodamo klasu 'active', overlay postaje vidljiv i blokira klikove */
#nuke-overlay.active {
    opacity: 1;
    pointer-events: all; 
}

/* Animirani točkić (Spinner) */
.nuke-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #6366f1; /* Tvoja ljubičasta boja */
    border-radius: 50%;
    animation: nuke-spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Tekst unutar overlay-a */
.nuke-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    letter-spacing: 0.5px;
}

.nuke-subtitle {
    font-size: 0.85rem;
    color: #9ca3af;
    margin: 0;
}


.sync-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(99, 102, 241, 0.1); /* Ljubičasta, providna */
    color: #6366f1;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 20px;
    margin: 10px auto;
    width: fit-content;
    animation: fadeIn 0.3s ease;
}

.sync-spinner-small {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-top: 2px solid #6366f1;
    border-radius: 50%;
    animation: nuke-spin 1s linear infinite;
}


.simple-loader-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.simple-loader-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.simple-loader-overlay img {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    animation: loaderPulse 1.5s ease-in-out infinite;
    margin-bottom: 20px;
}

.simple-loader-overlay .loader-text {
    color: #9ca3af;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 1px;
}

@keyframes loaderPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.6; }
}

/* =========================================
   PLUS MENU
========================================= */

.plus-menu-wrapper {
    position: relative;
    flex-shrink: 0;
}


.btn-plus {
    width: 35px;
    height: 35px;
    border: none;
     background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: currentColor;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: transform 0.2s ease;
}


.btn-plus.active {
    transform: rotate(45deg);
}


.plus-menu {
    position: absolute;
    left: 0;
    bottom: 52px;

    display: flex;
    flex-direction: column;

    min-width: 170px;

    padding: 8px;

    background: var(--bg-color, #fff);

    border: 1px solid rgba(0, 0, 0, 0.10);

    border-radius: 14px;

    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.18);

    z-index: 10000;
}


.plus-menu-item {
    display: flex;
    align-items: center;

    gap: 10px;

    width: 100%;

    padding: 10px 12px;

    border: none;

    background: transparent;

    border-radius: 10px;

    cursor: pointer;

    text-align: left;

    color: inherit;

    font-size: 25px;
}


.plus-menu-item:hover {
    background: rgba(128, 128, 128, 0.12);
}


.plus-menu-icon {
    width: 24px;
    height: 24px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;
}


.plus-menu-text {
    white-space: nowrap;
}


/* ACTION BUTTON */

.action-btn .send-icon {
    display: none;
}

.action-btn .voice-icon {
    display: block;
}


.action-btn.send-mode .voice-icon {
    display: none;
}

.action-btn.send-mode .send-icon {
    display: block;
}


@media (max-width: 600px) {

    .plus-menu {
        bottom: 50px;
        min-width: 50px;
          background: currentcolor;
    }

    .plus-menu-item {
        padding: 11px 10px;
    }
}

/* ✅ STIL ZA DUGME KANTE U LISTI RAZGOVORA */
.recent-chat-item {
    position: relative; /* Neophodno za pozicioniranje dugmeta */
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 12px;
    transition: background 0.2s;
    cursor: pointer;
}

.recent-chat-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

.delete-single-chat-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    opacity: 0; /* Sakriveno dok se ne pređe mišem */
    display: flex;
    align-items: center;
    justify-content: center;
}

.recent-chat-item:hover .delete-single-chat-btn {
    opacity: 1;
}

.delete-single-chat-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Na mobilnim uređajima dugme je uvek vidljivo */
@media (max-width: 768px) {
    .delete-single-chat-btn {
        opacity: 1;
        right: 15%;
    }
}


