/**
 * Global Pomodoro Widget styles - Refactored for cleaner architecture
 */

.global-pomodoro-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 320px;
    max-width: 90vw;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    z-index: 1000;
    transition: all 0.3s ease;
    font-family: var(--font-family);
}

/* Header */
.pomodoro-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--color-primary);
    color: var(--color-text-on-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pomodoro-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.pomodoro-icon {
    font-size: 1.25rem;
}

.pomodoro-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-on-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pomodoro-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.pomodoro-toggle-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

/* Content */
.pomodoro-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-height: 400px;
    overflow-y: auto;
    transition: all 0.3s ease;
}

/* Timer Section */
.timer-section {
    text-align: center;
}

.timer-display {
    position: relative;
    display: inline-block;
    margin-bottom: 0.75rem;
}

.timer-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 3px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    position: relative;
    background: var(--color-surface);
    transition: border-color 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.timer-circle.active {
    border-color: var(--color-primary);
    box-shadow: 0 0 20px rgba(var(--color-primary-rgb), 0.3);
}

.timer-time {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    z-index: 2;
    position: relative;
}

.progress-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-bg {
    stroke: var(--color-neutral-200);
    fill: none;
}

.progress-fill {
    stroke: var(--color-primary);
    stroke-width: 6;
    fill: none;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

.timer-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-top: 0.5rem;
}

/* Session Info */
.session-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--color-surface-secondary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    gap: 1rem;
}

.session-status {
    flex: 1;
}

.status-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
    transition: color 0.3s ease;
}

.status-text.ready {
    color: var(--color-text-secondary);
}

.status-text.focus-active {
    color: var(--color-primary);
}

.status-text.break-active {
    color: var(--color-success);
}

.status-text.paused {
    color: var(--color-warning);
}

.session-counter {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

/* Habit Section */
.habit-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.habit-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.habit-select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
    cursor: pointer;
}

.habit-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

.habit-select:hover {
    border-color: var(--color-border-hover);
}

/* Controls */
.controls-section {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn {
    padding: 0.625rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-text-on-primary);
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-dark);
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--color-primary);
    color: var(--color-text-on-primary);
}

.btn-danger {
    background: var(--color-error);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: var(--color-error-dark);
}

/* Minimized state */
.global-pomodoro-widget.minimized .pomodoro-content {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    overflow: hidden;
}

.global-pomodoro-widget.minimized .pomodoro-toggle-btn svg {
    transform: rotate(180deg);
}

/* Scrollbar */
.pomodoro-content::-webkit-scrollbar {
    width: 6px;
}

.pomodoro-content::-webkit-scrollbar-track {
    background: transparent;
}

.pomodoro-content::-webkit-scrollbar-thumb {
    background: var(--color-neutral-300);
    border-radius: 3px;
}

.pomodoro-content::-webkit-scrollbar-thumb:hover {
    background: var(--color-neutral-400);
}

/* Responsive */
@media (max-width: 768px) {
    .global-pomodoro-widget {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        width: auto;
        max-width: calc(100vw - 2rem);
    }

    .timer-circle {
        width: 120px;
        height: 120px;
    }

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

    .controls-section {
        flex-direction: column;
        gap: 0.5rem;
    }

    .session-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .global-pomodoro-widget {
        bottom: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
        max-width: calc(100vw - 1rem);
    }

    .pomodoro-content {
        padding: 1rem;
        gap: 1rem;
    }

    .timer-circle {
        width: 100px;
        height: 100px;
    }

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