/* Ćwiczenia Oddechowe - Ultra Minimal Design (Based on Bubble Wrap & Apteczka Style) */

.oddychanie-widget,
.oddychanie-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) > .oddychanie-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) > .oddychanie-widget:last-child {
    margin-bottom: 0 !important;
}

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

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

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

.oddychanie-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;
    border-radius: 0;
    gap: 0.3rem;
    white-space: nowrap;
}

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

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

.oddychanie-widget.expanded .oddychanie-collapsed {
    display: none;
}

.oddychanie-widget.expanded .oddychanie-expanded {
    display: flex;
    opacity: 1;
    transform: translateY(0);
    margin-top: 0.4rem;
}

/* Header */
.oddychanie-header {
    position: relative;
    text-align: center;
}

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

.oddychanie-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;
}

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

/* Controls section */
.oddychanie-controls {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: stretch;
}

.technique-selector {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.technique-selector label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #2a2a2a;
    text-align: center;
}

.technique-select {
    font-size: 0.8rem;
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
    background: #ffffff;
    color: #2a2a2a;
    font-family: inherit;
    cursor: pointer;
    border-radius: 0;
    transition: border-color 0.15s ease;
}

.technique-select:hover {
    border-color: #c5c5c5;
}

.technique-select:focus {
    outline: none;
    border-color: #466DD8;
    box-shadow: 0 0 0 2px rgba(70, 109, 216, 0.2);
}

.technique-description {
    font-size: 0.7rem;
    color: #666666;
    text-align: center;
    line-height: 1.4;
    padding: 0.4rem;
    background: #f8f8f8;
    border-radius: 3px;
    min-height: 2.5rem;
}

/* Visualization - Breathing Circle */
.oddychanie-visualization {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.6rem 0;
}

.breath-circle {
    position: relative;
    width: 160px;
    height: 160px;
}

.progress-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: none;
    stroke: #f0f0f0;
    stroke-width: 4;
}

.progress-ring-fill {
    fill: #FFC107;
    opacity: 0;
    transition: opacity 0.3s ease, height 0.3s ease, y 0.3s ease;
}

.progress-ring-circle {
    fill: none;
    stroke: #466DD8;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 534;
    stroke-dashoffset: 534;
}

/* Breathing states */
.oddychanie-widget.breathing-inhale .progress-ring-circle {
    stroke: #4CAF50;
}

.oddychanie-widget.breathing-inhale .progress-ring-fill {
    opacity: 0;
}

.oddychanie-widget.breathing-hold .progress-ring-circle {
    stroke: transparent;
}

.oddychanie-widget.breathing-hold .progress-ring-fill {
    opacity: 0;
}

.oddychanie-widget.breathing-exhale .progress-ring-circle {
    stroke: #2196F3;
}

.oddychanie-widget.breathing-exhale .progress-ring-fill {
    opacity: 0;
}

@keyframes underlineGrow {
    from { width: 0; }
    to { width: 100%; }
}

/* Instruction in center of circle */
.oddychanie-widget .oddychanie-breath-instruction {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    text-align: center;
    pointer-events: none;
}

.oddychanie-widget .oddychanie-instruction-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2a2a2a;
    transition: color 0.3s ease;
    position: relative;
    padding-bottom: 0.2rem;
    margin: 0;
    line-height: 1.2;
}

.oddychanie-widget.breathing-inhale .oddychanie-instruction-text {
    color: #4CAF50;
}

.oddychanie-widget.breathing-exhale .oddychanie-instruction-text {
    color: #2196F3;
}

.oddychanie-widget.breathing-hold .oddychanie-instruction-text {
    color: #FFC107;
}

.oddychanie-widget.breathing-hold .oddychanie-instruction-text::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background-color: #FFC107;
    animation: underlineGrow var(--breath-duration) ease-in-out forwards;
}

.oddychanie-widget .oddychanie-instruction-count {
    font-size: 0.75rem;
    color: #666666;
    margin: 0;
    line-height: 1;
}

/* Stats display */
.oddychanie-stats {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.75rem;
    color: #666666;
    text-align: center;
    padding: 0.4rem;
}

.oddychanie-stats span {
    white-space: nowrap;
}

.oddychanie-stats strong {
    color: #2a2a2a;
    font-weight: 600;
}

/* Buttons section */
.oddychanie-buttons {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    justify-content: center;
}

.oddychanie-button {
    background: #466DD8;
    border: 1px solid #466DD8;
    color: #ffffff;
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    border-radius: 5px;
    transition: background-color 0.15s ease;
    flex: 1;
    min-width: 70px;
}

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

.oddychanie-button.primary {
    background: #4CAF50;
    border-color: #4CAF50;
}

.oddychanie-button.primary:hover {
    background: #45a049;
    border-color: #45a049;
}

.oddychanie-button.small {
    flex: 0;
    min-width: auto;
    padding: 0.4rem 0.5rem;
}

.oddychanie-button.small span {
    font-size: 0.75rem;
    line-height: 0.75rem;
    display: inline-block;
}

.oddychanie-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Footer */
.oddychanie-footer {
    padding-top: 0.4rem;
    border-top: 1px solid #e0e0e0;
    margin-top: 0.2rem;
}

.oddychanie-tip {
    margin: 0;
    font-size: 0.7rem;
    color: #666666;
    font-style: italic;
    text-align: center;
    line-height: 1.3;
}

/* Hidden state */
.hidden {
    display: none !important;
}

/* Mobile column - always expanded */
.mobile-column-content .oddychanie-widget {
    /* Widget always expanded in mobile */
}

.mobile-column-content .oddychanie-expanded {
    display: flex !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.mobile-column-content .oddychanie-collapsed {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 480px) {
    .oddychanie-widget {
        max-width: 260px;
    }

    .breath-circle {
        width: 140px;
        height: 140px;
    }

    .oddychanie-buttons {
        flex-direction: row;
    }

    .oddychanie-button {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
    }
}

/* Animation for completing a cycle */
@keyframes celebration {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

.oddychanie-widget.cycle-complete .oddychanie-breath-instruction {
    animation: celebration 0.5s ease-in-out;
}
