/* CSS Variables */
:root {
    --primary: #4CAF50;
    --primary-dark: #388E3C;
    --primary-light: #C8E6C9;
    --background: #f8fcf8;
    --surface: #ffffff;
    --error: #D32F2F;
    --text-dark: #212121;
    --text-medium: #757575;
    --radius-lg: 16px;
    --radius-md: 8px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.1);
    --transition-default: all 0.3s ease;
}

/* Base Styles */
body {
    font-family: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--background);
    color: var(--text-dark);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Panel Title */
.panel-title {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    font-size: 1.25rem;
}

.panel-title i {
    margin-right: 0.5rem;
}

/* Modern Tabs */
.modern-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-md);
    padding: 10px;
    background-color: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.tab-item {
    flex: 1;
    list-style: none;
    min-width: 90px;
}

.tab-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 10px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--text-medium);
    font-weight: 500;
    font-size: 0.85rem;
    text-align: center;
    transition: var(--transition-default);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.tab-link i {
    font-size: 1.2rem;
    margin-bottom: 5px;
    transition: transform 0.3s ease;
}

.tab-link:hover {
    background-color: rgba(76, 175, 80, 0.08);
    color: var(--primary);
}

.tab-link:hover i {
    transform: scale(1.1);
}

.tab-link.active {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 3px 6px rgba(56, 142, 60, 0.3);
}

.tab-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 3px;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-medium);
}

.form-label i {
    margin-right: 0.5rem;
    color: var(--primary);
}

.form-control, .form-select {
    border-radius: var(--radius-md);
    border: 1px solid #e0e0e0;
    padding: 0.5rem 0.75rem;
    transition: var(--transition-default);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(76, 175, 80, 0.25);
}

/* Switch Toggle */
.switch-toggle {
    display: flex;
    background-color: #f5f5f5;
    border-radius: var(--radius-md);
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    position: relative;
}

.switch-toggle input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch-toggle label {
    flex: 1;
    text-align: center;
    padding: 10px 14px;
    cursor: pointer;
    transition: var(--transition-default);
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-medium);
    position: relative;
    z-index: 2;
}

.switch-toggle input[type="radio"]:checked + label {
    color: white;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

.switch-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    height: calc(100% - 6px);
    width: calc(50% - 6px);
    background-color: var(--primary);
    border-radius: calc(var(--radius-md) - 3px);
    transition: var(--transition-default);
    z-index: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.switch-toggle.you-active::after,
.switch-toggle.unread-active::after {
    transform: translateX(calc(100% + 0px));
}

/* Small toggle variant */
.switch-toggle-sm {
    min-width: 110px;
    height: 32px;
}

.switch-toggle-sm label {
    padding: 6px 10px;
    font-size: 12px;
}

/* Compact form elements */
.compact-form-group {
    margin-bottom: 0.5rem;
}

.small-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-medium);
    margin-bottom: 0.25rem;
    display: inline-block;
}

.compact-label {
    font-size: 0.85rem;
    margin-bottom: 0;
    color: var(--text-medium);
}

/* Time input */
.time-input-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100px;
    max-width: 25%;
}

.time-input-compact .form-control-sm {
    height: 32px;
    font-size: 0.875rem;
    text-align: center;
    padding: 0.25rem 0.5rem;
}

/* Message controls */
.message-controls-compact {
    margin-bottom: 10px;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: var(--radius-md);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.message-control-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    transition: var(--transition-default);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(56, 142, 60, 0.3);
}

.btn-edit {
    background-color: var(--primary);
    color: white;
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 11px;
    transition: var(--transition-default);
}

.btn-edit:hover {
    background-color: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-delete {
    background-color: #dc3545;
    color: white;
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 11px;
    transition: var(--transition-default);
    margin-left: 5px;
}

.btn-delete:hover {
    background-color: #bd2130;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-move-up, .btn-move-down {
    padding: 8px 20px;
    font-size: 0.75rem;
    line-height: 1.5;
    border-radius: 0.2rem;
    margin-left: 5px;
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-move-up:hover, .btn-move-down:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

/* Display controls */
.display-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.display-control-btn {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-md);
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    color: var(--text-medium);
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.display-control-btn:hover {
    background-color: rgba(76, 175, 80, 0.08);
    color: var(--primary);
}

.display-control-btn.active {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 3px 6px rgba(56, 142, 60, 0.3);
}

/* Chat preview */
.chat-preview-container {
    margin-top: 20px;
    border-top: 1px solid var(--primary-light);
    padding-top: 20px;
}

.chat-preview {
    min-height: 100px;
    overflow-y: auto;
    background-color: #f5f5f5;
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    position: relative;
}

.chat-messages-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-bottom: 10px;
    padding-top: 20px;
}

/* Chat messages */
.chat-message {
    position: relative;
    margin-bottom: 20px;
    padding: 14px 18px;
    border-radius: 18px;
    max-width: 75%;
    min-width: 25%;
    word-break: break-word;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: var(--transition-default);
    animation: message-appear 0.3s ease-out;
}

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

.chat-message:hover {
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.chat-message-me {
    background-color: var(--primary-light);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-message-you {
    background-color: #ffffff;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-date {
    margin: 20px 0;
    text-align: center;
    position: relative;
}

.date-content {
    display: inline-block;
    background-color: rgba(0, 0, 0, 0.1);
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-medium);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-weight: 500;
}

.block-id {
    position: absolute;
    top: -20px;
    font-size: 10px;
    color: var(--text-medium);
    background-color: rgba(255, 255, 255, 0.8);
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 5;
    cursor: pointer;
    transition: var(--transition-default);
    opacity: 0.7;
}

.block-id:hover {
    background-color: rgba(255, 60, 60, 0.2);
    opacity: 1;
}

.chat-message-me .block-id {
    right: 5px;
}

.chat-message-you .block-id {
    left: 5px;
}

.chat-date .block-id {
    left: 50%;
    transform: translateX(-50%);
}

.message-content {
    word-break: break-word;
    margin-bottom: 8px;
    line-height: 1.4;
}

.message-info {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    font-size: 15px;
    color: var(--text-medium);
    margin-top: 5px;
}

.message-time {
    margin-right: 4px;
}

.msg-status {
    color: var(--primary);
    font-size: 15px;
}

.message-actions {
    display: flex;
    justify-content: center;
    padding-top: 15px;
}

.date-actions {
    padding-top: 15px;
}

.chat-image {
    max-width: 100%;
    border-radius: 12px;
    margin-top: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Reply messages */
.reply-preview {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 10px;
    display: flex;
    border-left: 3px solid var(--primary);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.reply-image-container {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    overflow: hidden;
    border-radius: 6px;
    flex-shrink: 0;
}

.reply-preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reply-content {
    flex: 1;
    overflow: hidden;
}

.reply-preview-nickname {
    font-weight: 600;
    font-size: 13px;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.reply-preview-message {
    font-size: 12px;
    color: var(--text-medium);
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 40px;
    line-height: 1.3;
}

/* File messages */
.file-message {
    margin-bottom: 15px;
    position: relative;
}

.file-container {
    background: #f0f0f0;
    border-radius: 12px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.file-container:hover {
    background: #e8e8e8;
    border-color: #d0d0d0;
}

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

.file-icon {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.file-preview {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.file-preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.file-name {
    font-weight: 500;
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 12px;
    color: #666;
}

.chat-message-me .file-container {
    background: var(--primary-light);
    border-color: #C8E6C9;
}

.chat-message-you .file-container {
    background: #F5F5F5;
    border-color: #E0E0E0;
}

.chat-message-me .file-container:hover {
    background: #C8E6C9;
    border-color: #A5D6A7;
}

.chat-message-you .file-container:hover {
    background: #EEEEEE;
    border-color: #BDBDBD;
}

/* Call messages */
.call-message {
    position: relative;
    margin: 8px 0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.call-message:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.call-container {
    padding: 14px 16px;
    border-radius: 12px;
    background-color: var(--bs-light);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.chat-message-me .call-container {
    background-color: #e7f7ff;
    border-color: #cceeff;
}

.chat-message-you .call-container {
    background-color: #f5f5f5;
    border-color: #e8e8e8;
}

.incoming-call .call-notification {
    border-left: 3px solid #4caf50;
}

.outgoing-call .call-notification {
    border-left: 3px solid #2196f3;
}

.missed-call .call-notification {
    border-left: 3px solid #f44336;
}

.call-notification {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 10px;
}

.call-info {
    flex: 1;
}

.call-type {
    font-weight: 500;
    font-size: 15px;
    margin-bottom: 4px;
    color: var(--bs-dark);
}

.call-time {
    font-size: 13px;
    color: var(--bs-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.call-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.incoming-call .call-icon i {
    color: #4caf50;
    transform: rotate(145deg);
}

.outgoing-call .call-icon i {
    color: #2196f3;
    transform: rotate(320deg);
}

.missed-call .call-icon i {
    color: #f44336;
    transform: rotate(135deg);
}

.phone-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #0d6efd;
    color: white;
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.3);
    transition: all 0.2s ease;
}

.phone-button:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(13, 110, 253, 0.4);
    cursor: pointer;
}

.phone-button i {
    font-size: 16px;
}

.phone-button.video-call {
    background-color: #6610f2;
    box-shadow: 0 2px 4px rgba(102, 16, 242, 0.3);
}

.phone-button.video-call:hover {
    box-shadow: 0 3px 6px rgba(102, 16, 242, 0.4);
}

.missed-call .phone-button {
    background-color: #dc3545;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.missed-call .phone-button:hover {
    box-shadow: 0 3px 6px rgba(220, 53, 69, 0.4);
}

/* Reactions */
.reaction-controls-compact {
    margin-top: 15px;
    padding: 12px;
    background-color: #def8ea;
    border-radius: var(--radius-md);
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.reaction-controls-compact h6 {
    color: var(--primary-dark);
    font-weight: 600;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--primary-light);
    padding-bottom: 0.5rem;
}

.additional-reaction-item {
    position: relative;
    margin-top: 10px;
    padding: 12px;
    border: 1px dashed #dee2e6;
    border-radius: var(--radius-md);
    background-color: #f8f9fa;
    animation: reactionItemAppear 0.3s ease;
}

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

.remove-reaction-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #dc3545;
    color: white;
    border: none;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-reaction-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

.reactions-display {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.reaction-bubble {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 16px;
    padding: 6px 10px;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(2px);
    transition: transform 0.2s ease;
    animation: reactionAppear 0.3s ease;
}

.reaction-bubble:hover {
    transform: scale(1.05);
}

.reaction-emoji {
    font-size: 16px;
    line-height: 1;
}

.reaction-avatar {
    width: 18px !important;
    height: 18px !important;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

@keyframes reactionAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.chat-message-me .reaction-bubble {
    background: rgba(200, 230, 201, 0.95);
    border-color: rgba(76, 175, 80, 0.3);
}

.chat-message-you .reaction-bubble {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.15);
}

/* Vertical slider */
.vertical-slider-container {
    width: 21px;
    margin-left: 10px;
    margin-right: 10px;
    background: #f0f0f0;
    border-radius: 16px;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
    position: relative;
}

.slider-track {
    height: 95%;
    width: 6px;
    border-radius: 3px;
    background: linear-gradient(to bottom, var(--primary-light), var(--primary));
    position: relative;
    margin: 0 auto;
}

.custom-slider-thumb {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffbf42;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 5%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    cursor: grab;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    touch-action: none;
}

.custom-slider-thumb::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
}

.custom-slider-thumb:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.custom-slider-thumb.active {
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.custom-slider-thumb.grabbing {
    cursor: grabbing;
    background: var(--primary-dark);
}

/* Result card */
.result-card {
    display: flex;
    flex-direction: row;
    overflow: hidden;
    transition: var(--transition-default);
    height: 100%;
    border-radius: var(--radius-md);
    min-height: 400px;
}

.result-card:hover {
    box-shadow: var(--shadow-lg);
}

.result-image {
    background-color: #f0f0f0;
    height: 100%;
    flex: 1;
    position: relative;
}

.result-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Loading animation */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: var(--radius-md);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Icons grid */
.icons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius-md);
}

.icons-grid.light {
    background-color: #f8f9fa;
}

.icon-option {
   display: flex;
   flex-direction: column;
   align-items: center;
   padding: 10px;
   border-radius: var(--radius-md);
   cursor: pointer;
   transition: var(--transition-default);
}

.icon-option:hover {
   background-color: rgba(76, 175, 80, 0.1);
}

.icon-option.selected {
   background-color: var(--primary);
   color: white !important;
}

.icon-option img {
   width: 70%;
   height: 70%;
   margin-bottom: 5px;
}

.icon-option span {
   font-size: 12px;
   text-align: center;
}

/* Settings items */
.setting-item {
   display: flex;
   flex-direction: column;
   align-items: center;
}

.setting-circle-btn {
   width: 80px;
   height: 80px;
   border-radius: 50%;
   border: 1px solid #e0e0e0;
   background-color: #ffffff;
   display: flex;
   align-items: center;
   justify-content: center;
   cursor: pointer;
   transition: var(--transition-default);
   padding: 0;
}

.setting-circle-btn:hover {
   box-shadow: 0 4px 8px rgba(0,0,0,0.1);
   transform: translateY(-2px);
}

.setting-circle-btn img {
   max-width: 40px;
   max-height: 40px;
}

.setting-label {
   font-size: 12px;
   color: #757575;
   text-align: center;
   margin-top: 5px;
}

/* Activation panel */
.activation-panel {
   background-color: var(--surface);
   border-radius: var(--radius-lg);
   box-shadow: var(--shadow-md);
   padding: 1.5rem;
   margin-bottom: 1.5rem;
   transition: all 0.3s ease;
}

.activation-panel:hover {
   box-shadow: var(--shadow-lg);
}

.activation-input-group {
   box-shadow: 0 1px 3px rgba(0,0,0,0.08);
   border-radius: var(--radius-md);
   overflow: hidden;
}

.activation-input-group .input-group-text {
   background-color: #f8f9fa;
   border-color: #e0e0e0;
   color: var(--primary);
}

.activation-input-group .form-control {
   border-color: #e0e0e0;
   padding-left: 0.75rem;
   font-size: 0.95rem;
}

.activation-input-group .form-control:focus {
   box-shadow: none;
   border-color: var(--primary);
}

.activation-input-group .btn-outline-primary {
   border-color: #e0e0e0;
   color: var(--primary);
}

.activation-input-group .btn-outline-primary:hover {
   background-color: var(--primary);
   border-color: var(--primary);
   color: white;
}

.activation-info .alert {
   margin-bottom: 0;
   padding: 0.75rem;
   font-size: 0.85rem;
   border-left: 3px solid var(--primary);
}

.activation-actions .btn {
   transition: all 0.3s ease;
   border-radius: var(--radius-md);
}

.activation-actions .btn-success {
   background-color: var(--primary);
   border-color: var(--primary);
   font-weight: 600;
   letter-spacing: 0.5px;
   padding: 0.75rem;
}

.activation-actions .btn-success:hover {
   background-color: var(--primary-dark);
   transform: translateY(-2px);
   box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.activation-actions .btn-danger:hover {
   transform: translateY(-2px);
   box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.activation-actions .btn-primary:hover {
   transform: translateY(-2px);
   box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

/* Preview images */
.avatar-preview, .bg-preview, .chat-image-preview {
   width: 100%;
   max-height: 250px;
   display: flex;
   align-items: center;
   justify-content: center;
   background-color: #f8f9fa;
   border-radius: var(--radius-md);
   overflow: hidden;
}

/* JSON modal */
#json-output-pre {
   background-color: #f8f9fa;
   border-radius: var(--radius-md);
   padding: 1rem;
   max-height: 60vh;
   overflow-y: auto;
   white-space: pre-wrap;
   word-break: break-word;
   font-size: 14px;
   font-family: 'Consolas', 'Monaco', monospace;
   color: #333;
}

/* Tab pane headings */
.tab-pane h5 {
   color: var(--primary-dark);
   font-weight: 600;
   padding-bottom: 0.5rem;
   border-bottom: 1px solid var(--primary-light);
   margin-top: 1.5rem;
}

.tab-pane h6 {
   font-size: 0.9rem;
   font-weight: 600;
   color: var(--primary-dark);
   margin-bottom: 0.75rem;
}

/* Card styles */
.card {
   border-radius: var(--radius-md);
   border: 1px solid rgba(0,0,0,0.1);
   box-shadow: var(--shadow-sm);
}

/* Chat fields display control */
.chat-field {
   display: none;
}

/* Toast notifications */
.toast-container {
   position: fixed;
   bottom: 20px;
   right: 20px;
   z-index: 1050;
}

.toast {
   min-width: 250px;
   box-shadow: 0 5px 15px rgba(0,0,0,0.2);
   border-radius: 10px;
   margin-bottom: 10px;
   backdrop-filter: blur(4px);
   opacity: 0;
   transition: opacity 0.3s ease;
}

.toast.show {
   opacity: 1;
   animation: toastFadeIn 0.3s ease forwards;
}

.toast.hide {
   animation: toastFadeOut 0.3s ease forwards;
}

.toast.bg-success {
   background-color: rgba(40, 167, 69, 0.95) !important;
}

.toast.bg-danger {
   background-color: rgba(220, 53, 69, 0.95) !important;
}

.toast.bg-warning {
   background-color: rgba(255, 193, 7, 0.95) !important;
}

.toast-header {
   border-bottom: 1px solid rgba(255, 255, 255, 0.1);
   border-top-left-radius: 9px;
   border-top-right-radius: 9px;
   display: flex;
   align-items: center;
}

.toast-body {
   padding: 0.75rem;
}

.toast .btn-close-white {
   filter: invert(1);
}

.toast i {
   font-size: 1.1rem;
}

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

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

/* Modals */
#activationConfirmModal .modal-content {
   border-radius: 16px;
   box-shadow: 0 10px 25px rgba(0,0,0,0.15);
   border: none;
   overflow: hidden;
}

#activationConfirmModal .modal-header {
   border-bottom: none;
   padding: 1.25rem 1.5rem;
}

#activationConfirmModal .modal-footer {
   border-top: none;
   padding: 1rem 1.5rem 1.5rem;
}

#activationConfirmModal .btn-primary {
   padding-left: 1.5rem;
   padding-right: 1.5rem;
   font-weight: 500;
   transition: all 0.3s ease;
}

#activationConfirmModal .btn-primary:hover {
   transform: translateY(-2px);
   box-shadow: 0 4px 8px rgba(56, 142, 60, 0.3);
}

#activationConfirmModal .alert {
   border-radius: 12px;
   border-left-width: 4px;
}

#activationConfirmModal .text-warning {
   color: #ffc107 !important;
}

#counter-value.text-warning {
   color: #ffc107 !important;
}

/* Responsive Design */
@media (max-width: 991.98px) {
   .result-card {
       min-height: 350px;
   }

   .result-image {
       flex: 1;
   }

   .vertical-slider-container {
       width: 24px;
       margin-left: 5px;
       margin-right: 5px;
   }

   .controls-column {
       display: block !important;
       position: static;
       width: 100%;
       height: auto;
       background-color: var(--surface);
       border-radius: var(--radius-lg);
       box-shadow: var(--shadow-md);
       margin-bottom: 1rem;
       padding: 1rem;
   }

   .mobile-actions {
       display: none !important;
   }
}

@media (max-width: 767.98px) {
   .panel-title {
       background: #ddf0dd;
       padding: 15px;
       border: dashed 2px #eaeaea;
       border-radius: 10px;
   }

   .mobile-toggle {
       display: block !important;
   }

   .result-card {
       min-height: 300px;
   }

   .modern-tabs {
       flex-wrap: nowrap;
       gap: 5px;
       padding: 5px;
       justify-content: space-between;
   }

   .tab-item {
       min-width: 70px;
       flex: 1;
   }

   .tab-link {
       padding: 8px 5px;
       font-size: 0.75rem;
   }

   .tab-link i {
       font-size: 1rem;
   }

   .chat-message {
       max-width: 100%;
   }

   .message-actions {
       top: -50px;
       gap: 5px;
   }

   .btn-edit, .btn-delete {
       margin-left: 0;
   }

   .reaction-controls-compact {
       padding: 8px;
   }

   .reaction-controls-compact .row.g-2 {
       --bs-gutter-x: 0.5rem;
   }

   .call-container {
       padding: 10px 12px;
   }

   .phone-button {
       width: 32px;
       height: 32px;
   }

   .call-type {
       font-size: 14px;
   }

   .call-time {
       font-size: 12px;
   }
}

@media (max-width: 576px) {
   .message-actions {
       gap: 5px;
   }

   .btn-edit, .btn-delete {
       margin-left: 0;
   }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
   .call-container {
       background-color: #2d2d2d;
       border-color: #3d3d3d;
   }

   .chat-message-me .call-container {
       background-color: #0d3a56;
       border-color: #195a84;
   }

   .chat-message-you .call-container {
       background-color: #2d2d2d;
       border-color: #3d3d3d;
   }

   .call-type {
       color: #e8e8e8;
   }

   .call-time {
       color: #b8b8b8;
   }

   .chat-message-me .call-container:hover {
       background-color: #0d456a;
       border-color: #1e6699;
   }

   .chat-message-you .call-container:hover {
       background-color: #333333;
       border-color: #444444;
   }
}

/* Utility classes */
.d-flex {
   display: flex;
}

.justify-content-between {
   justify-content: space-between;
}

.align-items-center {
   align-items: center;
}

.text-center {
   text-align: center;
}

.w-100 {
   width: 100%;
}

.mt-2 {
   margin-top: 0.5rem;
}

.mt-3 {
   margin-top: 1rem;
}

.mb-2 {
   margin-bottom: 0.5rem;
}

.mb-3 {
   margin-bottom: 1rem;
}

.me-1 {
   margin-right: 0.25rem;
}

.me-2 {
   margin-right: 0.5rem;
}

.p-3 {
   padding: 1rem;
}

.h-100 {
   height: 100%;
}

.position-relative {
   position: relative;
}

.overflow-hidden {
   overflow: hidden;
}

/* Animation keyframes */
@keyframes ripple {
   0% {
       transform: scale(0, 0);
       opacity: 0.5;
   }
   20% {
       transform: scale(25, 25);
       opacity: 0.3;
   }
   100% {
       opacity: 0;
       transform: scale(40, 40);
   }
}

/* Button effects */
#chat-submit-btn {
   margin-top: 15px;
   margin-bottom: 20px;
   transition: var(--transition-default);
   position: relative;
   overflow: hidden;
}

#chat-submit-btn:hover {
   transform: translateY(-2px);
   box-shadow: 0 4px 8px rgba(56, 142, 60, 0.3);
}

#chat-submit-btn::after {
   content: '';
   position: absolute;
   top: 50%;
   left: 50%;
   width: 5px;
   height: 5px;
   background: rgba(255, 255, 255, 0.5);
   opacity: 0;
   border-radius: 100%;
   transform: scale(1, 1) translate(-50%);
   transform-origin: 50% 50%;
}

#chat-submit-btn:focus:not(:active)::after {
   animation: ripple 1s ease-out;
}

#cancel-edit-btn {
   transition: var(--transition-default);
}

#cancel-edit-btn:hover {
   background-color: #dc3545;
   color: white;
   transform: translateY(-2px);
}

#clear-chat-btn {
   margin-bottom: 15px;
   transition: all 0.3s ease;
}

#clear-chat-btn:hover {
   background-color: #c82333;
   transform: translateY(-2px);
   box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* Slider fixes */
.vertical-slider-container.dragging {
   pointer-events: all !important;
}

body.slider-active {
   cursor: grabbing !important;
}

/* Message visibility controls */
.chat-message:first-child .btn-move-up,
.chat-message:last-child .btn-move-down,
.chat-date:first-child .btn-move-up,
.chat-date:last-child .btn-move-down {
   opacity: 0.5;
   cursor: not-allowed;
}




/* Emoji picker integration */
emoji-picker {
   width: 100%;
}

/* Reaction emoji button */
.reaction-emoji-btn {
   background: #25a400 !important;
   border-color: #25a400 !important;
   font-size: 1rem;
   padding: 0.375rem 0.75rem;
   min-width: 42px;
}

.reaction-emoji-btn:hover {
   background: #1e8b00 !important;
   border-color: #1e8b00 !important;
}

.additional-reaction-item .btn-sm {
   min-width: 36px;
   padding: 0.25rem 0.5rem;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
   * {
       animation-duration: 0.01ms !important;
       animation-iteration-count: 1 !important;
       transition-duration: 0.01ms !important;
   }
}

/* Focus states */
.tab-link:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
   outline: 2px solid var(--primary);
   outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
   .switch-toggle {
       border: 2px solid currentColor;
   }
   
   .btn-primary {
       border: 2px solid currentColor;
   }
   
   .chat-message {
       border: 1px solid currentColor;
   }
}

/* Стили для стикеров */
.stickers-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 20px;
}

.sticker-option {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

.sticker-option:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.05);
}

.sticker-option.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.sticker-emoji {
    font-size: 2rem;
    line-height: 1;
}

.sticker-message {
    margin: 10px 0;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.sticker-container {
    position: relative;
    display: inline-block;
    max-width: 150px;
}

.sticker-image {
    width: 100%;
    height: auto;
    max-width: 150px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.sticker-time {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
}

.sticker-preview {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: var(--radius-md);
    border: 1px solid #e0e0e0;
}

#sticker-preview {
    max-width: 120px;
    border-radius: 8px;
}

/* Адаптивность для мобильных */
@media (max-width: 576px) {
    .stickers-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 15px;
    }
    
    .sticker-emoji {
        font-size: 1.5rem;
    }
    
    .sticker-container {
        max-width: 120px;
    }
    
    .sticker-image {
        max-width: 120px;
    }
}

/* Стили для стикеров */
.stickers-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 20px;
}

.sticker-option {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

.sticker-option:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.05);
}

.sticker-option.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.sticker-emoji {
    font-size: 2rem;
    line-height: 1;
}

.sticker-preview {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: var(--radius-md);
    border: 1px solid #e0e0e0;
}

#sticker-preview {
    max-width: 120px;
    border-radius: 8px;
}

/* Стили для стикеров */
.stickers-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 20px;
}

.sticker-option {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

.sticker-option:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.05);
}

.sticker-option.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.sticker-emoji {
    font-size: 2rem;
    line-height: 1;
}

.sticker-preview {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: var(--radius-md);
    border: 1px solid #e0e0e0;
}

#sticker-preview {
    max-width: 120px;
    border-radius: 8px;
}

/* Стили для сообщений-стикеров */
.sticker-message {
    margin: 10px 0;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.sticker-container {
    position: relative;
    display: inline-block;
    max-width: 150px;
}

.sticker-image {
    width: 100%;
    height: auto;
    max-width: 150px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.sticker-time {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
}

/* Стили для галереи стикеров */
.stickers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.sticker-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    min-height: 100px;
}

.sticker-option:hover {
    border-color: #007bff;
    background-color: rgba(0, 123, 255, 0.1);
    transform: scale(1.05);
}

.custom-sticker-img {
    max-width: 80px;
    max-height: 80px;
    object-fit: contain;
}