/* ===================================================
   Card Toolbar - hover-reveal toolbar for card widgets
   =================================================== */

/* Container: makes the card a positioning context */
.card-toolbar-container {
    position: relative;
}

/* Toolbar: hidden by default, top-right corner */
.card-toolbar {
    position: absolute;
    top: 4px;
    right: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
    display: flex;
    gap: 4px;
    align-items: center;
}

/* Reveal on card hover */
.card-toolbar-container:hover .card-toolbar,
.card-toolbar-container .card-toolbar:focus-within {
    opacity: 1;
}

/* Always show toolbar when card is expanded */
.card-expanded .card-toolbar {
    opacity: 1;
}

/* Toolbar buttons: small, subtle, native-feeling */
.card-toolbar button {
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.card-toolbar button:hover,
.card-toolbar button:focus-visible {
    color: #333;
    background-color: rgba(0, 0, 0, 0.06);
    outline: none;
}

.card-toolbar button:active {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Dropdown menu styling */
.card-toolbar .dropdown-menu {
    font-size: 0.8125rem;
    min-width: 180px;
    padding: 4px 0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.card-toolbar .dropdown-menu .dropdown-item {
    padding: 6px 14px;
    font-size: 0.8125rem;
}

.card-toolbar .dropdown-menu .dropdown-header {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #999;
    padding: 6px 14px 2px;
}

.card-toolbar .dropdown-menu .dropdown-divider {
    margin: 4px 0;
}

/* ===================================================
   Fullscreen expanded card
   =================================================== */
.card-expanded {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    overflow: auto;
    background: #fff;
    transition: none;
}

.card-expanded .card-body {
    max-height: calc(100vh - 60px);
    overflow: auto;
}

/* Backdrop overlay behind expanded card */
.card-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
}

/* ===================================================
   Dark mode support
   =================================================== */
[data-theme="dark"] .card-toolbar button {
    color: #8a8fa0;
}

[data-theme="dark"] .card-toolbar button:hover,
[data-theme="dark"] .card-toolbar button:focus-visible {
    color: #e0e0e0;
    background-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .card-toolbar button:active {
    background-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .card-expanded {
    background: #1a1a2e;
}

[data-theme="dark"] .card-backdrop {
    background: rgba(0, 0, 0, 0.65);
}

[data-theme="dark"] .card-toolbar .dropdown-menu {
    background-color: #1e1e30;
    border-color: #2a2a40;
}

[data-theme="dark"] .card-toolbar .dropdown-menu .dropdown-item {
    color: #c8c8d8;
}

[data-theme="dark"] .card-toolbar .dropdown-menu .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.06);
}
