/* Power Blocks Timer Styles */

/* --- Main Layout --- */
.power-blocks-container {
    /* Remove constraining layout that affects whole page */
    /* Layout is now handled by individual sections */
}

/* --- Tool Card Wrapper --- */
#power-blocks-tool {
    max-width: 640px;
    margin: 2rem auto 3rem;
    padding: 2rem;
    background: var(--clr-surface, #ffffff);
    border: 1px solid var(--clr-border, #e5e7eb);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: background-color 0.5s ease;
}

/* Subtle state header stripe */
#power-blocks-tool[data-state="work"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff9800 0%, #ffb74d 100%);
    border-radius: 12px 12px 0 0;
}

#power-blocks-tool[data-state="break"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2196f3 0%, #64b5f6 100%);
    border-radius: 12px 12px 0 0;
}

#power-blocks-tool[data-state="long-break"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4caf50 0%, #81c784 100%);
    border-radius: 12px 12px 0 0;
}

#power-blocks-tool {
    position: relative;
}

/* --- State & Timer Display --- */
.state-display {
    text-align: center;
    margin-bottom: 2rem;
}

.state-label {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--clr-primary);
    margin-bottom: 0.5rem;
}

.cycle-info {
    display: block;
    color: var(--clr-ink-muted);
    font-size: 0.95rem;
}

/* Timer display (reusing visual timer styles) */
.timer-display {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 2rem auto;
}

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

.timer-ring-bg {
    fill: none;
    stroke: rgba(0, 0, 0, 0.1);
    stroke-width: 8;
}

.timer-ring-progress {
    fill: none;
    stroke: var(--clr-primary);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 565.48;  /* 2 * PI * 90 */
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.timer-time {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--clr-ink);
}

.timer-type {
    font-size: 0.95rem;
    color: var(--clr-ink-muted);
    margin-top: 0.25rem;
}

.timer-display.paused {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* --- Controls & Settings --- */
.timer-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

.block-settings {
    text-align: center;
    margin: 2rem 0;
}

.settings-panel {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--clr-surface);
    border-radius: 8px;
}

.settings-panel label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.settings-panel input {
    width: 50px;
    padding: 0.25rem;
    border: 1px solid var(--clr-border);
    border-radius: 4px;
}

.stats-display {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem;
    background: var(--clr-surface);
    border-radius: 8px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--clr-ink-muted);
    margin-bottom: 0.25rem;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--clr-primary);
}

/* Notifications */
.block-notification {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.75rem 1.5rem;
    background: var(--clr-success);
    color: white;
    border-radius: 20px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

.transition-warning {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background: var(--clr-warning, #fbbf24);
    color: var(--clr-ink);
    border-radius: 20px;
    font-size: 0.9rem;
    animation: slideUp 0.3s ease;
}

@keyframes slideDown {
    from { transform: translateX(-50%) translateY(-20px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateX(-50%) translateY(20px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* --- State-based Colors --- */
/* State backgrounds removed from container - now only on tool card as header stripe */

/* Different progress ring colors for different states */
#power-blocks-tool[data-state="work"] .timer-ring-progress {
    stroke: #ff9800;
}

#power-blocks-tool[data-state="break"] .timer-ring-progress {
    stroke: #2196f3;
}

#power-blocks-tool[data-state="long-break"] .timer-ring-progress {
    stroke: #4caf50;
}

/* Ensure content section stays neutral */
.tool-content-section {
    background: transparent;
    color: var(--clr-ink);
    padding: 0;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    #power-blocks-tool {
        margin: 1.5rem 1rem 2.5rem;
        padding: 1.5rem;
    }

    .timer-display {
        width: 180px;
        height: 180px;
    }

    .timer-time {
        font-size: 2rem;
    }

    .settings-panel {
        flex-direction: column;
    }

    .stats-display {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    #power-blocks-tool {
        margin: 1rem 0.5rem 2rem;
        padding: 1.25rem;
    }

    .timer-controls {
        flex-wrap: wrap;
    }

    .tool-button {
        min-width: 100px;
    }
}