/* ============================================
   INFO OFFCANVAS
   Additional offcanvas for information/widgets
   Desktop only, appears after theme toggle
   ============================================ */

/* Info Button - Normal navbar element */
.info-offcanvas-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.info-offcanvas-toggle:hover {
    color: var(--accent-color);
}

/* Hide info button when desktop nav is offcanvas */
body.desktop-nav-offcanvas .info-offcanvas-toggle,
body.desktop-nav-offcanvas-left .info-offcanvas-toggle,
body.desktop-nav-offcanvas-right .info-offcanvas-toggle {
    display: none;
}

.info-offcanvas-toggle:hover {
    color: var(--accent-color);
}

.info-offcanvas-toggle-icon {
    width: 24px;
    height: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.info-offcanvas-toggle-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background: currentColor;
    transition: all 0.3s ease;
}

.info-offcanvas-toggle.active .info-offcanvas-toggle-icon span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.info-offcanvas-toggle.active .info-offcanvas-toggle-icon span:nth-child(2) {
    opacity: 0;
}

.info-offcanvas-toggle.active .info-offcanvas-toggle-icon span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

.info-offcanvas-toggle-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Info Offcanvas Panel */
.info-offcanvas {
    position: fixed;
    top: 0;
    right: 0;
    width: 350px; /* Default, wird via inline CSS überschrieben */
    height: 100%;
    background: var(--bg-primary);
    border-left: 1px solid var(--border-color);
    z-index: 9998;
    overflow-y: auto;
    transform: translateX(100%); /* Komplett nach rechts schieben */
    transition: transform 0.4s ease;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}

.info-offcanvas.active {
    transform: translateX(0); /* Einfahren */
}

.info-offcanvas-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 10;
}

.info-offcanvas-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.info-offcanvas-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease, transform 0.3s ease;
}

.info-offcanvas-close:hover {
    background: var(--bg-secondary);
    transform: rotate(90deg);
}

.info-offcanvas-content {
    padding: 2rem;
}

.info-offcanvas-content .info-widget {
    margin-bottom: 2rem;
}

.info-offcanvas-content .info-widget:last-child {
    margin-bottom: 0;
}

.info-offcanvas-content .widget-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Overlay Background */
.info-offcanvas-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9997;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.info-offcanvas-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Prevent body scroll when info offcanvas is open */
body.info-offcanvas-open {
    overflow: hidden;
}

/* Hide on mobile */
@media (max-width: 1024px) {
    .info-offcanvas-toggle,
    .info-offcanvas,
    .info-offcanvas-overlay {
        display: none !important;
    }
}

/* Tablet adjustment */
@media (max-width: 768px) {
    .info-offcanvas {
        width: 100%;
        right: -100%;
    }
}

/* Dark Mode */
[data-theme="dark"] .info-offcanvas {
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
}
