/*
 * Cabinet Mobile Tabs
 * Mobile-specific styles for cabinet tab navigation with swipe gestures
 */

/* Mobile tab navigation container - VISIBLE ON ALL SCREENS FOR TESTING */
.cabinet-mobile-tabs-container {
    display: flex;
    position: sticky;
    top: 0;
    background: var(--cab-card-bg);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 15px;
    border: 1px solid var(--cab-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

.cabinet-mobile-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--cab-text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.cabinet-mobile-tab.active {
    background: var(--cab-accent);
    color: white;
    box-shadow: 0 2px 6px rgba(93, 64, 55, 0.2);
}

.cabinet-mobile-tab:hover:not(.active) {
    background: rgba(93, 64, 55, 0.1);
}

/* Mobile tab content wrapper */
.cabinet-mobile-content-wrapper {
    position: relative;
    overflow: hidden;
    min-height: 400px;
}

.cabinet-mobile-tab-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateX(20px);
    overflow-y: auto;
    padding-bottom: 20px;
}

.cabinet-mobile-tab-content.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    position: relative;
}

/* Swipe indicator */
.cabinet-mobile-swipe-hint {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 8px 0;
    margin-bottom: 10px;
}

.cabinet-mobile-swipe-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cab-border);
    transition: all 0.3s ease;
}

.cabinet-mobile-swipe-dot.active {
    background: var(--cab-accent);
    transform: scale(1.2);
}

/* Hide desktop newsletter controls when mobile tabs are active */
.cabinet-overlay.active .newsletter-controls {
    display: none !important;
}

/* Compact header for mobile */
.cabinet-header-compact {
    padding: 12px 16px;
    margin-bottom: 12px;
}

.cabinet-user-info-mini {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.user-rank-mini {
    font-size: 0.85rem;
    line-height: 1.3;
}

/* Newsletter tab specific styles */
.cabinet-newsletter-tab-content {
    padding: 16px;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--cab-border);
}

.newsletter-mobile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--cab-border);
}

.newsletter-mobile-icon {
    font-size: 2.5rem;
}

.newsletter-mobile-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--cab-accent);
}

.newsletter-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--cab-card-bg);
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--cab-border);
}

.newsletter-mobile-toggle-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--cab-text);
}

.newsletter-mobile-toggle-switch {
    position: relative;
    width: 50px;
    height: 28px;
}

.newsletter-mobile-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.newsletter-mobile-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 28px;
}

.newsletter-mobile-toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.newsletter-mobile-toggle-switch input:checked + .newsletter-mobile-toggle-slider {
    background-color: var(--cab-accent);
}

.newsletter-mobile-toggle-switch input:checked + .newsletter-mobile-toggle-slider:before {
    transform: translateX(22px);
}

/* Chat widget toggle in newsletter tab */
.chat-widget-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--cab-card-bg);
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--cab-border);
}

/* Admin button in newsletter tab */
.newsletter-admin-btn {
    width: 100%;
    padding: 14px;
    background: var(--cab-accent);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.newsletter-admin-btn:hover {
    background: var(--cab-accent-hover);
    transform: translateY(-2px);
}

/* Touch feedback for tabs */
.cabinet-mobile-tab {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.cabinet-mobile-tab:active {
    transform: scale(0.98);
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    .cabinet-mobile-tabs-container {
        display: flex;
        position: sticky;
        top: 0;
        background: var(--cab-card-bg);
        border-radius: 12px;
        padding: 4px;
        margin-bottom: 15px;
        border: 1px solid var(--cab-border);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        z-index: 10;
    }

    .cabinet-mobile-tab {
        flex: 1;
        padding: 10px 16px;
        border: none;
        background: transparent;
        color: var(--cab-text-muted);
        font-size: 0.9rem;
        font-weight: 600;
        cursor: pointer;
        border-radius: 8px;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }

    .cabinet-mobile-tab.active {
        background: var(--cab-accent);
        color: white;
        box-shadow: 0 2px 6px rgba(93, 64, 55, 0.2);
    }

    .cabinet-mobile-tab:hover:not(.active) {
        background: rgba(93, 64, 55, 0.1);
    }

    /* Mobile tab content wrapper */
    .cabinet-mobile-content-wrapper {
        position: relative;
        overflow: hidden;
        min-height: 400px;
    }

    .cabinet-mobile-tab-content {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, transform 0.3s ease;
        transform: translateX(20px);
        overflow-y: auto;
        padding-bottom: 20px;
    }

    .cabinet-mobile-tab-content.active {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
        position: relative;
    }

    /* Swipe indicator */
    .cabinet-mobile-swipe-hint {
        display: flex;
        justify-content: center;
        gap: 8px;
        padding: 8px 0;
        margin-bottom: 10px;
    }

    .cabinet-mobile-swipe-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--cab-border);
        transition: all 0.3s ease;
    }

    .cabinet-mobile-swipe-dot.active {
        background: var(--cab-accent);
        transform: scale(1.2);
    }

    /* Hide desktop newsletter controls on mobile - they'll be in the newsletter tab */
    .cabinet-overlay.active .newsletter-controls {
        display: none !important;
    }

    /* Compact header for mobile */
    .cabinet-header-compact {
        padding: 12px 16px;
        margin-bottom: 12px;
    }

    .cabinet-user-info-mini {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .user-rank-mini {
        font-size: 0.85rem;
        line-height: 1.3;
    }

    /* Newsletter tab specific styles */
    .cabinet-newsletter-tab-content {
        padding: 16px;
        background: white;
        border-radius: 12px;
        border: 1px solid var(--cab-border);
    }

    .newsletter-mobile-header {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 1px solid var(--cab-border);
    }

    .newsletter-mobile-icon {
        font-size: 2.5rem;
    }

    .newsletter-mobile-title {
        font-size: 1.2rem;
        font-weight: 700;
        color: var(--cab-accent);
    }

    .newsletter-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px;
        background: var(--cab-card-bg);
        border-radius: 10px;
        margin-bottom: 15px;
        border: 1px solid var(--cab-border);
    }

    .newsletter-mobile-toggle-label {
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--cab-text);
    }

    .newsletter-mobile-toggle-switch {
        position: relative;
        width: 50px;
        height: 28px;
    }

    .newsletter-mobile-toggle-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

    .newsletter-mobile-toggle-slider {
        position: absolute;
        cursor: pointer;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: #ccc;
        transition: 0.3s;
        border-radius: 28px;
    }

    .newsletter-mobile-toggle-slider:before {
        position: absolute;
        content: "";
        height: 22px;
        width: 22px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        transition: 0.3s;
        border-radius: 50%;
    }

    .newsletter-mobile-toggle-switch input:checked + .newsletter-mobile-toggle-slider {
        background-color: var(--cab-accent);
    }

    .newsletter-mobile-toggle-switch input:checked + .newsletter-mobile-toggle-slider:before {
        transform: translateX(22px);
    }

    /* Chat widget toggle in newsletter tab */
    .chat-widget-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px;
        background: var(--cab-card-bg);
        border-radius: 10px;
        margin-bottom: 15px;
        border: 1px solid var(--cab-border);
    }

    /* Admin button in newsletter tab */
    .newsletter-admin-btn {
        width: 100%;
        padding: 14px;
        background: var(--cab-accent);
        color: white;
        border: none;
        border-radius: 10px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        transition: all 0.2s;
    }

    .newsletter-admin-btn:hover {
        background: var(--cab-accent-hover);
        transform: translateY(-2px);
    }

    /* Touch feedback for tabs */
    .cabinet-mobile-tab {
        -webkit-tap-highlight-color: transparent;
        user-select: none;
    }

    .cabinet-mobile-tab:active {
        transform: scale(0.98);
    }
}

/* Hide mobile tabs on desktop - COMMENTED OUT FOR TESTING */
/* 
@media (min-width: 769px) {
    .cabinet-mobile-tabs-container,
    .cabinet-mobile-content-wrapper,
    .cabinet-mobile-swipe-hint {
        display: none !important;
    }
    
    .cabinet-overlay .newsletter-controls {
        display: flex !important;
    }
}
*/

/* Скрываем плавающий зеленый кружочек чата в мобильном виде */
#chat-floating-widget,
.chat-floating-widget {
    display: none !important;
}

