/**
 * BottomActionBar Component Styles
 *
 * Uses CSS variables from themes.css for automatic light/dark theme support
 *
 * Features:
 * - Navigation buttons: round, icon-only (like tracker)
 * - Action buttons: rectangular with text (primary/secondary)
 * - Three zones: left, center, right
 * - Smooth animations
 * - Responsive design
 */

/* === CONTAINER === */
.bottom-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;

    background-color: var(--bg-secondary);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-primary);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);

    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;

    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.bottom-action-bar.show {
    transform: translateY(0);
}

/* === BUTTON GROUPS === */
.bottom-action-bar-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.bottom-action-bar-left {
    justify-content: flex-start;
    flex: 1;
}

.bottom-action-bar-center {
    justify-content: center;
    flex: 0 1 auto;
}

.bottom-action-bar-right {
    justify-content: flex-end;
    flex: 1;
}

/* === BASE BUTTON STYLES === */
.bottom-action-bar-btn {
    position: relative; /* Required for data-tooltip CSS */
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
    outline: none;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bottom-action-bar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.bottom-action-bar-btn .material-icons {
    font-size: 20px;
}

/* === NAVIGATION BUTTON (круглая, только иконка) === */
.bottom-action-bar-nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    padding: 0;

    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bottom-action-bar-nav-btn:hover:not(:disabled) {
    background-color: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.bottom-action-bar-nav-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bottom-action-bar-nav-btn .material-icons {
    font-size: 22px;
}

/* === ACTION BUTTON (прямоугольная с текстом) === */
.bottom-action-bar-action-btn {
    height: 38px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Secondary action button */
.bottom-action-bar-action-btn.secondary {
    background-color: transparent;
    border: 1px solid var(--border-secondary);
    color: var(--text-primary);
}

.bottom-action-bar-action-btn.secondary:hover:not(:disabled) {
    background-color: var(--bg-tertiary);
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Primary action button */
.bottom-action-bar-action-btn.primary {
    background-color: var(--brand-primary);
    border: 1px solid var(--brand-primary);
    color: var(--text-inverse);
}

.bottom-action-bar-action-btn.primary:hover:not(:disabled) {
    background-color: var(--brand-primary-hover);
    border-color: var(--brand-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.bottom-action-bar-action-btn:active:not(:disabled) {
    transform: translateY(0);
}

/* === BODY PADDING WHEN VISIBLE === */
body.has-bottom-action-bar {
    padding-bottom: 70px;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
    .bottom-action-bar {
        padding: 10px 12px;
        gap: 12px;
    }

    .bottom-action-bar-group {
        gap: 8px;
    }

    /* Hide text on small screens, keep icons */
    .bottom-action-bar-action-btn .btn-text {
        display: none;
    }

    .bottom-action-bar-action-btn {
        padding: 8px 12px;
        min-width: auto;
    }

    /* Make navigation buttons slightly smaller on mobile */
    .bottom-action-bar-nav-btn {
        width: 40px;
        height: 40px;
    }

    .bottom-action-bar-nav-btn .material-icons {
        font-size: 20px;
    }

    /* Adjust body padding for mobile */
    body.has-bottom-action-bar {
        padding-bottom: 65px;
    }
}

@media (max-width: 480px) {
    .bottom-action-bar {
        padding: 8px 10px;
        gap: 10px;
    }

    .bottom-action-bar-group {
        gap: 6px;
    }

    /* Even smaller navigation buttons on very small screens */
    .bottom-action-bar-nav-btn {
        width: 38px;
        height: 38px;
    }

    body.has-bottom-action-bar {
        padding-bottom: 60px;
    }
}

/* === DARK THEME ADJUSTMENTS === */
/* Remove border in dark theme, keep shadow for depth */
[data-theme='dark'] .bottom-action-bar {
    border-top: none;
}

[data-theme='dark'] .bottom-action-bar-nav-btn {
    box-shadow: none;
}

[data-theme='dark'] .bottom-action-bar-action-btn {
    box-shadow: none;
}

[data-theme='dark'] .bottom-action-bar-nav-btn:hover:not(:disabled),
[data-theme='dark'] .bottom-action-bar-action-btn:hover:not(:disabled) {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
