/* Variables and Root Styles */
:root {
    /* Light theme colors - softer, more modern palette */
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f0f2f5;
    --text-primary: #586c7c;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --primary-color: oklch(60.9% 0.126 221.723);
    --primary-hover: oklch(55% 0.14 221.723);
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --modal-backdrop: rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] {
    /* Dark theme colors - lighter version based on light theme */
    --bg-primary: #2a2f38;
    --bg-secondary: #343a45;
    --bg-tertiary: #3f4652;
    --text-primary: #c5d7f0;
    --text-secondary: #b4b9c0;
    --text-tertiary: #8891a0;
    --border-color: #4a5160;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.25);
    --primary-color: oklch(68% 0.14 221.723);
    --primary-hover: oklch(72% 0.15 221.723);
    --success-color: #22c55e;
    --danger-color: #fb7185;
    --warning-color: #fcd34d;
    --modal-backdrop: rgba(0, 0, 0, 0.45);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header */
.header {
    border-bottom: none;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--bg-secondary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.header .btn-secondary {
    background-color: var(--bg-tertiary);
}

.header-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-title {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.app-title svg {
    width: 20px;
    height: 20px;
}

.status-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.status-item {
    font-size: 0.6875rem;
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border: 1px solid transparent;
    border-radius: 10px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    text-decoration: none;
    position: relative;
}

.btn:hover {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}



.btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border-color: transparent;
    font-weight: 600;
}

.btn-primary:hover {

    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
    color: white;
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
    font-weight: 600;
}

.btn-danger:hover {
    background-color: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-icon {
    padding: 0.5rem;
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
}

.btn-icon:hover {
    background-color: var(--bg-tertiary);
    border-color: transparent;
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 80px);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Sections */
.section-header {
    margin-bottom: 0.75rem;
}

.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.375rem 0;
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.2s ease;
}

.toggle-btn:hover {
    color: var(--text-primary);
}

.chevron-icon {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.toggle-btn.collapsed .chevron-icon {
    transform: rotate(-90deg);
}

.repo-count {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    background-color: var(--bg-tertiary);
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
}

/* Repositories List */
.repositories-list-modal {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 500px;
    overflow-y: auto;
    padding: 0.25rem;
}

.empty-state-modal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
}

.empty-icon-modal {
    width: 64px;
    height: 64px;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
}

.empty-text-modal {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.empty-subtext-modal {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.repository-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.repository-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.repository-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.repo-card-left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.repo-card-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.repo-card-icon {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.repo-card-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.repo-card-name:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.repo-card-description {
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--text-secondary);
    margin: 0;
}

.repo-card-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.repo-stat {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.stat-icon {
    width: 14px;
    height: 14px;
    color: var(--text-tertiary);
}

.repo-card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.notify-toggle {
    cursor: pointer;
}

.notify-toggle[title*="not configured"] {
    cursor: not-allowed;
    opacity: 0.5;
}

.notify-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background-color: var(--bg-tertiary);
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.notify-toggle:hover:not([title*="not configured"]) .notify-toggle-btn {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

.notify-toggle-active .notify-toggle-btn {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.notify-toggle-active:hover .notify-toggle-btn {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.notify-icon {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.notify-toggle-active .notify-icon {
    color: white;
}

.repo-delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background-color: var(--bg-tertiary);
    border: 1px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.repo-delete-btn:hover {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: var(--danger-color);
    color: var(--danger-color);
}

[data-theme="dark"] .repo-delete-btn:hover {
    background-color: rgba(251, 113, 133, 0.15);
}

.repo-delete-btn svg {
    width: 16px;
    height: 16px;
}

/* Releases List */
.releases-list {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Time Period Sections */
.time-period-section {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.time-period-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.period-icon {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.time-period-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.time-period-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
    background-color: var(--bg-tertiary);
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-weight: 500;
}

.time-period-releases {
    display: grid;
    gap: 0.625rem;
}

/* Release Card */
.release-card {
    display: block;
    background-color: var(--bg-secondary);
    border: none;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    max-width: 100%;
        overflow: hidden
}

.release-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.release-card.new-release-card {
    border-left: 4px solid var(--success-color);
}

.release-card.no-release-card {
    opacity: 0.6;
    border-left: 4px solid var(--text-tertiary);
}

.no-release-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
}

.release-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.release-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.release-title-left {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.repo-name-main {
    flex: 1;
    min-width: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
    transition: color 0.2s ease;
}

.repo-name-main:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.release-title-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    min-width: 0;
    overflow: hidden;
}

.release-time {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0.125rem 0.5rem;
    background-color: rgba(59, 130, 246, 0.1);
    border-radius: 6px;
}

[data-theme="dark"] .release-time {
    background-color: rgba(88, 166, 255, 0.15);
}

.release-time-new {
    color: var(--success-color);
    background-color: rgba(16, 185, 129, 0.1);
}

[data-theme="dark"] .release-time-new {
    color: var(--success-color);
    background-color: rgba(34, 197, 94, 0.15);
}

.release-version-text {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Droid Sans Mono', monospace;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 350px;
    display: block;
}

.release-version-text:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

@media (max-width: 768px) {
    .release-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.625rem;
    }

    .release-title-left {
        flex-wrap: wrap;
        width: 100%;
    }

    .release-title-right {
        max-width: 100%;
        min-width: 0;
    }

    .release-version-text {
        max-width: 100%;
        min-width: 0;
        flex: 1;
    }

    .release-time {
        font-size: 0.6875rem;
        padding: 0.125rem 0.375rem;
    }
}

.repo-description {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-top: 0.25rem;
}

.repo-description-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.repo-homepage-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.repo-homepage-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.icon-medium {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.icon-small {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.icon-tiny {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    color: var(--text-tertiary);
}

.new-badge {
    background-color: var(--success-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    animation: pulse 2s infinite;
    flex-shrink: 0;
    white-space: nowrap;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-icon {
    width: 48px;
    height: 48px;
    color: var(--text-tertiary);
    margin: 0 auto 1rem;
    display: block;
}

.empty-text {
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-subtext {
    font-size: 0.875rem;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal.active {
    display: block;
}

/* Delete confirmation modal should appear above other modals */
#delete-repo-modal {
    z-index: 1100;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-backdrop);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--bg-secondary);
    border: none;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.3s ease;
}

.modal-small {
    max-width: 400px;
}

.modal-large {
    max-width: 800px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: none;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    padding: 0.25rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-close svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    border-radius: 0 0 16px 16px;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.625rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.form-input:hover {
    border-color: var(--text-tertiary);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .form-input:focus {
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.form-hint {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 0.375rem;
    line-height: 1.4;
}

.form-hint::before {
    content: "💡";
    font-size: 0.875rem;
    flex-shrink: 0;
}

.form-error {
    color: var(--danger-color);
    font-size: 0.8125rem;
    margin-top: 0.75rem;
    padding: 0.625rem 0.875rem;
    background-color: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    border-left: 3px solid var(--danger-color);
    display: none;
}

.form-error:not(:empty) {
    display: block;
}

[data-theme="dark"] .form-error {
    background-color: rgba(251, 113, 133, 0.15);
}

.warning-box {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    background-color: rgba(251, 191, 36, 0.1);
    border-radius: 8px;
    border-left: 3px solid var(--warning-color);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

[data-theme="dark"] .warning-box {
    background-color: rgba(252, 211, 77, 0.15);
}

.warning-box i {
    color: var(--warning-color);
    flex-shrink: 0;
    margin-top: 0.125rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease;
    min-width: 300px;
    max-width: 500px;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.toast-success {
    border-left: 3px solid var(--success-color);
}

.toast.toast-error {
    border-left: 3px solid var(--danger-color);
}

.toast.toast-warning {
    border-left: 3px solid var(--warning-color);
}

/* Spinner */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-primary .spinner {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: white;
}

.btn-secondary .spinner {
    border-color: rgba(0, 0, 0, 0.1);
    border-top-color: var(--text-primary);
}

/* Markdown Body */
.markdown-body {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.markdown-body h1 {
    font-size: 1.5rem;
}

.markdown-body h2 {
    font-size: 1.25rem;
}

.markdown-body h3 {
    font-size: 1.125rem;
}

.markdown-body p {
    margin-bottom: 1rem;
}

.markdown-body ul,
.markdown-body ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.markdown-body pre {
    background-color: var(--bg-tertiary);
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.markdown-body code {
    background-color: var(--bg-tertiary);
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    font-size: 0.875em;
}

.markdown-body pre code {
    background-color: transparent;
    padding: 0;
}

.markdown-body blockquote {
    border-left: 3px solid var(--border-color);
    padding-left: 1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.markdown-body a {
    color: var(--primary-color);
    text-decoration: none;
}

.markdown-body a:hover {
    text-decoration: underline;
}

/* Timeline Styles */
.timeline-date-group {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 2rem;
}

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

.timeline-date-group:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 22px;
    bottom: -2rem;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-date-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    position: relative;
}

.timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    position: absolute;
    left: -1.75rem;
    z-index: 1;
    transition: all 0.2s ease;
}

.timeline-dot-first {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

.timeline-date-text {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.timeline-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.timeline-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Compact release cards for timeline */
.release-card-compact {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.release-card-compact:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    border-color: var(--primary-color);
}

.release-card-compact.new-release {
    border-left: 3px solid var(--success-color);
    background: linear-gradient(90deg,
        rgba(45, 164, 78, 0.05) 0%,
        var(--bg-secondary) 10%
    );
}

.release-compact-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.625rem;
    gap: 1rem;
}

.release-repo-name-main {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 600;
    flex: 1;
    min-width: 0;
}

.release-version-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.release-version-compact {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.new-badge-small {
    background-color: var(--success-color);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.release-description-compact {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.25rem;
}

.show-history-btn-compact {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.5rem;
    padding: 0.25rem 0.625rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.show-history-btn-compact:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--text-tertiary);
}

.history-icon-small {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

/* Release history cards */
.release-card-history {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.625rem;
    margin-bottom: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.release-card-history:last-child {
    margin-bottom: 0;
}

.release-card-history:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--text-tertiary);
    transform: translateX(2px);
}

.release-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.375rem;
}

.release-version-history {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.8125rem;
}

.release-date-history {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
}

.release-description-history {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background-color: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background-color: var(--text-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Header */
    .header {
        padding: 0.75rem 0;
    }

    .header-content {
        padding: 0 1rem;
        gap: 0.75rem;
    }

    .header-left {
        flex: 1;
        min-width: 0;
    }

    .header-right {
        gap: 0.375rem;
    }

    .app-title {
        font-size: 1rem;
    }

    .status-info {
        display: none;
    }

    /* Buttons on mobile */
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
        gap: 0.375rem;
    }

    .btn svg {
        width: 16px;
        height: 16px;
    }

    .btn-icon {
        width: 32px;
        height: 32px;
        padding: 0.375rem;
    }

    .btn-icon svg {
        width: 18px;
        height: 18px;
    }

    /* Hide text on mobile for some buttons */
    #repos-list-btn span,
    #check-now-btn span {
        display: none;
    }

    #repos-list-btn,
    #check-now-btn {
        padding: 0.5rem;
        min-width: 40px;
    }

    /* Container */
    .container {
        padding: 0.875rem;
    }

    /* Release Cards */
    .release-card {
        padding: 1rem;
        border-radius: 10px;

    }

    .release-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    /* Time period sections */
    .time-period-section {
        gap: 0.75rem;
    }

    .time-period-header {
        padding-bottom: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .time-period-title {
        font-size: 1rem;
    }

    .time-period-releases {
        gap: 0.625rem;
    }

    /* Repository cards in modal */
    .repository-card {
        padding: 0.875rem;
    }

    .repository-card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .repo-card-actions {
        align-self: flex-end;
    }

    /* Modals */
    .modal-content {
        width: 95%;
        border-radius: 12px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }

    .modal-title {
        font-size: 1rem;
    }

    /* Toast */
    .toast-container {
        left: 0.5rem;
        right: 0.5rem;
        top: 0.5rem;
    }

    .toast {
        min-width: unset;
        font-size: 0.8125rem;
    }

    /* Forms */
    .form-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Extra small devices (phones in portrait) */
@media (max-width: 480px) {
    .header-content {
        padding: 0 0.75rem;
    }

    .container {
        padding: 0.75rem;
    }

    .release-card {
        padding: 0.875rem;
    }

    .repo-description-text {
        font-size: 0.75rem;
    }

    .repo-homepage-link {
        font-size: 0.6875rem;
    }
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Animations */
.refresh-icon {
    transition: transform 0.3s ease;
}

.refreshing .refresh-icon {
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    to { transform: rotate(360deg); }
}

/* Text Utilities */
.text-muted {
    color: var(--text-secondary);
}

.text-small {
    font-size: 0.875rem;
}

/* Hide scrollbar for repository list on small screens */
@media (max-width: 640px) {
    .repositories-list {
        max-height: none;
    }
}

/* PWA Specific Styles */
/* Safe area insets for iOS devices */
body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Ensure header respects safe area */
.header {
    padding-top: max(1rem, env(safe-area-inset-top));
}

/* Make the app feel more native on mobile */
@media (display-mode: standalone) {
    body {
        user-select: none;
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
    }

    /* Allow text selection in specific areas */
    .release-card,
    .modal-body,
    .form-input {
        user-select: text;
        -webkit-user-select: text;
    }

    /* Remove hover effects in standalone mode on touch devices */
    @media (hover: none) {
        .btn:hover,
        .release-card:hover,
        .repository-card:hover {
            transform: none;
        }
    }

    /* Better scrolling on iOS */
    .modal-content,
    .repositories-list-modal {
        -webkit-overflow-scrolling: touch;
    }
}