/* Apteczka Skupienia - Ultra Minimal Collapsible Design */

.apteczka-widget,
.apteczka-widget * {
    box-sizing: border-box;
}

:where(.wp-block-shortcode, .wp-block-group, .wp-block-columns, .wp-block-column, .wp-block-html, .entry-content, .entry-content > div, p) > .apteczka-widget {
    margin: 0 auto 1.5rem !important;
}

:where(.wp-block-shortcode, .wp-block-group, .wp-block-columns, .wp-block-column, .wp-block-html, .entry-content, .entry-content > div, p) > .apteczka-widget:last-child {
    margin-bottom: 0 !important;
}

.apteczka-widget {
    max-width: 280px;
    width: 100%;
    margin: 0 auto 1.5rem;
    font-family: inherit;
    color: #2a2a2a;
}

.apteczka-widget:last-child {
    margin-bottom: 0;
}

/* Collapsed state - tiny box */
.apteczka-collapsed {
    text-align: center;
    width: 100%;
}

.apteczka-toggle {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    color: #2a2a2a;
    padding: 0.8rem 0.6rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 3rem;
    line-height: 1;
    gap: 0.3rem;
    white-space: nowrap;
}

.apteczka-toggle:hover {
    background: #ffffff;
    border-color: #c5c5c5;
    box-shadow: 0 0 0 2px rgba(197, 197, 197, 0.35);
}

/* Expanded state */
.apteczka-expanded {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    padding: 0.4rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: stretch;
    position: relative;
}

.apteczka-expanded.visible {
    opacity: 1;
    transform: translateY(0);
    margin-top: 0.4rem;
}

.apteczka-header {
    position: relative;
    text-align: center;
}

.apteczka-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: #2a2a2a;
    font-family: inherit;
}

.apteczka-close {
    position: absolute;
    top: -0.2rem;
    right: -0.2rem;
    background: none;
    border: none;
    color: #666666;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.2rem;
    line-height: 1;
    z-index: 2;
}

.apteczka-close:hover {
    color: #2a2a2a;
}

.apteczka-controls {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: center;
}

.problem-text {
    font-size: 0.75rem;
    font-weight: 400;
    color: #666666;
    text-align: center;
    font-family: inherit;
    line-height: 1.3;
}

/* WZORZEC DESIGNU - Szerokość przycisków */
/* Wszystkie główne przyciski w widget'cie powinny mieć jednakową szerokość */
/* Kontener: width: 100%, przycisk: width: 100% */
.favorites-button-section {
    width: 100%;
}

.apteczka-button {
    background: #466DD8;
    border: 1px solid #466DD8;
    color: #ffffff;
    padding: 0.4rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70%;
    min-width: 200px;
    max-width: 320px;
    gap: 0.2rem;
    margin: 0.4rem auto;
    border-radius: 5px;
}

.apteczka-button:hover {
    background: #3758b4;
    border-color: #3758b4;
}





.apteczka-button.small {
    padding: 0.4rem;
    font-size: 0.75rem;
    width: calc(70% - 10px);
    min-width: 180px;
    max-width: 310px;
}

.tip-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    padding: 0.4rem;
    margin: 0.4rem auto;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    width: 70%;
    min-width: 200px;
    max-width: 320px;
}

.tip-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.tip-content {
}

.tip-content h4 {
    margin: 0 0 0.2rem 0;
    font-size: 0.85rem;
    font-weight: 500;
    color: #2a2a2a;
    font-family: inherit;
}

.tip-content p,
.tip-content .tip-text {
    margin: 0 0 0.2rem 0;
    font-size: 0.8rem;
    line-height: 1.3;
    color: #2a2a2a;
    font-family: inherit;
}

.tip-time {
    font-size: 0.7rem;
    color: #666666;
    font-style: italic;
}

.tip-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: center;
}

.save-icon {
    margin-right: 0.2rem;
}

.favorites-section {
    border-top: 1px solid #e0e0e0;
    padding-top: 0.4rem;
    margin-top: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: center;
}

.favorites-section h4 {
    margin: 0 0 0.4rem 0;
    font-size: 0.85rem;
    font-weight: 500;
    color: #2a2a2a;
    text-align: center;
    font-family: inherit;
}

.favorite-item {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    padding: 0.4rem;
    margin: 0.4rem auto;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    width: 70%;
    min-width: 200px;
    max-width: 320px;
}

.favorite-item h5 {
    margin: 0 0 0.2rem 0;
    font-size: 0.8rem;
    font-weight: 500;
    color: #2a2a2a;
    font-family: inherit;
}

.favorite-item p {
    margin: 0 0 0.2rem 0;
    font-size: 0.75rem;
    line-height: 1.2;
    color: #2a2a2a;
    font-family: inherit;
}

.favorite-time {
    font-size: 0.65rem;
    color: #666666;
    font-style: italic;
}

.remove-favorite {
    position: absolute;
    top: 0.2rem;
    right: 0.2rem;
    background: none;
    border: none;
    color: #666666;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.1rem;
}

.remove-favorite:hover {
    color: #2a2a2a;
}

.empty-favorites {
    text-align: center;
    padding: 0.4rem;
    color: #666666;
    font-size: 0.75rem;
    line-height: 1.3;
}

.apteczka-message {
    padding: 0.4rem;
    margin: 0.4rem 0;
    font-size: 0.75rem;
    font-weight: 400;
    text-align: left;
}

.apteczka-message.success {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    color: #2a2a2a;
}

.apteczka-message.error {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    color: #666666;
}

.hidden {
    display: none;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .apteczka-widget {
        max-width: 260px;
        padding: 0.4rem;
    }
    
    .tip-actions {
        flex-direction: column;
        gap: 0.2rem;
    }
    
    .apteczka-button {
        padding: 0.4rem;
        font-size: 0.8rem;
    }
}

/* Loading state */
.apteczka-button.loading {
    opacity: 0.7;
    pointer-events: none;
}

.apteczka-button.loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: apteczka-spin 0.8s linear infinite;
    margin-left: 0.5rem;
}

@keyframes apteczka-spin {
    to { transform: rotate(360deg); }
}
