/* -----------------------------
   Variables & Base Styles
----------------------------- */
:root {
    --color-moss: #4A5D4A;
    --color-moss-dark: #3A4D3A;
    --color-bark: #5C4033;
    --color-earth: #8B7355;
    --color-fern: #8FAF84;
    --color-stone: #E5E6E4;
    --color-fog: #F5F6F4;
    --color-shadow: rgba(71, 85, 67, 0.1);
    --color-sky: #7a8fa6;
    
    /* Layout measurements */
    --header-height: 82px;
    --header-padding: 1rem;
    --filters-height: 120px;
    --content-padding: 2rem;
    --table-container-padding: 1rem;
    --table-header-height: 48px;
    --safe-area-inset-top: env(safe-area-inset-top, 0px);

    --primary-color: #2c5282;
    --secondary-color: #4a5568;
    --background-color: #f7fafc;
    --text-color: #2d3748;
    --border-color: #e2e8f0;
    --success-color: #48bb78;
    --error-color: #f56565;
    --hover-color: #4299e1;
    
    /* Surface colors for cards, modals, etc. */
    --surface-color: #ffffff;
    
    /* Input background - slightly different from surface for better contrast */
    --input-bg: #ffffff;
    
    /* Placeholder text color */
    --placeholder-color: #999999;
    
    /* Table alternating row background - subtle difference */
    --table-row-alt: #f9fafb;
}

/* Dark mode variables */
[data-theme="dark"] {
    --color-moss: #4A5D4A;
    --color-moss-dark: #3A4D3A;
    --color-bark: #D4C4A8;
    --color-earth: #8B7355;
    --color-fern: #7FAF74;
    --color-stone: #2A2B29;
    --color-fog: #1A1B19;
    --color-shadow: rgba(0, 0, 0, 0.3);
    --color-sky: #6a7f96;
    
    --primary-color: #4a9eff;
    --secondary-color: #718096;
    --background-color: #1a1b19;
    --text-color: #e2e8f0;
    --border-color: #2d3748;
    --success-color: #68d391;
    --error-color: #fc8181;
    --hover-color: #63b3ed;
    
    /* Surface colors for cards, modals, etc. */
    --surface-color: #2d3748;
    
    /* Input background - lighter than surface for better contrast */
    --input-bg: #374151;
    
    /* Placeholder text color - much lighter in dark mode */
    --placeholder-color: #9ca3af;
    
    /* Table alternating row background - subtle difference */
    --table-row-alt: #2a2f3a;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

html {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    display: flex;
    flex-direction: column;
}

/* Override default link colors */
a, a:link, a:visited, a:hover, a:active {
    color: inherit;
    text-decoration: inherit;
}

/* -----------------------------
   Header
----------------------------- */
.site-header {
    background: var(--surface-color);
    border-bottom: 1px solid var(--color-stone);
    padding: 1rem 0;
    flex-shrink: 0;
    position: relative;
    z-index: 1000;
}

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

/* Brand Section */
.brand-link {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease-in-out;
}

.brand-link:hover {
    opacity: 0.8;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

@media (max-width: 768px) {
    .brand {
        gap: 0.66rem;
    }
}

.header-image {
    width: 64px;
    height: 64px;
    border-radius: 6px;
    object-fit: cover;
    opacity: 0.85;
    transition: opacity 0.2s ease-in-out;
}

.brand-link:hover .header-image {
    opacity: 1;
}

.header-text {
    margin-right: auto;
    margin-top: -1px;
}

.header-text h1 {
    margin: 0;
    margin-top: -4px;
    margin-bottom: -4px;
    font-size: 1.75rem;
    color: var(--color-bark);
    font-family: 'Crimson Pro', Georgia, 'Times New Roman', serif;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.header-text p {
    margin: 0;
    margin-top: -5px;
    margin-left: 1px;
    font-size: 0.9rem;
    color: var(--color-earth);
}

/* Auth Section */
.auth-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--color-fog);
    border-color: var(--color-stone);
}

[data-theme="dark"] .theme-toggle {
    border-color: var(--border-color);
}

[data-theme="dark"] .theme-toggle:hover {
    background: var(--color-stone);
}

.theme-icon {
    display: inline-block;
    line-height: 1;
}

/* Theme toggle in dropdown - hidden on desktop */
.theme-toggle-divider,
.theme-toggle-item {
    display: none;
}

/* Hide standalone theme toggle on mobile, show dropdown toggle */
@media (max-width: 768px) {
    .theme-toggle {
        display: none;
    }
    
    .theme-toggle-divider,
    .theme-toggle-item {
        display: block;
    }
    
    .theme-toggle-item {
        display: flex;
    }
}

.auth-button {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
}

.auth-button.login {
    background-color: var(--color-moss);
    color: white;
}

.auth-button.login:hover {
    background-color: var(--color-moss-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px var(--color-shadow);
}

/* Avatar Dropdown */
.avatar-dropdown {
    position: relative;
    overflow: visible;
}

.avatar-button {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid transparent;
    background: none;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.2s ease-in-out;
}

.avatar-button:hover {
    background-color: var(--color-fog);
    border-color: var(--color-stone);
}

.avatar-button .user-name {
    color: var(--text-color);
}

.avatar-button .dropdown-arrow {
    color: var(--text-color);
}

.avatar-image {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--color-moss);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--surface-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--color-shadow), 0 0 1px var(--color-shadow);
    padding: 0.5rem;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease-in-out;
    z-index: 1001;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--color-bark);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
    font-weight: 500;
}

.dropdown-item:hover {
    background-color: var(--color-fog);
}

.dropdown-divider {
    height: 1px;
    background-color: var(--color-stone);
    margin: 0.5rem 0;
}

.dropdown-section-header {
    padding: 0.5rem 1rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-earth);
}

.pwa-install-item {
    color: var(--color-moss) !important;
    font-size: inherit;
    font-family: inherit;
    line-height: inherit;
}

[data-theme="dark"] .pwa-install-item {
    color: #6B8E6B !important;
}

.pwa-install-item:hover {
    background-color: var(--color-fog);
    color: var(--color-moss-dark) !important;
}

[data-theme="dark"] .pwa-install-item:hover {
    color: #7BA07B !important;
}

/* PWA Install Modal */
.pwa-install-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    animation: fadeIn 0.2s ease-in-out;
}

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

.pwa-install-modal-content {
    background: var(--surface-color);
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease-out;
}

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

.pwa-install-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-stone);
}

.pwa-install-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--color-bark);
    font-weight: 600;
}

.pwa-install-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-earth);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
}

.pwa-install-modal-close:hover {
    background-color: var(--color-fog);
    color: var(--color-bark);
}

.pwa-install-modal-body {
    padding: 1.5rem;
}

.pwa-install-modal-body p {
    margin: 0 0 1rem 0;
    color: var(--color-bark);
    line-height: 1.6;
}

.pwa-install-modal-body ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
    color: var(--color-bark);
}

.pwa-install-modal-body li {
    margin: 0.75rem 0;
    line-height: 1.6;
}

.pwa-install-modal-body strong {
    color: var(--color-moss);
    font-weight: 600;
}

[data-theme="dark"] .pwa-install-modal-header h3,
[data-theme="dark"] .pwa-install-modal-body p,
[data-theme="dark"] .pwa-install-modal-body ol,
[data-theme="dark"] .pwa-install-modal-body li {
    color: var(--text-color);
}

[data-theme="dark"] .pwa-install-modal-body strong {
    color: #7BA07B;
}

[data-theme="dark"] .pwa-install-modal-close {
    color: var(--text-color);
}

[data-theme="dark"] .pwa-install-modal-close:hover {
    color: var(--text-color);
    background-color: var(--color-fog);
}

/* -----------------------------
   Main Content
----------------------------- */
.content {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Login Prompt */
.login-prompt {
    text-align: center;
    padding: 0 1rem 0 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

.login-prompt h2 {
    color: var(--color-bark);
    margin-bottom: 1rem;
}

.login-prompt img {
    max-width: 55%;
    height: auto;
    object-fit: contain;
}

/* -----------------------------
   Home Page (Table View)
----------------------------- */
/* Home page specific styles */
body.home-page {
    min-height: 100vh;
}

body.home-page .content {
    overflow: visible;
}

/* Filters Section */
.filters {
    background: var(--surface-color);
    /* box-shadow: 0 2px 8px var(--color-shadow), 0 0 1px var(--color-shadow); */
    border-radius: 8px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    left: 0;
    right: 0;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.48rem;
    margin-bottom: 1rem;
}

.filters-header-left {
    display: flex;
    align-items: center;
    gap: 0.48rem;
    flex: 1;
}

.search-box {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-stone);
    border-radius: 6px;
    font-size: 1rem;
    min-width: 200px;
    background: var(--input-bg);
    color: var(--text-color);
}

.search-box:focus {
    outline: none;
    border-color: var(--color-moss);
    box-shadow: 0 0 0 2px rgba(74, 93, 74, 0.1);
}

.toggle-filters-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-stone);
    border-radius: 6px;
    background: var(--surface-color);
    color: var(--color-bark);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.toggle-filters-button:hover {
    background: var(--color-fog);
    border-color: var(--color-moss);
}

.toggle-icon {
    transition: transform 0.2s ease-in-out;
    transform: rotate(0deg); /* Default to pointing up */
}

.toggle-filters-button.collapsed .toggle-icon {
    transform: rotate(0deg); /* Keep pointing up when collapsed */
}

.toggle-filters-button:not(.collapsed) .toggle-icon {
    transform: rotate(180deg); /* Point down when expanded */
}

.new-tune-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--color-moss);
    color: white !important;
    border-radius: 6px;
    font-size: 1rem;
    line-height: normal;
    transition: all 0.2s ease-in-out;
}

.new-tune-button:hover {
    background: var(--color-moss-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px var(--color-shadow);
}

.filter-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
    overflow: hidden;
    align-items: flex-start;
}

.filter-groups.collapsed {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

.filter-group {
    background: var(--color-fog);
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s ease-in-out;
    height: auto;
    flex: 0 0 auto;
    max-width: 100%;
}

.filter-group-header {
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--color-stone);
    width: 100%;
    box-sizing: border-box;
}

.filter-group-header:hover {
    background: var(--color-earth);
    color: white;
}

.filter-group-header strong {
    font-size: 0.9rem;
}

.filter-group-content {
    padding: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    height: auto;
}

.filter-group.collapsed .filter-group-content {
    display: none;
    height: 0;
}

.filter-button {
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--color-stone);
    border-radius: 4px;
    background: var(--surface-color);
    color: var(--color-bark);
    font-size: .96rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.filter-button:focus,
.filter-button:focus-visible,
.filter-button:active,
.filter-button:-moz-focusring {
    outline: none;
    box-shadow: none;
    border: 1px solid var(--color-stone);
}


.filter-group.disabled,
.filter-group-header.disabled {
    pointer-events: none;
    cursor: default;
    opacity: 0.5;
}

.filter-group.has-active .filter-group-header {
    background: var(--color-earth);
    color: white;
}

/* Only apply hover styles on devices that support hover */
@media (hover: hover) and (pointer: fine) {
    .filter-button:hover:not(.active) {
        background: var(--color-fern);
        color: white;
        border-color: var(--color-fern);
    }
}

.filter-button.active {
    background: var(--color-moss);
    color: white;
    border-color: var(--color-moss);
}

/* Remove any hover effects and outlines on touch devices */
@media (hover: none) {
    .filter-button:hover:not(.active),
    .clickable-filter:hover:not(.active),
    .filter-button:focus,
    .filter-button:focus-visible,
    .filter-button:active,
    .clickable-filter:focus,
    .clickable-filter:focus-visible,
    .clickable-filter:active {
        background: inherit;
        color: inherit;
        transform: none;
        box-shadow: none;
        border: 1px solid var(--color-stone);
        outline: none;
    }
}

/* Table Container */
.table-container {
    border-radius: 8px;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    background: var(--surface-color);
    box-shadow: 0 2px 8px var(--color-shadow), 0 0 1px var(--color-shadow);
    margin-bottom: 2rem;
    max-width: 100%;
    overflow-x: auto;
}

.tune-count {
    padding: 0.75rem;
    padding-top: 0;
    color: var(--secondary-color);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tune-count-text {
    color: var(--secondary-color);
}

[data-theme="dark"] .tune-count-text {
    color: #a0aec0;
}

.tune-count #visibleTuneCount:not([data-total="true"]) {
    font-weight: 700;
}

.clear-filters-button {
    background: none;
    border: 1px solid var(--color-stone);
    border-radius: 4px;
    color: var(--color-bark);
    cursor: pointer;
    font-size: 0.7rem;
    margin-left: 0.5rem;
    padding: 0.2rem 0.5rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.clear-filters-button:hover {
    background-color: var(--color-stone);
    color: white;
}

/* Tunes Table */
.tunes-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    table-layout: fixed;
    min-width: 900px; /* Ensure table doesn't get too cramped */
}

.tunes-table thead,
.tunes-table tbody,
.tunes-table tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.tunes-table thead {
    background-color: var(--color-fog);
}

.tunes-table tbody {
    background-color: var(--surface-color);
}

.tunes-table tr {
    width: 100%;
}

.tunes-table th {
    background: var(--color-fog);
    color: var(--color-bark);
    font-weight: 500;
    text-align: left;
    padding: 0.75rem;
    border-bottom: 1px solid var(--color-stone);
}

.tunes-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--color-moss-light);
    vertical-align: middle;
}

.tunes-table tbody tr.even-row {
    background-color: var(--surface-color);
}

.tunes-table tbody tr.odd-row {
    background-color: var(--table-row-alt);
}

/* Preserve the hover effect */
.tunes-table tr:hover {
    background-color: var(--color-stone);
}

/* Sortable headers */
.sortable {
    cursor: pointer;
    position: relative;
    padding-right: 1.5rem;
}

/* .sortable::after {
    content: '↕';
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
} */

.sortable[data-sort-dir="asc"]::after {
    content: '↑';
    opacity: 1;
}

.sortable[data-sort-dir="desc"]::after {
    content: '↓';
    opacity: 1;
}

/* Table Elements */
.instruments {
    display: flex;
    gap: 0.5rem;
}

.desktop-only {
    display: none;
}

.date-cell {
    font-size: 0.875rem;
    color: var(--color-earth);
    white-space: nowrap;
}

.instrument-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: var(--color-bark);
    font-weight: 500;
    margin-right: 0.2rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-size: 1.1rem;
}

.instrument-icon:hover {
    /* background-color: var(--color-moss); */
    transform: translateY(-1px);
    box-shadow: 0 2px 8px var(--color-shadow);
}

.edit-tune-page .instrument-icon:hover,
.tune-detail-page .instrument-icon:hover {
    transform: none;
}

.instrument-icon.active {
    /* background-color: var(--color-moss); */
    box-shadow: 0 2px 8px var(--color-shadow);
}

.tune-name {
    font-size: 1rem;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    padding-bottom: 0;
    margin-top: 0.75rem;
    border-top: 1px solid var(--color-stone);
    gap: 1rem;
    flex-wrap: wrap;
}

.pagination-info {
    color: var(--color-earth);
    font-size: 0.875rem;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pagination-prev,
.pagination-next {
    background: none;
    border: 1px solid var(--color-stone);
    border-radius: 4px;
    color: var(--color-bark);
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.pagination-prev:hover:not(:disabled),
.pagination-next:hover:not(:disabled) {
    background-color: var(--color-stone);
    color: white;
}

.pagination-prev:disabled,
.pagination-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-page {
    color: var(--color-earth);
    font-size: 0.875rem;
    min-width: 100px;
    text-align: center;
}

.pagination-size {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.pagination-size label {
    color: var(--color-earth);
    font-size: 0.875rem;
}

.page-size-select {
    background: var(--input-bg);
    border: 1px solid var(--color-stone);
    border-radius: 4px;
    color: var(--color-bark);
    font-size: 0.875rem;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-size-select:hover {
    border-color: var(--color-moss);
}

.page-size-select:focus {
    outline: none;
    border-color: var(--color-moss);
    box-shadow: 0 0 0 2px rgba(74, 93, 74, 0.1);
}

.tag {
    display: inline-block;
    padding: 0.56rem 0.72rem;
    border-radius: 0.25rem;
    background-color: var(--color-fog);
    color: var(--color-bark);
    font-size: 0.875rem;
    line-height: 1;
    white-space: nowrap;
    margin: 0.1rem;
}

/* Clickable filters */
.clickable-filter {
    display: inline-block;
    max-width: 100%;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    border: none;
    text-align: center;
    text-wrap: wrap;
}

.clickable-filter:focus,
.clickable-filter:focus-visible,
.clickable-filter:active,
.clickable-filter:-moz-focusring {
    outline: none;
    box-shadow: none;
    border: none;
}

/* Only apply hover styles on devices that support hover */
@media (hover: hover) and (pointer: fine) {
    .clickable-filter:hover:not(.active) {
        background-color: var(--color-fern);
        color: white;
        transform: translateY(-1px);
        box-shadow: 0 2px 8px var(--color-shadow);
        border: none;
    }
}

.clickable-filter.active {
    background-color: var(--color-moss);
    color: white;
    border: none;
}

/* Remove any hover effects and outlines on touch devices */
@media (hover: none) {
    .filter-button:hover:not(.active),
    .clickable-filter:hover:not(.active),
    .filter-button:focus,
    .filter-button:focus-visible,
    .filter-button:active,
    .clickable-filter:focus,
    .clickable-filter:focus-visible,
    .clickable-filter:active {
        background: inherit;
        color: inherit;
        transform: none;
        box-shadow: none;
        border: 1px solid var(--color-stone);
        outline: none;
    }
}

/* Ensure active state persists on mobile */
.clickable-filter.active:focus,
.clickable-filter.active:active,
.clickable-filter.active:hover,
.clickable-filter.active:focus-visible {
    background-color: var(--color-moss);
    color: white;
    outline: none;
}

/* Remove focus styles on mobile */
@media (max-width: 768px) {
    .clickable-filter:focus,
    .clickable-filter:active,
    .clickable-filter:focus-visible {
        outline: none;
    }
    .instrument-icon {
        width: 24px;
        height: 24px;
        font-size: 1rem;
        margin-right: 0.15rem;
    }
}

/* -----------------------------
   Tune Detail View
----------------------------- */
.tune-detail {
    min-width: 400px;
    max-width: 1200px;
    margin: 0 auto;
    padding: .16rem;
}

.tune-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.detail-sections-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

body.subscriptions-page .detail-sections-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.detail-section {
    background: var(--surface-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px var(--color-shadow), 0 0 1px var(--color-shadow);
}

/* Make certain sections span full width */
.detail-section.full-width {
    grid-column: 1 / -1;
}

.detail-section h2 {
    color: var(--color-bark);
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-item label {
    font-size: 0.9rem;
    color: var(--color-earth);
}

.detail-item span {
    font-size: 0.92rem;
    color: var(--color-bark);
    max-width: fit-content;
    background: var(--color-fog);
    margin-bottom: 0.56rem;

    padding: 0.24rem 0.64rem;
    border-radius: 4px;
    display: inline-block;
}

.detail-item .tag {
    background: var(--color-fog);
    padding: 0.48rem 0.64rem;
    border-radius: 4px;
    font-size: 0.875rem;
    color: var(--color-bark);
}

/* FAQ Pricing Section */
.faq-pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.faq-plan-card {
    background: var(--color-fog);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid var(--color-stone);
    transition: all 0.2s ease-in-out;
}

.faq-plan-card:hover {
    box-shadow: 0 4px 12px var(--color-shadow);
}

.faq-plan-card h3 {
    color: var(--color-bark);
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.faq-plan-price {
    margin-bottom: 1.5rem;
}

.faq-price-amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-bark);
    line-height: 1;
}

.faq-price-interval {
    font-size: 1rem;
    color: var(--color-earth);
    margin-left: 0.25rem;
}

.faq-price-savings {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.faq-price-original {
    text-decoration: line-through;
    color: var(--color-earth);
    font-size: 0.9rem;
}

.faq-savings-badge {
    background: var(--color-moss);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.faq-plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.faq-plan-features li {
    padding: 0.5rem 0;
    color: var(--color-bark);
    position: relative;
    padding-left: 1.5rem;
}

.faq-plan-features li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--color-moss);
    font-weight: bold;
}

.faq-plan-link {
    display: inline-block;
    color: var(--color-moss);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease-in-out;
}

.faq-plan-link:hover {
    color: var(--color-moss-dark);
    text-decoration: underline;
}

@media (max-width: 768px) {
    .faq-pricing-grid {
        grid-template-columns: 1fr;
    }
}

/* Detail Actions */
.detail-actions {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.action-buttons {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    padding: 1rem;
    padding-left: 0;
}

.back-button:hover {
    color: var(--text-color);
}

.back-button::before {
    content: "←";
    font-size: 1.2em;
}

.tune-actions {
    display: flex;
    gap: 1.16rem;
    align-items: center;
}

/* Tune Title */
.tune-title {
    color: var(--color-bark);
    font-size: 2rem;
    margin: 0 0 2rem 0;
    text-align: center;
    border: none;
}

/* Instruments Grid */
.instruments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.instrument-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--color-fog);
    border-radius: 4px;
}

.instrument-item .instrument-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-moss);
    color: white;
    border-radius: 4px;
    font-weight: 500;
}

.instrument-item .tuning {
    font-size: 0.875rem;
    color: var(--color-bark);
    background: var(--surface-color);
    padding: 0.24rem 0.72rem;
    border-radius: 4px;
}

/* Characteristics */
.characteristics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.56rem;
}

/* Resource Link */
.resource-link {
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--color-fog);
    border-radius: 4px;
    color: var(--color-bark);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;

    svg {
        flex-shrink: 0;
    }
}

.resource-link:hover {
    background: var(--color-stone);
}

.add-resource-btn {
    background-color: transparent !important;
    color: var(--color-moss) !important;
    border: 1px solid var(--color-moss) !important;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.add-resource-btn:hover {
    border-color: var(--color-moss-dark) !important;
    color: var(--color-moss-dark) !important;
}

[data-theme="dark"] .add-resource-btn {
    color: var(--color-fern) !important;
    border-color: var(--color-fern) !important;
}

[data-theme="dark"] .add-resource-btn:hover {
    border-color: var(--color-moss) !important;
    color: var(--color-moss) !important;
}

/* -----------------------------
   Forms
----------------------------- */
.form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--surface-color);
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--color-shadow), 0 0 1px var(--color-shadow);
}

.page-title {
    color: var(--color-bark);
    font-size: 2rem;
    margin: 0 0 2rem 0;
    text-align: center;
    text-transform: capitalize;
}

.tune-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: var(--color-bark);
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="url"] {
    padding: 0.5rem;
    border: 1px solid var(--color-stone);
    border-radius: 4px;
    font-size: 1rem;
    color: var(--text-color);
    background: var(--input-bg);
}

.form-group input[type="text"]:focus,
.form-group input[type="url"]:focus {
    outline: none;
    border-color: var(--color-moss);
    box-shadow: 0 0 0 2px var(--color-shadow);
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.form-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.submit-button {
    padding: 0.6rem 1.2rem;
    background-color: var(--color-moss);
    color: white !important;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.submit-button:hover {
    background-color: var(--color-moss-dark);
    box-shadow: 0 2px 8px var(--color-shadow);
}

.submit-button:active {
    box-shadow: none;
}

.cancel-button {
    padding: 0.6rem 1.2rem;
    background-color: var(--color-fog);
    color: var(--color-bark);
    border: 1px solid var(--color-stone);
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

.cancel-button:hover {
    background-color: var(--color-stone);
    box-shadow: 0 2px 8px var(--color-shadow);
}

.cancel-button:active {
    box-shadow: none;
}

/* Edit Form Styles */
.edit-form {
    max-width: 800px;
    /* padding: 0 1rem; */
}

.edit-form .detail-sections-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.edit-form .detail-section {
    background: var(--color-fog);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.edit-form .detail-section.full-width {
    grid-column: 1 / -1;
}

.edit-form .detail-grid {
    display: grid;
    gap: 1rem;
}

.edit-form .detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.edit-form .detail-item label {
    font-size: 0.875rem;
    color: var(--color-bark);
    font-weight: 500;
}

.edit-form .detail-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--color-stone);
    border-radius: 4px;
    background: var(--input-bg);
    font-size: 1rem;
    color: var(--text-color);
    box-sizing: border-box;
    max-width: 100%;
}

.edit-form .detail-input:focus {
    outline: none;
    border-color: var(--color-moss);
    box-shadow: 0 0 0 2px rgba(34, 139, 34, 0.1);
}

.edit-form .title-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--color-stone);
    border-radius: 4px;
    background: var(--input-bg);
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
    box-sizing: border-box;
    max-width: 100%;
}

.edit-form .title-input:focus {
    outline: none;
    border-color: var(--color-moss);
    box-shadow: 0 0 0 2px rgba(34, 139, 34, 0.1);
}

.edit-form .tuning-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--color-stone);
    border-radius: 4px;
    background: var(--input-bg);
    font-size: 0.875rem;
    color: var(--text-color);
    box-sizing: border-box;
    max-width: 100%;
    transition: all 0.2s ease-in-out;
}

.edit-form .tuning-input:hover {
    border-color: var(--color-moss);
    background-color: var(--color-fog);
}

.edit-form .tuning-input:focus {
    outline: none;
    border-color: var(--color-moss);
    box-shadow: 0 0 0 2px rgba(74, 93, 74, 0.1);
    background-color: var(--input-bg);
}

.edit-form .checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--color-bark);
}

.edit-form .checkbox-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    border: 1px solid var(--color-stone);
    border-radius: 4px;
    cursor: pointer;
}

.edit-form .checkbox-label input[type="checkbox"]:checked {
    background-color: var(--color-moss);
    border-color: var(--color-moss);
}

.edit-form .tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    padding-left: 0;
    background: var(--color-fog);
    border-radius: 4px;
    font-size: 0.875rem;
    color: var(--color-bark);
    transition: all 0.2s ease;
}

.edit-form .checkbox-label:hover .tag {
    background: var(--color-stone);
}

/* Input placeholder styles */
.detail-input::placeholder,
.title-input::placeholder,
.tuning-input::placeholder {
    color: var(--placeholder-color);
    opacity: 1;
}

/* -----------------------------
   Common Components
----------------------------- */
/* Icon Button */
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 6px;
    border: none;
    background: var(--color-fog);
    color: var(--color-bark);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.icon-button:hover {
    background: var(--color-stone);
}

.icon-button.edit-button:hover,
.icon-button[type="submit"]:hover {
    color: var(--color-moss);
}

[data-theme="dark"] .icon-button.edit-button:hover,
[data-theme="dark"] .icon-button[type="submit"]:hover {
    background: var(--color-stone);
    color: var(--color-fern);
}

.icon-button.delete-button:hover {
    color: #dc3545;
}

[data-theme="dark"] .icon-button.delete-button:hover {
    color: #f87171;
}

.remove-resource {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 6px !important;
    border: none !important;
    background: var(--color-fog) !important;
    color: var(--color-bark) !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    align-self: stretch !important;
}

.remove-resource:hover {
    background: var(--color-stone) !important;
    color: #dc3545 !important;
}

[data-theme="dark"] .remove-resource:hover {
    color: #f87171 !important;
}

.remove-resource svg {
    width: 16px;
    height: 16px;
}

.icon-button svg {
    width: 16px;
    height: 16px;
}

.delete-form {
    display: inline;
}

/* Save Button */
.save-button {
    background-color: var(--color-moss);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.92rem;
    transition: all 0.2s ease-in-out;
}

.save-button:hover {
    background-color: var(--color-moss-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px var(--color-shadow);
}

.save-button:active {
    transform: translateY(0);
    box-shadow: none;
}

.sharing-page h2,
.sharing-page p {
    padding: 0 4px;
}

.sharing-item {
    background: var(--surface-color) !important;
    color: var(--text-color);
}

.sharing-item:hover {
    background: var(--color-fog) !important;
}

.profile-page h2,
.profile-page label {
    padding: 0 4px;
}


/* -----------------------------
   Media Queries
----------------------------- */
/* Column widths for desktop */
@media (min-width: 768px) {
    .desktop-only {
        display: table-cell;
    }

    .tunes-table th:first-child,
    .tunes-table td:first-child {
        width: 20%;
    }

    .tunes-table th:nth-child(2),
    .tunes-table td:nth-child(2),
    .tunes-table th:nth-child(3),
    .tunes-table td:nth-child(3),
    .tunes-table th:nth-child(4),
    .tunes-table td:nth-child(4),
    .tunes-table th:nth-child(5),
    .tunes-table td:nth-child(5) {
        width: 8%;
    }

    .tunes-table th:nth-child(6),
    .tunes-table td:nth-child(6),
    .tunes-table th:nth-child(7),
    .tunes-table td:nth-child(7) {
        width: 11%;
    }

    .tunes-table th:nth-child(8),
    .tunes-table td:nth-child(8) {
        width: 7%;
    }

    .tunes-table tbody {
        display: table;
        width: 100%;
    }
    body.subscriptions-page .content {
        top: 32px;
    }
}

/* Medium desktop styles - fix table overflow */
@media (min-width: 768px) and (max-width: 1246px) {
    .content {
        width: 95%;
        padding: .88rem 0;
    }

    .tunes-table {
        min-width: 800px;
    }

    .tunes-table th:first-child,
    .tunes-table td:first-child {
        width: 17%;
    }

    .tunes-table th:nth-child(2),
    .tunes-table td:nth-child(2),
    .tunes-table th:nth-child(3),
    .tunes-table td:nth-child(3),
    .tunes-table th:nth-child(4),
    .tunes-table td:nth-child(4),
    .tunes-table th:nth-child(5),
    .tunes-table td:nth-child(5) {
        width: 7%;
    }

    .tunes-table th:nth-child(6),
    .tunes-table td:nth-child(6),
    .tunes-table th:nth-child(7),
    .tunes-table td:nth-child(7) {
        width: 9%;
    }

    .tunes-table th:nth-child(8),
    .tunes-table td:nth-child(8) {
        width: 8%;
    }
}

/* Mobile styles */
@media (max-width: 768px) {
    .login-prompt {
        padding: 0;
        margin-top: 1rem;
    }

    .login-prompt img {
        max-width: 100%;
    }

    .limit-warning p {
        font-size: 0.81rem;
    }

    .table-container {
        /* margin: 0 -0.75rem 2rem -0.75rem; */
        border-radius: 0;
    }

    .tunes-table {
        min-width: 0;
    }

    .tune-count {
        padding-top: 0;
    }

    /* Hide non-essential columns on mobile */
    .tunes-table th:nth-child(3),
    .tunes-table td:nth-child(3),
    .tunes-table th:nth-child(4),
    .tunes-table td:nth-child(4),
    .tunes-table th:nth-child(5),
    .tunes-table td:nth-child(5),
    .tunes-table th:nth-child(6),
    .tunes-table td:nth-child(6),
    .tunes-table th:nth-child(7),
    .tunes-table td:nth-child(7),
    .tunes-table th:nth-child(8),
    .tunes-table td:nth-child(8) {
        display: none;
    }

    /* Adjust visible column widths for mobile */
    .tunes-table th:first-child,
    .tunes-table td:first-child {
        width: 77.5%;
    }

    .tunes-table th:nth-child(2),
    .tunes-table td:nth-child(2) {
        width: 22.5%;
    }

    /* Fix sort indicator positioning */
    .sortable {
        white-space: nowrap;
        padding-right: 25px;
        position: relative;
    }

    .sortable::after {
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
    }

    /* Header */
    .header-text p {
        font-size: 0.68rem;
    }
    
    .header-image {
        width: 56px;
        height: 56px;
        opacity: 0.85;
    }
    
    .header-text h1 {
        font-size: 1.4rem;
    }

    .avatar-button {
        max-width: 196px;
    }

    .avatar-button span.user-name {
        max-width: 160px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* PWA Install Modal - Mobile */
    .pwa-install-modal {
        padding: 0.5rem;
    }

    .pwa-install-modal-content {
        max-width: 90%;
        border-radius: 12px;
        max-width: 510px;
    }

    .pwa-install-modal-header {
        padding: 1rem 1.25rem;
    }

    .pwa-install-modal-header h3 {
        font-size: 1.1rem;
    }

    .pwa-install-modal-body {
        padding: 1.25rem;
    }

    .pwa-install-modal-body p,
    .pwa-install-modal-body li {
        font-size: 0.9375rem;
    }

    /* Content */
    .content {
        padding: 1rem 0.5rem;
        padding-top: 0;
        margin: 0 auto;
        width: 92%;
    } 

    /* Filters */
    .filters {
        padding: 20px 8px;
        padding-bottom: 15px;
    }

    .filters-header {
        margin-bottom: 0;
        width: 100%;
        box-sizing: border-box;
    }

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

    .search-box {
        min-width: 0;
        width: 100%;
    }

    .toggle-filters-button {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .new-tune-button {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .filter-groups {
        max-height: 0;
        width: 100%;
        box-sizing: border-box;
        align-items: flex-start;
        transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
        overflow: hidden;
    }

    .filter-groups:not(.collapsed) {
        max-height: 2000px; /* Adjust this value based on your content */
    }

    /* Pagination controls on mobile */
    .pagination-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }

    .pagination-buttons {
        justify-content: center;
        width: 100%;
    }

    .pagination-size {
        justify-content: center;
        width: 100%;
    }

    .pagination-info {
        text-align: center;
    }

    .filter-groups:not(.collapsed) {
        margin-top: 1rem;
    }

    .filter-group {
        width: 100%;
        box-sizing: border-box;
        height: auto;
        flex: 0 0 auto;
    }

    .filter-group-header {
        padding: 0.5rem;
        width: 100%;
        box-sizing: border-box;
    }

    .filter-group-content {
        padding: 0.5rem;
        width: 100%;
        box-sizing: border-box;
    }

    .filter-button {
        padding: 0.56rem 0.72rem;;
        font-size: 0.88rem;
        white-space: nowrap;
    }

    /* Table */
    .tunes-table tbody {
        max-height: none;
        overflow: visible;
    }

    .tunes-table td {
        padding: 0.75rem;
        white-space: normal;
        word-wrap: break-word;
        font-size: 0.92rem;
    }

    .tune-name {
        font-size: 0.92rem;
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .tag {
        font-size: 0.75rem;
        padding: 0.56rem 0.72rem;;
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: fit-content;
    }

    .instruments {
        gap: 0.25rem;
        flex-wrap: wrap;
    }

    .instrument-icon {
        width: 24px;
        height: 24px;
        font-size: 1rem;
        margin-right: 0.15rem;
    }

    /* Forms */
    .search-box {
        font-size: 16px;
        padding: 0.4rem;
    }

    /* Edit Column */
    .edit-column {
        display: none;
    }

    /* Tune Detail */
    .tune-detail {
        min-width: 0;
        padding: 0;
        margin: 0;
        margin-bottom: 2.4rem;
        max-width: 100%;
    }

    .edit-form {
        padding: 0;
        margin: 0;
        max-width: 100%;
    }

    .detail-sections-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }



    .detail-section {
        padding: 1.24rem;
        margin-bottom: 0.5rem;
        border-radius: 0;
    }

    .edit-form {
        padding: 0;
        margin: 0;
        max-width: 100%;
    }

    .detail-sections-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .detail-section {
        padding: 1.24rem;
        margin-bottom: 0.5rem;
        border-radius: 0;
    }
    
    body.subscriptions-page .detail-sections-grid {
        flex-direction: column;
    }

    .edit-form .detail-section {
        border-radius: 0;
    }

    .detail-section h2 {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .detail-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .instruments-grid {
        grid-template-columns: 1fr;
        gap: 0.56rem;
    }

    .tune-title {
        font-size: 1.44rem;
        margin-bottom: 0.75rem;
        padding: 0.56rem 0.72rem;
    }

    .edit-form .title-input {
        font-size: 1rem;
        padding: 0.56rem 0.72rem;;
        border-radius: 0;
    }

    .detail-actions {
        padding: 0 0.5rem;
    }

    body.tune-detail-page {
        margin-top: 0;
    }

    .action-buttons {
        margin-top: 0.64rem;
        padding-left: 0;
        padding-right: 0;
        padding-bottom: 0.68rem;
        height: 56px;
    }

    .detail-item label {
        font-size: 0.85rem;
    }

    .detail-item span {
        font-size: 0.92rem;
    }

    .edit-form .detail-item label {
        font-size: 0.85rem;
    }

    .edit-form .detail-input,
    .edit-form .tuning-input {
        font-size: 0.96rem;
        padding: 0.56rem 0.72rem;
        border-radius: 4px;
        background: var(--input-bg);
        border: 1px solid var(--color-stone);
    }

    .instrument-item {
        padding: 0.3rem;
    }

    .instrument-item .instrument-icon {
        /* width: 18px;
        height: 18px; */
        font-size: 0.85rem;
    }

    .instrument-item .tuning {
        font-size: 0.85rem;
    }

    .instrument-item span {
        font-size: 0.92rem;
    }

    .characteristics {
        gap: 0.56rem;
    }

    .tag {
        font-size: 0.85rem;
        padding: 0.56rem 0.72rem;;
    }

    .resource-link {
        font-size: 0.8rem;
        padding: 0.3rem 0.5rem;
    }

    .back-button {
        font-size: 0.92rem;
    }

    .save-button {
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }

    .icon-button {
        width: 48px;
        height: 48px;
    }

    .icon-button svg {
        width: 16px;
        height: 16px;
    }

    /* Form Container */
    .form-container {
        padding: 0.75rem;
        margin: 0 0.75rem;
    }

    .page-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .checkbox-group {
        gap: 0.5rem;
    }

    .form-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .submit-button,
    .cancel-button {
        width: 100%;
        padding: 0.4rem 0.75rem;
        font-size: 0.92rem;
    }

    /* Input placeholders */
    .detail-input::placeholder,
    .title-input::placeholder,
    .tuning-input::placeholder {
        color: var(--placeholder-color);
        opacity: 1;
        font-size: 0.92rem;
    }

    /* Edit Form Mobile Styles */
    .edit-form {
        padding: 0;
        margin: 0;
        max-width: 100%;
    }

    .edit-form .detail-sections-grid {
        grid-template-columns: 1fr;
        gap: 0;
        margin-top: 0;
    }

    .edit-form .detail-section {
        padding: 1.24rem;
        margin-bottom: 0;
        border-radius: 0;
        box-shadow: none;
        border-bottom: 1px solid var(--color-stone);
        background: var(--surface-color);
    }

    .edit-form .detail-section:last-child {
        border-bottom: none;
    }

    .edit-form .detail-section h2 {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
        color: var(--color-bark);
    }

    .edit-form .detail-grid {
        gap: 0.75rem;
    }

    .edit-form .detail-item {
        gap: 0.25rem;
    }

    .edit-form .detail-item label {
        font-size: 0.85rem;
        color: var(--color-earth);
    }

    .edit-form .detail-input,
    .edit-form .tuning-input {
        font-size: 0.96rem;
        padding: 0.56rem 0.72rem;
        border-radius: 4px;
        background: var(--input-bg);
        border: 1px solid var(--color-stone);
    }

    .edit-form .title-input {
        font-size: 1.44rem;
        padding: 0.56rem 0.72rem;;
        border-radius: 4px;
        margin-bottom: 0.5rem;
        text-align: center;
        background: var(--color-fog);
        border: none;
    }

    .edit-form .instruments-grid {
        grid-template-columns: 1fr;
        gap: 0.56rem;
    }

    .edit-form .instrument-item {
        padding: .24rem 0.4rem;
        background: var(--color-fog);
    }

    .edit-form .instrument-item .instrument-icon {
        /* width: 18px;
        height: 18px; */
        font-size: 0.85rem;
    }

    .edit-form .instrument-item .tuning {
        font-size: 0.85rem;
        padding: 0.56rem 0.72rem;;
    }

    .edit-form .characteristics {
        gap: 0.56rem;
    }

    .edit-form .tag {
        font-size: 0.85rem;
        padding: 0.56rem 0.72rem;
    }
        /* Pagination controls on mobile */
    .pagination-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        position: static;
    }

    .form-buttons {
        padding: 0.75rem;
        margin-top: 0;
        background: var(--surface-color);
        border-top: 1px solid var(--color-stone);
        position: sticky;
        bottom: 0;
        z-index: 1;
    }

    .submit-button,
    .cancel-button {
        width: 100%;
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }

    /* Hide only the default sort icon on mobile */
    .sortable:not([data-sort-dir])::after {
        display: none;
    }

    /* Keep the active sort indicators visible and properly positioned */
    .sortable[data-sort-dir="asc"]::after,
    .sortable[data-sort-dir="desc"]::after {
        display: block;
        right: 0.5rem;
        top: 50%;
        transform: translateY(-50%);
    }

    .subscription-plan {
        width: 90%;
        margin: 0.5rem 0;
    }

    body.page {
        .content {
            padding-top: 1.5rem;
        }
        .page-title {
            margin-bottom: 2rem;
        }
        .detail-section h2 {
            font-size: 1rem;
        }
        ul {
            padding-left: 0;
        }
    }
}
    

/* Prevent auto-zoom on mobile, font size must be greater than 16px */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
textarea {
    font-size: 1rem;
    background: var(--input-bg);
    color: var(--text-color);
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="number"]::placeholder,
input[type="password"]::placeholder,
input[type="search"]::placeholder,
input[type="tel"]::placeholder,
input[type="url"]::placeholder,
textarea::placeholder {
    color: var(--placeholder-color);
    opacity: 1;
}

/* Prevent tap highlight and user selection */
button,
a,
[role="button"],
.filter-button,
.clickable-filter {
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}



/* Profile Page Styles */
.profile-page {
    min-height: 100vh;
}

.profile-page .content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.profile-content {
    background: var(--surface-color);
    border-radius: 8px;
    padding: 2rem;
    padding-bottom: 5rem;
    box-shadow: 0 2px 8px var(--color-shadow), 0 0 1px var(--color-shadow);
}

.profile-content .page-title {
    color: var(--color-bark);
    font-size: 2rem;
    margin: 0 0 2rem 0;
    text-align: center;
}

.profile-section {
    margin-bottom: 3.5rem;
}

.profile-section:last-child {
    margin-bottom: 0;
}

.profile-section h2 {
    color: var(--color-bark);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

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

.info-item label {
    color: var(--color-earth);
    font-size: 0.875rem;
}

.info-item .tag {
    background: var(--color-fog);
    padding: 0.56rem 0.72rem;
    border-radius: 4px;
    font-size: 0.875rem;
    color: var(--color-bark);
}

.profile-picture {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-stone);
}

.error-message {
    text-align: center;
    padding: 3rem 1rem;
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--color-fog);
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--color-shadow);
}

.error-title {
    color: var(--color-bark);
    margin-bottom: 1rem;
}

.error-text {
    color: var(--color-earth);
    margin-bottom: 1.5rem;
}

.error-debug {
    color: var(--color-earth);
    font-size: 0.9em;
    opacity: 0.7;
}

.error-message .back-button {
    display: inline-block;
    margin-top: 1.5rem;
}

/* Mobile styles for profile page */
@media (max-width: 768px) {
    .profile-page .content {
        padding: 1rem 0.75rem;
    }

    .profile-content {
        padding: 1.60rem 1.12rem;
        border-radius: 0;
    }

    .profile-content .page-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .profile-section h2 {
        font-size: 1rem;
    }

    .info-grid {
        gap: 1rem;
    }

    .info-item label {
        font-size: 0.85rem;
    }

    .info-item .tag {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
    }

    .profile-picture {
        width: 80px;
        height: 80px;
    }
}

/* Settings Page Styles */
.settings-page {
    min-height: 100vh;
}

.settings-page .content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.settings-description {
    color: var(--color-earth);
    margin-bottom: 1.5rem;
}

.column-preferences {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.24rem 0.5rem;
    border-radius: 4px;
    background-color: var(--color-fog);
    cursor: pointer;
    transition: background-color 0.2s;
}

.checkbox-label:hover {
    background-color: var(--color-stone);
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
}

.checkbox-label span {
    font-size: 0.85rem;
}

.required-badge {
    font-size: 0.7rem;
    background-color: var(--color-moss);
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    margin-left: auto;
}

.form-buttons {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* Mobile styles for settings page */
@media (max-width: 768px) {
    .settings-page .content {
        padding: 1rem 0.75rem;
    }
    
    .column-preferences {
        grid-template-columns: 1fr;
    }
}

/* Subscription Plans Styles */
.subscription-plan {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem;
    position: relative;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border-radius: 1rem;
    width: 300px;
    margin: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.subscription-plan.popular {
    border: 2px solid var(--color-moss);
}

.subscription-plan.active-free {
    border: 2px solid var(--color-earth);
}

.subscription-plan.current {
    border: 2px solid var(--color-moss);
    background-color: var(--color-fog);
}

.subscription-plan.current:not(.canceled) .subscribe-button:not(.cancel-subscription-button) {
    display: none;
}

.current-plan-badge {
    position: absolute;
    top: -0.75rem;
    right: -0.75rem;
    background-color: #059669;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.subscription-plan.current .subscribe-button {
    background-color: var(--color-stone);
    cursor: default;
}

.subscription-plan.current .subscribe-button:hover {
    transform: none;
    box-shadow: none;
    background-color: var(--error-color);
    cursor: pointer;
}

.subscription-plan .subscription-status {
    color: var(--color-moss);
    font-weight: 600;
    margin-top: 0.5rem;
    display: block;
}

.subscription-plan .renews-on {
    color: var(--color-bark);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
    opacity: 0.8;
}

body.subscriptions-page {
    .content {
        position: relative;
    }
    #message-container {
        position: absolute;
        top: -72px;
        left: 0;
        right: 0;
        z-index: 10000;
        max-width: fit-content;
        margin: 0 auto;
    }
}

.plan-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.plan-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--color-bark);
}

.plan-price {
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-bark);
    margin-bottom: 0.5rem;
}

.plan-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex-grow: 1;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--color-bark);
    font-size: 1rem;
}

.feature-icon {
    width: 1.25rem;
    height: 1.25rem;
    display: inline-block;
    color: var(--color-moss);
    flex-shrink: 0;
}

.feature-icon svg {
    width: 100%;
    height: 100%;
}

.feature-icon path {
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.subscription-plan .subscribe-button {
    /* width: 100%; */
    width: 56%;
    margin-top: 3rem;
    background-color: var(--color-moss);
    color: white;
    padding: 0.96rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.2s ease-in-out;
    border: none;
    cursor: pointer;
    /* margin-top: auto; */
}

.subscription-plan .subscribe-button:hover {
    background-color: var(--color-moss-dark);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px var(--color-shadow);
}

.subscription-plan .subscribe-button:active {
    transform: translateY(0);
}

.subscription-plan .subscribe-button:disabled {
    background-color: var(--color-stone);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Cancel subscription button */
.cancel-subscription-container {
    margin-top: 0.5rem;
    width: 100%;
}

.cancel-subscription-button {
    display: block;
    width: 56%;
    padding: 0.96rem;
    margin-top: 1rem;
    /* background-color: #dc2626; */
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}



.subscription-plan.current {
    border-color: #059669;
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.1);
}



/* Mobile styles for subscription plans */
@media (max-width: 768px) {
    .subscriptions-page .content {
        padding-top: 1.5rem;
    }
    .subscription-plan {
        width: 72%;
        margin: 1rem auto;
    }

    .plan-header {
        margin-bottom: .5rem;
    }

    .plan-header h2 {
        font-size: 1.25rem;
    }

    .plan-price {
        font-size: 2rem;
    }

    .feature-item {
        font-size: 0.925rem;
    }

    .subscription-plan .subscribe-button {
        padding: 0.875rem;
        font-size: 0.925rem;
        margin-top: 1rem;
    }

    .current-plan-badge,
    .popular-badge {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }

    .subscription-plan .subscription-status,
    .subscription-plan .renews-on {
        font-size: 0.8125rem;
    }
}

/* Alert Banner Styles */
.alert-banner {
  position: relative;
  padding: 12px 20px;
  margin-bottom: 20px;
  border-radius: 4px;
  font-weight: 500;
  transition: opacity 0.5s ease;
}

.alert-banner p {
    text-align: center;
    margin: 0;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-banner.fade-out {
  opacity: 0;
}

.plan-features .feature-item .feature-icon {
    width: 24px;
    height: 24px;
    color: var(--color-moss);
}

.plan-features .feature-item .feature-icon path {
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Tune Limit Info Styles */
.tune-limit-info {
  margin: 1rem 0;
  padding: 1rem;
  background-color: var(--color-fog);
  border-radius: 0.5rem;
}

.tune-limit-info p {
  margin: 0;
  color: var(--color-bark);
}

.limit-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.limit-warning p {
  color: #B45309;
  font-weight: 500;
}

.upgrade-button,
a.upgrade-button,
a.upgrade-button:link,
a.upgrade-button:visited,
a.upgrade-button:hover,
a.upgrade-button:active {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: var(--color-earth);
  color: white;
  border-radius: 0.375rem;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease-in-out;
}

.upgrade-button:hover,
a.upgrade-button:hover {
  cursor: pointer;
  background-color: var(--color-moss-dark);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px var(--color-shadow);
}

.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 8px;
    transition: background-color 0.3s, transform 0.3s;
    z-index: 1000;
}

.scroll-to-top:hover {
    background-color: rgba(0, 0, 0, 0.7);
    transform: translateY(-3px);
}

.scroll-to-top svg {
    width: 24px;
    height: 24px;
}

/* Ensure button is visible on mobile but not in the way */
@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
        padding: 6px;
    }
    
    .scroll-to-top svg {
        width: 20px;
        height: 20px;
    }
}

.site-footer {
    padding: 1rem;
    padding-bottom: 2rem;
    text-align: center;
    background-color: var(--background-color);
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-info {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.contact-info {
    margin-top: 0.5rem;
}

/* .contact-info a {
    color: #007bff;
    text-decoration: none;
} */

.contact-info a:hover {
    text-decoration: underline;
}

a.copy-link {
    color: var(--color-sky);
    text-decoration: none;
    cursor: pointer;
}

.copy-link:hover {
    text-decoration: underline;
}

.copy-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.9rem;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 1000;
}

.copy-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Footer Links */
.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.footer-links a {
    color: var(--color-earth);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.footer-links a:hover {
    color: var(--color-bark);
    text-decoration: underline;
}

.footer-separator {
    color: var(--color-stone);
    margin: 0 0.25rem;
}

/* FAQ and Privacy Page Styles */
.faq-page .detail-section,
.privacy-page .detail-section {
    margin-bottom: 2rem;
}

.faq-page .detail-section h2,
.privacy-page .detail-section h2 {
    color: var(--color-bark);
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.faq-page .detail-section p,
.privacy-page .detail-section p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.faq-page .detail-section ul,
.privacy-page .detail-section ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.faq-page .detail-section li,
.privacy-page .detail-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.faq-page .detail-section a,
.privacy-page .detail-section a {
    color: var(--color-moss);
    text-decoration: underline;
}

.faq-page .detail-section a:hover,
.privacy-page .detail-section a:hover {
    color: var(--color-moss-dark);
}

[data-theme="dark"] .faq-page .detail-section a,
[data-theme="dark"] .privacy-page .detail-section a {
    color: var(--color-fern);
}

[data-theme="dark"] .faq-page .detail-section a:hover,
[data-theme="dark"] .privacy-page .detail-section a:hover {
    color: var(--color-moss);
}

@media (max-width: 768px) {
    .footer-links {
        font-size: 0.9rem;
    }
    
    .faq-page .detail-section,
    .privacy-page .detail-section {
        padding: 1rem;
    }
}

.subscription-expiration {
    color: var(--color-bark);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: block;
    opacity: 0.8;
}

.subscription-plan.current.canceled {
    border-color: var(--color-stone);
    background-color: var(--color-fog);
}

.subscription-plan.current.canceled .current-plan-badge {
    background-color: var(--color-stone);
}

.subscription-plan.current.canceled .subscribe-button {
    background-color: var(--color-moss);
    cursor: pointer;
}

.subscription-plan.current.canceled .subscribe-button:hover {
    background-color: var(--color-moss-dark);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px var(--color-shadow);
}

.cancel-subscription-button:hover {
    background-color: #b91c1c;
}

.theme-toggle-text {
    font-size: 14px;
    margin-left: 2px;
}

@media (max-width: 380px) {
    .header-text {
        p {
            font-size: 0.5rem;
        }
        h1 {
            font-size: 1.3rem;
        }
    }
    .brand {
        gap: 0.5rem;
    }
    .header-image {
        width: 40px;
        height: 40px;
    }
}

/* Add consolidated PWA styles at the bottom */
/* -----------------------------
   PWA Specific Styles
----------------------------- */
@media (display-mode: standalone) {
    /* Header adjustments */


    .site-header {
        padding-top: calc(env(safe-area-inset-top) + 16px);

        .header-content {
            padding: 0 4%;
        }
    }
    
    /* Content adjustments */
    .content {
        padding: 0;
        /* margin-top: 64px; */

        body.home-page.auth & {
            margin-top: 1rem;
        }
    }
    
    /* Filter adjustments */
    .filters {
        top: calc(env(safe-area-inset-top));
        border-radius: 0;
        /* padding: 40px 16px; */
    }
    
    /* Table adjustments */
    .table-container {
        margin-top: 0;
        border-radius: 0;
    }
}

/* Confirmation Modal Styles - Used across the app */
.confirmation-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirmation-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-shadow);
    backdrop-filter: blur(2px);
}

.confirmation-modal .modal-content {
    position: relative;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    max-width: 230px;
    width: 90%;
    box-shadow: 0 4px 12px var(--color-shadow);
    z-index: 1001;
}

.confirmation-modal .modal-content h3 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    font-size: 1.25rem;
    font-weight: 600;
}

.confirmation-modal .modal-content p {
    margin: 0 0 1.5rem 0;
    color: var(--text-color);
    line-height: 1.5;
}

.confirmation-modal .modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: stretch;
    flex-direction: column;
}

.confirmation-modal .modal-actions button {
    padding: 0.625rem 1.25rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
    width: 100%;
}

.confirmation-modal .modal-actions .btn-primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.confirmation-modal .modal-actions .btn-primary:hover {
    background: var(--hover-color);
    border-color: var(--hover-color);
}

.confirmation-modal .modal-actions .btn-secondary {
    background: var(--surface-color);
    color: var(--text-color);
    border: 1px solid var(--color-stone);
}

.confirmation-modal .modal-actions .btn-secondary:hover {
    background: var(--input-bg);
}

.confirmation-modal .modal-actions .btn-destructive {
    background: var(--error-color);
    color: white;
    border-color: var(--error-color);
}

.confirmation-modal .modal-actions .btn-destructive:hover {
    background: var(--error-color);
    border-color: var(--error-color);
    opacity: 0.9;
}

/* Desktop: wider modal, horizontal buttons */
@media (min-width: 600px) {
    .confirmation-modal .modal-content {
        max-width: 550px;
    }
    
    .confirmation-modal .modal-actions {
        flex-direction: row;
        align-items: center;
    }
    
    .confirmation-modal .modal-actions button {
        width: auto;
    }
}