/* Routine Focus Mode - Fullscreen Beautiful Design */
.routine-focus-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.routine-focus-mode.hidden {
    display: none;
    opacity: 0;
}

.exit-focus-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.exit-focus-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1) rotate(90deg);
}

.routine-focus-content {
    max-width: 900px;
    width: 90%;
    max-height: 95vh;
    margin: 0 auto;
    padding: 1rem 2rem;
    color: white;
    overflow-y: auto;
}

.routine-focus-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.routine-focus-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.routine-focus-progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.routine-focus-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
    box-shadow: 0 0 20px rgba(79, 172, 254, 0.6);
}

.routine-focus-meta {
    font-size: 1.1rem;
    opacity: 0.9;
}

.routine-focus-meta .separator {
    margin: 0 1rem;
}

.routine-focus-current-task {
    text-align: center;
    margin-bottom: 1.5rem;
}

.task-title-container {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.task-title-container h1 {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: fadeInScale 0.5s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.task-timer-container {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 0 auto;
}

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

.timer-circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 10;
}

.timer-circle-progress {
    fill: none;
    stroke: #4facfe;
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
    filter: drop-shadow(0 0 10px rgba(79, 172, 254, 0.7));
}

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

.time-large {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.time-label {
    display: block;
    font-size: 1rem;
    opacity: 0.8;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.routine-focus-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.routine-queue-preview {
    position: fixed;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 64px;
    min-height: 72px;
    background: rgba(0, 0, 0, 0.2);
    color: white;
    padding: 0.75rem;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, width 0.2s ease, max-height 0.2s ease;
    z-index: 10000;
    overflow: hidden;
    cursor: pointer;
}

.routine-queue-preview.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) translateX(10px);
}

.routine-queue-preview .queue-subtitle,
.routine-queue-preview #routine-queue-list {
    opacity: 0;
    max-height: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, max-height 0.2s ease;
}

.routine-queue-preview:hover,
.routine-queue-preview.expanded {
    width: 280px;
    max-height: 80vh;
    overflow-y: auto;
}

.routine-queue-preview:hover .queue-subtitle,
.routine-queue-preview:hover #routine-queue-list,
.routine-queue-preview.expanded .queue-subtitle,
.routine-queue-preview.expanded #routine-queue-list {
    opacity: 1;
    max-height: 60vh;
    pointer-events: auto;
}

.routine-queue-header {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.queue-header-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
}

.queue-title {
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.queue-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.queue-subtitle {
    font-size: 0.85rem;
    opacity: 0.85;
}

#routine-queue-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .routine-queue-preview {
        right: 0.75rem;
        top: auto;
        bottom: 1rem;
        transform: none;
        width: 56px;
        padding: 0.65rem;
        max-height: 56px;
    }

    .routine-queue-preview:hover,
    .routine-queue-preview.expanded {
        width: min(85vw, 320px);
        max-height: 70vh;
        right: 0.75rem;
        bottom: 1rem;
        transform: none;
    }
}

.queue-item {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    font-weight: 600;
    cursor: grab;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    user-select: none;
}

.queue-item:hover {
    background: rgba(255, 255, 255, 0.14);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.queue-item.dragging {
    opacity: 0.75;
    cursor: grabbing;
    transform: scale(1.02);
}

.queue-drop-indicator {
    border: 2px dashed rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    padding: 0.5rem;
    text-align: center;
    color: white;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.08);
    transition: height 0.2s ease, margin 0.2s ease;
    height: 44px;
}

.focus-action-btn {
    padding: 1.25rem 3rem;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.focus-action-btn i {
    font-size: 1.4rem;
}

.focus-action-btn.primary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.focus-action-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(79, 172, 254, 0.5);
}

.focus-action-btn.secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.focus-action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
}

.routine-focus-task-list {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1rem;
    max-height: 150px;
    overflow-y: auto;
}

.routine-focus-task-list h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.routine-focus-task-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.routine-focus-task-list li {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.routine-focus-task-list li:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.routine-focus-task-list li.completed {
    opacity: 0.5;
    text-decoration: line-through;
}

.routine-focus-task-list li .task-duration {
    opacity: 0.7;
    font-size: 0.9rem;
}

/* Custom scrollbar for task list */
.routine-focus-task-list::-webkit-scrollbar {
    width: 8px;
}

.routine-focus-task-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.routine-focus-task-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.routine-focus-task-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .task-title-container h1 {
        font-size: 2.5rem;
    }

    .task-timer-container {
        width: 250px;
        height: 250px;
    }

    .time-large {
        font-size: 3rem;
    }

    .focus-action-btn {
        padding: 1rem 2rem;
        font-size: 1rem;
    }

    .routine-focus-actions {
        flex-direction: column;
        gap: 1rem;
    }

    .focus-action-btn {
        width: 100%;
        justify-content: center;
    }
}