:root {
    --font-primary: 'Inter', sans-serif;
    --color-bg: #ffffff;
    --color-text-main: #202124;
    --color-text-secondary: #5f6368;
    --color-primary: #1a73e8;
    --color-primary-hover: #1557b0;
    --color-surface: #ffffff;
    --color-border: #dadce0;
    --shadow-sm: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-md: 12px;
    --radius-lg: 24px;
    --transition-fast: 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
    color: var(--color-text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Clean subtle background */
.background-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: linear-gradient(135deg, #e3f2fd 0%, #f5f5f5 100%);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: -1;
}

/* Main Container */
.app-container {
    width: 100%;
    max-width: 600px;
    margin: 60px auto;
    padding: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(255, 255, 255, 0.5);
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.logo-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.logo-icon {
    font-size: 32px;
    color: var(--color-primary);
}

h1 {
    font-weight: 600;
    font-size: 28px;
    letter-spacing: -0.5px;
    color: var(--color-text-main);
}

.subtitle {
    color: var(--color-text-secondary);
    font-size: 15px;
    line-height: 1.5;
}

/* Notification Button */
.header-buttons {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 12px;
    align-items: center;
}

.header-btn {
    background: white;
    border: 2px solid var(--color-border);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.header-btn:hover {
    background: #f8f9fa;
    border-color: var(--color-primary);
    transform: scale(1.05);
}

.header-btn .material-symbols-rounded {
    font-size: 24px;
    color: var(--color-text-secondary);
}

.header-btn:hover .material-symbols-rounded {
    color: var(--color-primary);
}

/* Backup Button & Menu */
.backup-wrapper {
    position: relative;
}

.backup-wrapper.header-left {
    position: absolute;
    top: 0;
    left: 0;
}

.backup-menu {
    position: absolute;
    top: 56px;
    left: 0;
    /* Changed from right: 0 to left: 0 for left-side positioning */
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
    min-width: 180px;
    overflow: hidden;
    z-index: 100;
    animation: slideDown 0.2s ease;
}

.backup-menu-item {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: white;
    color: var(--color-text-main);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
    text-align: left;
    font-family: var(--font-primary);
}

.backup-menu-item:hover {
    background: #f8f9fa;
}

.backup-menu-item .material-symbols-rounded {
    font-size: 20px;
    color: var(--color-text-secondary);
}

.backup-menu-item:hover .material-symbols-rounded {
    color: var(--color-primary);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ea4335;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    display: none;
}

.notification-badge.active {
    display: block;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Notification Panel */
.notification-panel {
    position: absolute;
    top: 60px;
    right: 0;
    width: 320px;
    max-height: 400px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
    z-index: 100;
    overflow: hidden;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--color-border);
    background: #f8f9fa;
}

.notification-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--color-text-main);
}

.close-notification {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.close-notification:hover {
    background: #e8eaed;
}

.close-notification .material-symbols-rounded {
    font-size: 20px;
    color: var(--color-text-secondary);
}

.notification-content {
    max-height: 340px;
    overflow-y: auto;
}

.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f3f4;
    cursor: pointer;
    transition: background 0.2s;
}

.notification-item:hover {
    background: #f8f9fa;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-topic {
    font-weight: 600;
    font-size: 14px;
    color: var(--color-text-main);
    margin-bottom: 4px;
}

.notification-date {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
}

.notification-status {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.notification-status.overdue {
    background: #fce8e6;
    color: #c5221f;
}

.notification-status.today {
    background: #e8f0fe;
    color: #1967d2;
}

.notification-empty {
    padding: 40px 16px;
    text-align: center;
    color: var(--color-text-secondary);
}

.notification-empty .material-symbols-rounded {
    font-size: 48px;
    color: #dadce0;
    margin-bottom: 8px;
}

/* Input Section */
.input-section {
    margin-bottom: 30px;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

input[type="text"] {
    width: 100%;
    padding: 16px 16px;
    font-size: 16px;
    font-family: var(--font-primary);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    background: transparent;
    transition: var(--transition-fast);
    outline: none;
    color: var(--color-text-main);
}

input[type="text"]:focus {
    border-color: var(--color-primary);
}

label {
    position: absolute;
    left: 14px;
    top: 18px;
    color: var(--color-text-secondary);
    font-size: 16px;
    pointer-events: none;
    transition: 0.2s ease all;
    background: transparent;
    padding: 0 4px;
}

/* Floating Label Logic */
input[type="text"]:focus~label,
input[type="text"]:not(:placeholder-shown)~label {
    top: -10px;
    font-size: 12px;
    color: var(--color-primary);
    background: var(--color-surface);
    font-weight: 500;
}

/* Button Group */
.button-group {
    display: flex;
    gap: 12px;
}

.primary-btn {
    flex: 1;
    padding: 16px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: var(--transition-fast);
    box-shadow: 0 2px 4px rgba(26, 115, 232, 0.2);
}

.primary-btn:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(26, 115, 232, 0.3);
}

.primary-btn:active {
    transform: translateY(0);
}

.icon-btn {
    width: 56px;
    /* Matches height of primary btn roughly */
    background: white;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition-fast);
}

.icon-btn:hover {
    background: #f8f9fa;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

/* Preview Section */
.preview-section {
    display: none;
    /* Hidden by default */
    margin-top: 40px;
    border-top: 1px solid var(--color-border);
    padding-top: 30px;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 20px;
}

.schedule-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.schedule-meta {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.timeline {
    position: relative;
    padding-left: 20px;
    margin-bottom: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background: var(--color-border);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
    padding-left: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -25px;
    /* Adjust based on padding-left of timeline */
    top: 6px;
    width: 12px;
    height: 12px;
    background: var(--color-surface);
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    z-index: 2;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.t-date {
    font-weight: 600;
    font-size: 15px;
    color: var(--color-text-main);
    margin-bottom: 4px;
}

.t-info {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.secondary-btn {
    width: 100%;
    padding: 14px;
    background: white;
    color: var(--color-text-main);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: var(--transition-fast);
}

.secondary-btn:hover {
    background: #f8f9fa;
    border-color: #dadce0;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 20px;
    color: var(--color-text-secondary);
    font-size: 12px;
    margin-top: auto;
    position: relative;
    z-index: 1;
}

/* Responsive */
@media (max-width: 640px) {
    .app-container {
        margin: 0;
        min-height: 100vh;
        border-radius: 0;
        border: none;
        box-shadow: none;
    }
}

/* Git Tree Styles */
.git-section {
    margin-top: 40px;
    border-top: 1px solid var(--color-border);
    padding-top: 30px;
    animation: fadeIn 0.4s ease;
}

.git-tree {
    position: relative;
    padding-left: 30px;
    margin-top: 20px;
}

/* The main vertical line */
.git-tree::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e1e4e8;
    z-index: 0;
}

.git-commit {
    position: relative;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

/* The dot (commit node) */
.git-commit::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 6px;
    width: 10px;
    height: 10px;
    background: #fff;
    border: 3px solid var(--color-primary);
    border-radius: 50%;
    z-index: 1;
    transition: transform 0.2s ease;
}

.git-commit:hover::before {
    transform: scale(1.2);
    background: var(--color-primary);
}

/* Different colors for different topics (simulated with nth-child for now, or JS classes) */
.git-commit.branch-a::before {
    border-color: #fbbc04;
}

/* Yellow */
.git-commit.branch-b::before {
    border-color: #ea4335;
}

/* Red */
.git-commit.branch-c::before {
    border-color: #34a853;
}

/* Green */

.commit-card {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 12px 16px;
    width: 100%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
}

.commit-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.commit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.commit-topic {
    font-weight: 600;
    font-size: 14px;
    color: var(--color-text-main);
}

.commit-date {
    font-size: 12px;
    color: var(--color-text-secondary);
    font-family: monospace;
    background: #f1f3f4;
    padding: 2px 6px;
    border-radius: 4px;
}

.commit-message {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.actions {
    display: flex;
    gap: 10px;
}

.actions .secondary-btn {
    flex: 1;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
}

.status-past {
    background-color: #e8f0fe;
    color: #1967d2;
}

.status-today {
    background-color: #fce8e6;
    color: #c5221f;
    font-weight: 700;
}

.status-upcoming {
    background-color: #f1f3f4;
    color: #5f6368;
}

.t-status {
    margin-top: 4px;
}

/* Timeline Checkbox & Layout */
.timeline-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    /* Override previous padding since we use flex gap now */
    padding-left: 0;
    cursor: pointer;
    /* Show pointer for whole row */
    padding: 8px;
    /* Add some padding for hover target */
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.timeline-item:hover {
    background-color: #f8f9fa;
}

/* Adjust the dot position since we changed layout */
.timeline-item::before {
    left: -21px;
    /* Adjusted for padding */
    top: 14px;
    /* Adjusted for padding */
}

.checkbox-wrapper {
    display: block;
    position: relative;
    padding-left: 24px;
    margin-bottom: 0;
    cursor: pointer;
    font-size: 22px;
    user-select: none;
    flex-shrink: 0;
    margin-top: 2px;
    z-index: 5;
    /* Ensure it's above other elements */
}

.checkbox-wrapper input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 25px;
    /* Make it clickable */
    width: 100%;
    /* Cover the label area */
    left: 0;
    top: 0;
    z-index: 6;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #5f6368;
    /* Darker border for better visibility */
    border-radius: 4px;
    transition: all 0.2s ease;
    z-index: 5;
}

.checkbox-wrapper:hover input~.checkmark {
    border-color: var(--color-primary);
}

.checkbox-wrapper input:checked~.checkmark {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-wrapper input:checked~.checkmark:after {
    display: block;
}

.checkbox-wrapper .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.t-content {
    flex: 1;
    transition: opacity 0.2s ease;
}

/* Completed State */
.timeline-item.completed .t-content {
    opacity: 0.5;
    text-decoration: line-through;
}

.timeline-item.completed .status-badge {
    text-decoration: none;
    /* Don't strikethrough the badge */
    opacity: 1;
}

.status-done {
    background-color: #e6f4ea;
    color: #137333;
    font-weight: 600;
}

/* Disabled checkbox styles */
.checkbox-wrapper input:disabled~.checkmark {
    background-color: #f1f3f4;
    border-color: #dadce0;
    cursor: not-allowed;
    opacity: 0.6;
}

.checkbox-wrapper:has(input:disabled) {
    cursor: not-allowed;
}

.checkbox-wrapper:has(input:disabled):hover input~.checkmark {
    border-color: #dadce0;
    /* Don't change on hover if disabled */
}

.timeline-item:has(.t-checkbox:disabled) {
    cursor: default;
    /* Don't show pointer cursor for disabled rows */
}

.timeline-item:has(.t-checkbox:disabled):hover {
    background-color: transparent;
    /* No hover effect for disabled rows */
}