/* --- Pomodoro (番茄钟) Styles --- */

#pomodoro-screen {
    background: #ffffff;
    color: #333;
    flex-direction: column;
}

#pomodoro-screen .content {
    padding: 15px;
    flex-grow: 1;
    overflow-y: auto;
}

.task-list-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.task-card {
    background: #ffffff;
    border: 1px solid #f5f5f5;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative; /* Establishes stacking context */
    z-index: 2; /* Keep card above delete button */
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.task-card-info {
    flex-grow: 1;
}

.task-card-title {
    font-size: 16px;
    font-weight: 500;
    margin: 0 0 8px 0;
    color: #333;
}

.task-card-details {
    font-size: 14px;
    color: #888;
}

.task-card-start-btn {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    padding: 8px 18px;
    font-weight: 500;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 15px;
    transition: all 0.2s ease;
}

.task-card-start-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Swipe to delete styles for task cards */
.task-card-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.task-card-delete-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 100%;
    background-color: #ef5350; /* Danger color */
    color: white;
    border: none;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1; /* Positioned behind the card */
}

.task-card-wrapper.is-swiped .task-card {
    transform: translateX(-80px);
}

/* Create Task Modal Styles */
#pomodoro-create-modal .modal-window {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#pomodoro-create-modal .form-group {
    margin-bottom: 18px;
}

#pomodoro-create-modal .radio-group-pills {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
}

#pomodoro-create-modal .radio-group-pills label {
    flex: 1;
    text-align: center;
    padding: 10px;
    cursor: pointer;
    background-color: transparent;
    color: #555;
    transition: background-color 0.2s, color 0.2s;
    font-weight: 500;
}

#pomodoro-create-modal .radio-group-pills input[type="radio"] {
    display: none;
}

#pomodoro-create-modal .radio-group-pills input[type="radio"]:checked + label {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(206, 228, 241, 0.5);
}

#pomodoro-duration-options {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, margin-top 0.4s ease-in-out;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#pomodoro-duration-options.visible {
    max-height: 200px;
    margin-top: 15px;
}

#pomodoro-duration-options .duration-pill {
    flex-grow: 1;
    background-color: #f0f0f0;
    border: none;
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s, color 0.2s;
}

#pomodoro-duration-options .duration-pill.active {
    background-color: var(--accent-color);
    color: white;
}

#pomodoro-custom-duration-input {
    width: 100%;
    margin-top: 10px;
    display: none;
}

/* Pomodoro Focus Screen Styles */
#pomodoro-focus-screen {
    background: #ffffff;
    color: var(--text-color);
    flex-direction: column;
}

#pomodoro-focus-screen .app-header {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #eee;
}

#pomodoro-focus-screen .app-header .back-btn,
#pomodoro-focus-screen .app-header .title {
    color: var(--text-color);
    text-shadow: none;
}

#pomodoro-focus-screen .content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    flex-grow: 1;
}

.focus-timer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    text-align: center;
}

.focus-task-title {
    font-size: 22px;
    font-weight: 500;
    color: #555;
    margin: 0 0 25px 0;
}

.focus-timer-display {
    font-size: 80px;
    font-weight: 700;
    line-height: 1;
    color: #333;
}

.focus-timer-mode {
    font-size: 16px;
    color: #888;
    margin-top: 10px;
}

.focus-total-time {
    font-size: 14px;
    color: #aaa;
    margin-top: 15px;
}

.focus-bottom-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 320px;
    padding: 20px 0 calc(20px + env(safe-area-inset-bottom));
    flex-shrink: 0;
}

.focus-controls-group {
    display: flex;
    gap: 20px;
}

.focus-bottom-controls .control-btn {
    background: transparent;
    border: none;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 8px;
    border-radius: 50%;
}

.focus-bottom-controls .control-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.focus-bottom-controls .control-btn svg {
    width: 32px;
    height: 32px;
}

.focus-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.focus-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.focus-message-bubble {
    background-color: #f0f0f0;
    border-radius: 12px;
    padding: 15px 20px;
    width: 90%;
    max-width: 340px;
    margin-bottom: 20px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: center;
    color: #333;
    font-size: 15px;
    opacity: 0;
    transform: translateY(15px) scale(0.95);
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.focus-message-bubble.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
    pointer-events: auto;
}

.focus-message-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #f0f0f0;
}

/* Pomodoro Settings Sidebar Styles */
#pomodoro-settings-sidebar {
    background: rgba(245, 245, 245, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

#pomodoro-settings-sidebar .header {
    color: #333;
    font-weight: 600;
    border-bottom-color: rgba(0,0,0,0.08);
}

#pomodoro-settings-sidebar .form-group label {
    color: #555;
    font-weight: 500;
}

#pomodoro-settings-sidebar .form-group input,
#pomodoro-settings-sidebar .form-group select {
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    font-size: 15px;
}

#pomodoro-settings-sidebar .form-group input:focus,
#pomodoro-settings-sidebar .form-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(206, 228, 241, 0.5);
}

#pomodoro-settings-sidebar hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 25px 0;
}

/* Pomodoro Certificate Styles */
#pomodoro-certificate-modal .modal-window {
    background: linear-gradient(135deg, #fff8f9, #fff0f3);
    border: 1px solid var(--primary-color);
    box-shadow: 0 8px 25px rgba(255, 128, 171, 0.2);
}

#pomodoro-certificate-modal h3 {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 24px;
    color: var(--primary-color);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

#pomodoro-certificate-content {
    border-color: rgba(255, 128, 171, 0.5);
    text-align: left;
    padding: 20px 25px;
}

#pomodoro-certificate-content p {
    font-size: 16px;
    color: #555;
    margin: 10px 0;
    line-height: 1.6;
}

#pomodoro-certificate-content p strong {
    color: var(--secondary-color);
    font-weight: 600;
}

/* Pomodoro Record Card in Chat */
.pomodoro-record-card {
    width: 230px;
    background-color: #fff;
    border: 2px solid #333;
    border-radius: var(--border-radius);
    box-shadow: 4px 4px 0px #ddd;
    padding: 10px;
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0 8px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pomodoro-record-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.pomodoro-record-icon {
    width: 50px;
    height: 50px;
    margin-right: 15px;
    flex-shrink: 0;
}

.pomodoro-record-body .task-name {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    font-family: 'Comic Sans MS', 'Chalkduster', 'Handwriting', cursive;
}

.pomodoro-record-details {
    font-size: 14px;
    color: #555;
    background-color: rgba(240, 240, 240, 0.9);
    padding: 8px 12px;
    margin-top: 10px;
    border-radius: 10px;
    line-height: 1.6;
    display: none;
    animation: fadeIn 0.3s ease;
    white-space: nowrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pomodoro-record-details.active {
    display: flex;
}
