/* Institutional Polish Styles */

/* Sticky Controls Bar */
.controls-bar {
    position: sticky;
    top: 72px; /* Height of main header approx */
    z-index: 40;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(4, 67, 67, 0.1);
    padding: 0.75rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    transition: top 0.3s ease;
}

/* Reading Progress Bar */
.progress-bar-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 100;
    background: transparent;
    pointer-events: none;
}

.progress-bar {
    height: 100%;
    background: #B48A3E;
    width: 0%;
    transition: width 0.1s linear;
}

/* Search Highlights */
mark {
    background-color: rgba(180, 138, 62, 0.3);
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

mark.current {
    background-color: rgba(180, 138, 62, 0.8);
    color: white;
}

/* Reader Mode Toggles */
.mode-btn {
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid transparent;
    color: #044343;
    opacity: 0.7;
}

.mode-btn:hover {
    background: rgba(4, 67, 67, 0.05);
    opacity: 1;
}

.mode-btn.active {
    background: #044343;
    color: white;
    opacity: 1;
    box-shadow: 0 2px 4px rgba(4, 67, 67, 0.2);
}

/* Search Input */
.search-container {
    position: relative;
    width: 200px;
}

.search-input {
    width: 100%;
    padding: 0.4rem 0.75rem 0.4rem 2rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    font-size: 0.9rem;
    background: #f8fafc;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #044343;
    background: white;
    box-shadow: 0 0 0 2px rgba(4, 67, 67, 0.1);
    width: 250px;
}

.search-icon {
    position: absolute;
    left: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    width: 1rem;
    height: 1rem;
}

/* Copy Link Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #044343;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(150%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.toast.show {
    transform: translateY(0);
}

/* Tools Actions */
.tool-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s;
}

.tool-btn:hover {
    color: #044343;
}

/* Section Controls */
.section-controls {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.accordion-header:hover .section-controls {
    opacity: 1;
}

.control-icon-btn {
    padding: 0.4rem;
    border-radius: 4px;
    color: #94a3b8;
    transition: all 0.2s;
}

.control-icon-btn:hover {
    background: rgba(4, 67, 67, 0.1);
    color: #044343;
}

/* Print Mode */
@media print {
    .controls-bar, header, footer .opacity-70, button .chevron-icon, .section-controls {
        display: none !important;
    }
    
    .accordion-content {
        max-height: none !important;
        display: block !important;
        overflow: visible !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    section {
        border-bottom: 1px solid #ccc !important;
        page-break-inside: avoid;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
    
    .card, .table-container {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}
