/* ========================================
   CHECKLIST PAGE RESPONSIVE STYLES
   ======================================== */

:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --secondary-color: #f8fafc;
    --text-color: #1e293b;
    --text-light: #64748b;
    --bg-color: #f8fafc;
    --card-bg: white;
    --border-color: #e2e8f0;
    --shadow-color: rgba(0,0,0,0.1);
    --red-color: #ef4444;
    --red-dark: #dc2626;
    --purple-color: #a855f7;
    --purple-dark: #9333ea;
    --teal-color: #14b8a6;
    --teal-dark: #0d9488;
    --green-color: #10b981;
    --green-dark: #059669;
    --orange-color: #f59e0b;
    --orange-dark: #d97706;
}

.dark-mode {
    --primary-color: #3b82f6;
    --primary-dark: #60a5fa;
    --secondary-color: #1e293b;
    --text-color: #f8fafc;
    --text-light: #cbd5e1;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --border-color: #334155;
    --shadow-color: rgba(0,0,0,0.3);
}

/* ========================================
   CHECKLIST PAGE SPECIFIC STYLES
   ======================================== */

/* Main Container - Only for checklist page */
#checklist-page .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Welcome Banner - Fixed and Standardized (No Animation) */
.welcome-banner {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 0.75rem;
    padding: 1.5rem;
    color: white;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    animation: none !important;
    transition: none !important;
}

.welcome-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.welcome-subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

/* ========================================
   STATS GRID
   ======================================== */

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

.stat-card {
    background-color: var(--card-bg);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px var(--shadow-color);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px var(--shadow-color);
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* ========================================
   CARD GRID & CARDS
   ======================================== */

#checklist-page .card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

#checklist-page .card {
    background-color: var(--card-bg);
    border-radius: 1rem;
    padding: 1.25rem;
    margin: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    box-shadow: 0 2px 12px var(--shadow-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    cursor: pointer;
}

#checklist-page .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--teal-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

#checklist-page .card:hover::before,
#checklist-page .card:active::before {
    opacity: 1;
}

#checklist-page .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-color);
}

#checklist-page .card:active {
    transform: scale(0.98);
    box-shadow: 0 4px 16px var(--shadow-color);
}

#checklist-page .card-header {
    margin-bottom: 0.75rem;
}

#checklist-page .card-priority {
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
}

.priority-high { background-color: var(--red-color); }
.priority-medium { background-color: var(--orange-color); }
.priority-low { background-color: var(--green-color); }

#checklist-page .card-title {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#checklist-page .card-meta {
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#checklist-page .card-body {
    padding: 0;
    margin-bottom: 0.75rem;
}

/* ========================================
   PROGRESS SECTION
   ======================================== */

.progress-section {
    margin-bottom: 1rem;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background-color: var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 25%, rgba(255, 255, 255, 0.1) 25%, rgba(255, 255, 255, 0.1) 50%, transparent 50%, transparent 75%, rgba(255, 255, 255, 0.1) 75%);
    background-size: 20px 20px;
    animation: progressStripes 1s linear infinite;
    opacity: 0.3;
}

@keyframes progressStripes {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--teal-color));
    border-radius: 6px;
    transition: width 0.05s ease;
    position: relative;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
    /* Desktop optimization for smooth updates */
    will-change: width;
    transform: translateZ(0);
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    border-radius: 6px;
    animation: progressShimmer 2s ease-in-out infinite;
}

@keyframes progressShimmer {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

/* Immediate update class for instant progress changes */
.progress-fill.immediate-update {
    transition: none !important;
}

/* Completion state styling for desktop/iPad */
.progress-section.completed .progress-fill {
    background: linear-gradient(90deg, var(--green-color), var(--green-dark));
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
    animation: completionPulse 1s ease-in-out infinite;
}

@keyframes completionPulse {
    0%, 100% { box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3); }
    50% { box-shadow: 0 2px 8px rgba(16, 185, 129, 0.5); }
}

.progress-section.completed .progress-text span:last-child {
    background: linear-gradient(135deg, var(--green-color), var(--green-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* ========================================
   CARD TAGS & ACTIONS
   ======================================== */

#checklist-page .card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    background-color: var(--secondary-color);
    color: var(--text-color);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

#checklist-page .card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
}

/* ========================================
   BUTTONS
   ======================================== */

#checklist-page .btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

#checklist-page .btn-primary {
    background-color: var(--primary-color);
    color: white;
}

#checklist-page .btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

#checklist-page .btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

#checklist-page .btn-secondary:hover {
    background-color: var(--border-color);
}

#checklist-page .btn-icon {
    padding: 0.75rem;
    min-width: 48px;
    min-height: 48px;
    border-radius: 0.75rem;
    background-color: var(--secondary-color);
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    color: var(--text-light);
}

#checklist-page .btn-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.3s ease;
}

#checklist-page .btn-icon:active::before {
    left: 100%;
}

#checklist-page .btn-icon:active {
    transform: scale(0.9);
    background-color: var(--border-color);
}

/* Card action buttons specific styling */
#checklist-page .card-actions .btn-icon {
    padding: 0.75rem;
    min-width: 48px;
    min-height: 48px;
    border-radius: 0.75rem;
    background-color: var(--secondary-color);
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

#checklist-page .card-actions .btn-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.3s ease;
}

#checklist-page .card-actions .btn-icon:active::before {
    left: 100%;
}

#checklist-page .card-actions .btn-icon:active {
    transform: scale(0.9);
    background-color: var(--border-color);
}

/* Action button color variants for card actions */
#checklist-page .card-actions .checklist-edit-btn {
    color: var(--primary-color);
    border-color: rgba(59, 130, 246, 0.3);
}

#checklist-page .card-actions .checklist-edit-btn:active {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: var(--primary-color);
}

#checklist-page .card-actions .checklist-share-btn {
    color: var(--green-color);
    border-color: rgba(16, 185, 129, 0.3);
}

#checklist-page .card-actions .checklist-share-btn:active {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: var(--green-color);
}

#checklist-page .card-actions .checklist-duplicate-btn {
    color: var(--orange-color);
    border-color: rgba(251, 146, 60, 0.3);
}

#checklist-page .card-actions .checklist-duplicate-btn:active {
    background-color: rgba(251, 146, 60, 0.1);
    border-color: var(--orange-color);
}

#checklist-page .card-actions .checklist-delete-btn {
    color: var(--red-color);
    border-color: rgba(239, 68, 68, 0.3);
}

#checklist-page .card-actions .checklist-delete-btn:active {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: var(--red-color);
}

.btn-fab {
    position: fixed;
    bottom: calc(var(--nav-h) + 20px);
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--purple-color));
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    box-shadow: 0 10px 15px -3px var(--shadow-color);
    transition: all 0.2s;
    z-index: 30;
}

.btn-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 20px 25px -5px var(--shadow-color);
}

/* ========================================
   MODALS
   ======================================== */

#checklist-page .modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
}

#checklist-page .modal.active {
    display: flex;
}

#checklist-page .modal-content {
    background-color: var(--card-bg);
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px var(--shadow-color);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

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

#checklist-page .modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

#checklist-page .modal-body {
    padding: 1.5rem;
}

#checklist-page .form-group {
    margin-bottom: 1.5rem;
}

#checklist-page .form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

#checklist-page .form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--card-bg);
    color: var(--text-color);
    transition: border-color 0.2s;
    box-sizing: border-box;
}

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

#checklist-page .form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--card-bg);
    color: var(--text-color);
    box-sizing: border-box;
}

/* ========================================
   CHECKLIST ITEMS
   ======================================== */

#checklist-page .checklist-items {
    /* Container for checklist items - spacing handled by individual items */
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#checklist-page .checklist-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--card-bg);
    transition: all 0.2s;
}

#checklist-page .checklist-item.completed {
    background-color: var(--secondary-color);
    opacity: 0.7;
}

#checklist-page .checklist-item input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--primary-color);
}

#checklist-page .item-text {
    flex: 1;
    transition: all 0.2s;
}

#checklist-page .item-text.completed {
    text-decoration: line-through;
    color: var(--text-light);
}

/* ========================================
   FILTERS
   ======================================== */

#checklist-page .filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

#checklist-page .filter-select {
    width: 100%;
    max-width: 300px;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    background-color: var(--card-bg);
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 3rem;
}

#checklist-page .filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#checklist-page .filter-select:hover {
    border-color: var(--primary-color);
    background-color: rgba(59, 130, 246, 0.05);
}

/* ========================================
   EMPTY STATE
   ======================================== */

#checklist-page .empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

#checklist-page .empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

#checklist-page .empty-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

#checklist-page .empty-text {
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* ========================================
   ANIMATIONS
   ======================================== */

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* ========================================
   FORM ELEMENTS & ITEM CONTAINERS
   ======================================== */

#checklist-page .item-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
    align-items: stretch;
    padding: 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    background-color: var(--card-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

#checklist-page .item-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--teal-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

#checklist-page .item-container:hover::before,
#checklist-page .item-container:focus-within::before {
    opacity: 1;
}

#checklist-page .item-container:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

#checklist-page .item-main-content {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    flex: 1;
    width: 100%;
    flex-wrap: wrap;
}

#checklist-page .item-action-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    width: 100%;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.05), transparent);
    border-radius: 0.5rem;
    padding: 1rem;
}

/* Action button icons - consistent across all devices */
#checklist-page .item-action-buttons .btn-icon {
    padding: 0.75rem;
    border-radius: 0.75rem;
    background-color: var(--secondary-color);
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
    font-size: 1.125rem;
    min-width: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    color: var(--text-light);
    flex: 1;
    max-width: 60px;
}

#checklist-page .item-action-buttons .btn-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.3s ease;
}

#checklist-page .item-action-buttons .btn-icon:hover::before {
    left: 100%;
}

#checklist-page .item-action-buttons .btn-icon:hover {
    background-color: var(--border-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#checklist-page .item-action-buttons .btn-icon:active {
    transform: scale(0.95);
    background-color: var(--border-color);
}

#checklist-page .item-value-container {
    min-width: 150px;
}

#checklist-page .item-text-input {
    flex: 1;
    min-width: 200px;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    background-color: var(--card-bg);
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.2s ease;
}

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

#checklist-page .item-text-input:hover {
    border-color: var(--primary-color);
}

/* Dropdown sizing - smaller than text input */
#checklist-page .item-type-select {
    width: 140px;
    height: 48px;
    padding: 0.75rem;
    font-size: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    background-color: var(--card-bg);
    color: var(--text-color);
    flex-shrink: 0;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 3rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

#checklist-page .item-type-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

#checklist-page .item-type-select:hover {
    border-color: var(--primary-color);
}

/* ========================================
   CONTENT OVERFLOW PROTECTION
   ======================================== */

#checklist-page .card * {
    max-width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

#checklist-page .card .item-text,
#checklist-page .card .card-title,
#checklist-page .card .card-meta,
#checklist-page .card .card-content,
#checklist-page .card label,
#checklist-page .card span {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

#checklist-page .card input,
#checklist-page .card textarea,
#checklist-page .card select {
    max-width: 100%;
        width: 100%;
    box-sizing: border-box;
}

/* ========================================
   RESPONSIVE DESIGN - TABLET (768px and below)
   ======================================== */

@media (max-width: 768px) {
    #checklist-page .container {
        padding: 1rem;
    }
    
    #checklist-page .card-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .welcome-title {
        font-size: 1.5rem;
    }
    
    #checklist-page .welcome-banner {
        padding: 1.5rem;
    }
}

/* ========================================
   RESPONSIVE DESIGN - MOBILE PHONE (480px and below)
   ======================================== */

@media (max-width: 480px) {
    /* Container and spacing adjustments - Match standard container */
    #checklist-page .container {
        padding: 1.5rem 0.5rem 6rem 0.5rem;
        max-width: 100%;
        width: 95%;
        box-sizing: border-box;
    }
    
    /* Welcome banner mobile optimization - Fixed and Standardized (No Animation) */
    #checklist-page .welcome-banner {
        padding: 1.5rem;
        margin-bottom: 2rem;
        border-radius: 0.75rem;
        background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-dark) 100%);
        animation: none !important;
        transition: none !important;
    }
    
    #checklist-page .welcome-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
        font-weight: 700;
    }
    
    #checklist-page .welcome-subtitle {
        font-size: 0.9375rem;
        opacity: 0.95;
    }
    
    /* Stats grid mobile optimization - horizontal layout */
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }
    
    .stat-card {
        padding: 1.25rem;
        border-radius: 0.75rem;
        box-shadow: 0 2px 8px var(--shadow-color);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    .stat-card:active {
        transform: scale(0.98);
    }
    
    .stat-icon {
        width: 2rem;
        height: 2rem;
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
        font-weight: 700;
    }
    
    .stat-label {
        font-size: 0.75rem;
        font-weight: 500;
    }
    
    /* Card grid mobile optimization */
    #checklist-page .card-grid {
        gap: 1rem;
        grid-template-columns: 1fr;
    }
    
    #checklist-page .card {
        border-radius: 1rem;
        padding: 1.25rem;
        margin: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        box-shadow: 0 2px 12px var(--shadow-color);
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
    }
    
    #checklist-page .card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, var(--primary-color), var(--teal-color));
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    #checklist-page .card:hover::before,
    #checklist-page .card:active::before {
        opacity: 1;
    }
    
    #checklist-page .card-header {
        margin-bottom: 0.75rem;
    }
    
    #checklist-page .card-title {
        font-size: 1.125rem;
        margin-bottom: 0.5rem;
        line-height: 1.4;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    #checklist-page .card-meta {
        font-size: 0.75rem;
        margin-bottom: 0.75rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    #checklist-page .card-body {
        margin-bottom: 0.75rem;
    }
    
    #checklist-page .card-actions {
        margin-top: 0.5rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border-color);
    }
    
    /* Mobile-optimized form elements */
    #checklist-page .card input,
    #checklist-page .card textarea,
    #checklist-page .card select {
        font-size: 16px;
        padding: 0.875rem;
        border-radius: 0.75rem;
        width: 100%;
        max-width: 100%;
        border: 2px solid var(--border-color);
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }
    
    #checklist-page .card input:focus,
    #checklist-page .card textarea:focus,
    #checklist-page .card select:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        outline: none;
    }
    
    /* Mobile-optimized item layout */
    #checklist-page .item-main-content {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        max-width: 100%;
    }
    
    #checklist-page .item-container {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 1rem;
        border: 2px solid var(--border-color);
    }
    
    #checklist-page .item-container:hover {
        transform: none;
        border-color: var(--primary-color);
    }
    
    /* Mobile-optimized checklist items in detail view */
    #checklist-page .checklist-items {
        gap: 1rem;
        margin: 1.5rem 0;
    }
    
    #checklist-page .checklist-item {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        padding: 1.25rem;
        margin-bottom: 0;
        border: 2px solid var(--border-color);
        border-radius: 1rem;
        background-color: var(--card-bg);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        transition: all 0.2s ease;
        position: relative;
        overflow: hidden;
    }
    
    #checklist-page .checklist-item::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, var(--primary-color), var(--teal-color));
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    #checklist-page .checklist-item:hover::before,
    #checklist-page .checklist-item:focus-within::before {
        opacity: 1;
    }
    
    #checklist-page .checklist-item:hover {
        border-color: var(--primary-color);
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
        transform: translateY(-1px);
    }
    
    #checklist-page .checklist-item.completed {
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(5, 150, 105, 0.05));
        border-color: var(--green-color);
        opacity: 1;
    }
    
    #checklist-page .checklist-item.completed::before {
        background: linear-gradient(90deg, var(--green-color), var(--green-dark));
        opacity: 1;
    }
    
    /* Mobile item header with type badge */
    #checklist-page .checklist-item > div:first-child {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    #checklist-page .checklist-item .item-type-badge {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
        background: linear-gradient(135deg, var(--primary-color), var(--teal-color));
        color: white;
        border-radius: 1rem;
        font-weight: 600;
        box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
    }
    
    #checklist-page .checklist-item .item-actions {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    /* Mobile item content */
    #checklist-page .checklist-item .item-content {
        width: 100%;
        margin-bottom: 0.75rem;
    }
    
    #checklist-page .checklist-item .item-text {
        font-weight: 600;
        font-size: 1rem;
        margin-bottom: 0.75rem;
        line-height: 1.4;
        color: var(--text-color);
    }
    
    #checklist-page .checklist-item .item-text.completed {
        text-decoration: line-through;
        color: var(--text-light);
        opacity: 0.8;
    }
    
    /* Mobile item controls */
    #checklist-page .checklist-item .item-controls {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }
    
    #checklist-page .checklist-item .item-controls > div {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        flex-wrap: wrap;
    }
    
    /* Mobile completion indicator */
    #checklist-page .checklist-item .completion-indicator {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
        background: rgba(16, 185, 129, 0.1);
        border: 1px solid rgba(16, 185, 129, 0.3);
        border-radius: 0.75rem;
        font-size: 0.875rem;
        font-weight: 500;
        color: var(--green-color);
    }
    
    #checklist-page .checklist-item .completion-indicator span {
        font-size: 1.125rem;
    }
    
    #checklist-page .item-type-select {
        width: 100%;
        height: 44px;
        margin-bottom: 0.75rem;
        font-size: 0.9375rem;
        padding: 0.75rem;
        border: 2px solid var(--border-color);
        border-radius: 0.75rem;
        background-color: var(--card-bg);
        appearance: none;
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
        background-position: right 0.75rem center;
        background-repeat: no-repeat;
        background-size: 1.5em 1.5em;
        padding-right: 3rem;
    }
    
    #checklist-page .item-text-input {
        width: 100%;
        margin-bottom: 0.75rem;
        font-size: 1rem;
        padding: 0.875rem;
        min-height: 3rem;
        border: 2px solid var(--border-color);
        border-radius: 0.75rem;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }
    
    #checklist-page .item-text-input:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        outline: none;
    }
    
    #checklist-page .item-value-container {
        width: 100%;
        margin-bottom: 0.75rem;
    }
    
    #checklist-page .item-action-buttons {
        justify-content: space-between;
        gap: 0.75rem;
        margin-top: 1rem;
        flex-wrap: wrap;
        padding: 1rem;
        border-top: 2px solid var(--border-color);
        background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.05), transparent);
        border-radius: 0.75rem;
    }
    
    #checklist-page .item-action-buttons .btn-icon {
        padding: 1rem;
        min-width: 52px;
        min-height: 52px;
        font-size: 1.25rem;
        border-radius: 0.875rem;
        background-color: var(--secondary-color);
        border: 2px solid var(--border-color);
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 1;
        max-width: 65px;
        position: relative;
        overflow: hidden;
    }
    
    #checklist-page .item-action-buttons .btn-icon::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
        transition: left 0.3s ease;
    }
    
    #checklist-page .item-action-buttons .btn-icon:hover::before {
        left: 100%;
    }
    
    #checklist-page .item-action-buttons .btn-icon:active {
        transform: scale(0.95);
        background-color: var(--border-color);
    }
    
    /* Progress section mobile optimization */
    .progress-section {
        margin-bottom: 1rem;
        padding: 1rem;
        background-color: var(--secondary-color);
        border-radius: 0.75rem;
        border: 2px solid var(--border-color);
    }
    
    .progress-bar {
        height: 12px;
        margin-bottom: 0.75rem;
        border-radius: 6px;
        overflow: hidden;
        background-color: var(--border-color);
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
        position: relative;
    }
    
    .progress-bar::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(45deg, transparent 25%, rgba(255, 255, 255, 0.1) 25%, rgba(255, 255, 255, 0.1) 50%, transparent 50%, transparent 75%, rgba(255, 255, 255, 0.1) 75%);
        background-size: 20px 20px;
        animation: progressStripes 1s linear infinite;
    }
    
    @keyframes progressStripes {
        0% { background-position: 0 0; }
        100% { background-position: 20px 0; }
    }
    
    .progress-fill {
        height: 100%;
        background: linear-gradient(90deg, var(--primary-color), var(--teal-color));
        border-radius: 6px;
        transition: width 0.05s ease;
        position: relative;
        overflow: hidden;
        /* Mobile optimization for immediate updates */
        will-change: width;
        transform: translateZ(0);
    }
    
    .progress-fill::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
        animation: progressShimmer 2s ease-in-out infinite;
    }
    
    @keyframes progressShimmer {
        0% { transform: translateX(-100%); }
        100% { transform: translateX(100%); }
    }
    
    .progress-text {
        font-size: 0.875rem;
        font-weight: 600;
        display: flex;
        justify-content: space-between;
        align-items: center;
        color: var(--text-color);
    }
    
    .progress-text span:last-child {
        background: linear-gradient(135deg, var(--primary-color), var(--teal-color));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        font-weight: 700;
    }
    
    /* Enhanced stats display for mobile */
    .stat-card {
        position: relative;
        overflow: hidden;
    }
    
    .stat-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, var(--primary-color), var(--teal-color));
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .stat-card:hover::before,
    .stat-card:active::before {
        opacity: 1;
    }
    
    .stat-icon {
        position: relative;
        overflow: hidden;
    }
    
    .stat-icon::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
        border-radius: 50%;
        transform: translate(-50%, -50%);
        transition: all 0.3s ease;
    }
    
    .stat-card:active .stat-icon::after {
        width: 100%;
        height: 100%;
    }
    
    /* Completion celebration animation */
    .progress-section.completed {
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.1));
        border-color: var(--green-color);
        animation: completionPulse 2s ease-in-out infinite;
    }
    
    @keyframes completionPulse {
        0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
        50% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    }
    
    .progress-section.completed .progress-fill {
        background: linear-gradient(90deg, var(--green-color), var(--green-dark));
    }
    
    .progress-section.completed .progress-text span:last-child {
        background: linear-gradient(135deg, var(--green-color), var(--green-dark));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    
    /* Card tags mobile optimization */
    #checklist-page .card-tags {
        gap: 0.5rem;
        margin-bottom: 0.75rem;
        flex-wrap: wrap;
    }
    
    .tag {
        padding: 0.25rem 0.75rem;
        font-size: 0.6875rem;
        border-radius: 1rem;
        font-weight: 500;
        background-color: var(--secondary-color);
        border: 1px solid var(--border-color);
    }
    
    /* Mobile touch interactions */
    #checklist-page .card:active {
        transform: scale(0.98);
        box-shadow: 0 4px 16px var(--shadow-color);
    }
    
    /* Filters mobile optimization */
    #checklist-page .filters {
        gap: 0.75rem;
        margin-bottom: 1.5rem;
        flex-wrap: wrap;
    }
    
    #checklist-page .filter-select {
        width: 100%;
        max-width: 100%;
        padding: 1rem 1.25rem;
        font-size: 1rem;
        border-radius: 0.875rem;
        border: 2px solid var(--border-color);
        background-color: var(--card-bg);
        transition: all 0.2s ease;
        min-height: 52px;
        font-weight: 600;
    }
    
    #checklist-page .filter-select:active {
        transform: scale(0.98);
    }
    
    #checklist-page .filter-select:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    }
    
    /* FAB button mobile optimization */
    .btn-fab {
        width: 3.5rem;
        height: 3.5rem;
        font-size: 1.5rem;
        right: 1.25rem;
        bottom: calc(var(--nav-h) + 20px);
        box-shadow: 0 8px 24px var(--shadow-color);
        transition: all 0.2s ease;
    }
    
    .btn-fab:active {
        transform: scale(0.9);
    }
    
    /* Enhanced mobile animations */
    @keyframes mobileSlideIn {
        from {
            opacity: 0;
            transform: translateY(10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    @keyframes mobileFadeInUp {
        from {
            opacity: 0;
            transform: translateY(8px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    @keyframes mobileBounceIn {
        0% {
            opacity: 0;
            transform: scale(0.95);
        }
        100% {
            opacity: 1;
            transform: scale(1);
        }
    }
    
    @keyframes mobilePulse {
        0% {
            transform: scale(1);
        }
        50% {
            transform: scale(1.05);
        }
        100% {
            transform: scale(1);
        }
    }
    
    @keyframes mobileShake {
        0%, 100% {
            transform: translateX(0);
        }
        10%, 30%, 50%, 70%, 90% {
            transform: translateX(-2px);
        }
        20%, 40%, 60%, 80% {
            transform: translateX(2px);
        }
    }
    
    #checklist-page .card {
        animation: mobileSlideIn 0.2s ease-out;
    }
    
    #checklist-page .stat-card {
        animation: mobileFadeInUp 0.25s ease-out;
    }
    
    #checklist-page .stat-card:nth-child(1) {
        animation-delay: 0.05s;
    }
    
    #checklist-page .stat-card:nth-child(2) {
        animation-delay: 0.1s;
    }
    
    #checklist-page .stat-card:nth-child(3) {
        animation-delay: 0.15s;
    }
    
    #checklist-page .welcome-banner {
        animation: mobileBounceIn 0.3s ease-out;
    }
    
    #checklist-page .filter-select {
        animation: mobileFadeInUp 0.2s ease-out;
    }
    
    /* Smooth transitions for all interactive elements */
    #checklist-page * {
        transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    }
    
    /* Disable animations on mobile devices */
    @media (max-width: 768px) {
        #checklist-page .card,
        #checklist-page .stat-card,
        #checklist-page .welcome-banner,
        #checklist-page .filter-select {
            animation: none !important;
            animation-delay: 0s !important;
        }
        
        #checklist-page .card.first-load,
        #checklist-page .stat-card.first-load,
        #checklist-page .welcome-banner.first-load,
        #checklist-page .filter-select.first-load {
            animation: none !important;
        }
    }
    
    /* Loading states */
    #checklist-page .loading {
        animation: mobilePulse 1.5s ease-in-out infinite;
    }
    
    #checklist-page .error {
        animation: mobileShake 0.5s ease-in-out;
    }
    
    /* Success feedback animation */
    #checklist-page .success {
        animation: mobileBounceIn 0.6s ease-out;
    }
    
    /* Haptic feedback simulation */
    #checklist-page .card:active,
    #checklist-page .btn:active,
    #checklist-page .btn-icon:active,
    #checklist-page .filter-select:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
    
    /* Smooth scrolling */
    #checklist-page .modal-body {
        scroll-behavior: smooth;
    }
    
    /* Enhanced focus states for accessibility */
    #checklist-page .btn:focus,
    #checklist-page .btn-icon:focus,
    #checklist-page .filter-select:focus {
        outline: 3px solid rgba(59, 130, 246, 0.5);
        outline-offset: 2px;
    }
    
    /* Reduced motion support */
    @media (prefers-reduced-motion: reduce) {
        #checklist-page * {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
    
    /* Mobile-specific button styles */
    #checklist-page .btn {
        min-height: 48px;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        border-radius: 0.875rem;
        font-weight: 600;
        transition: all 0.2s ease;
        border: 2px solid transparent;
        position: relative;
        overflow: hidden;
    }
    
    #checklist-page .btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s ease;
    }
    
    #checklist-page .btn:active::before {
        left: 100%;
    }
    
    #checklist-page .btn:active {
        transform: scale(0.95);
    }
    
    #checklist-page .btn-primary {
        background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
        color: white;
        box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
        border: 2px solid var(--primary-dark);
    }
    
    #checklist-page .btn-primary:active {
        box-shadow: 0 3px 10px rgba(59, 130, 246, 0.4);
        transform: scale(0.95) translateY(1px);
    }
    
    #checklist-page .btn-secondary {
        background-color: var(--card-bg);
        color: var(--text-color);
        border-color: var(--border-color);
        box-shadow: 0 2px 8px var(--shadow-color);
    }
    
    #checklist-page .btn-secondary:active {
        background-color: var(--border-color);
        transform: scale(0.95) translateY(1px);
        box-shadow: 0 1px 4px var(--shadow-color);
    }
    
    /* Enhanced card action buttons */
    #checklist-page .card-actions {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.75rem;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 2px solid var(--border-color);
    }
    
    #checklist-page .card-actions .btn-icon {
        padding: 0.75rem;
        min-width: 48px;
        min-height: 48px;
        border-radius: 0.75rem;
        background-color: var(--secondary-color);
        border: 2px solid var(--border-color);
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        overflow: hidden;
    }
    
    #checklist-page .card-actions .btn-icon::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
        transition: left 0.3s ease;
    }
    
    #checklist-page .card-actions .btn-icon:active::before {
        left: 100%;
    }
    
    #checklist-page .card-actions .btn-icon:active {
        transform: scale(0.9);
        background-color: var(--border-color);
    }
    
    /* Action button color variants for mobile */
    #checklist-page .checklist-edit-btn {
        color: var(--primary-color);
        border-color: rgba(59, 130, 246, 0.3);
    }
    
    #checklist-page .checklist-edit-btn:active {
        background-color: rgba(59, 130, 246, 0.1);
        border-color: var(--primary-color);
    }
    
    #checklist-page .checklist-share-btn {
        color: var(--green-color);
        border-color: rgba(16, 185, 129, 0.3);
    }
    
    #checklist-page .checklist-share-btn:active {
        background-color: rgba(16, 185, 129, 0.1);
        border-color: var(--green-color);
    }
    
    #checklist-page .checklist-duplicate-btn {
        color: var(--orange-color);
        border-color: rgba(245, 158, 11, 0.3);
    }
    
    #checklist-page .checklist-duplicate-btn:active {
        background-color: rgba(245, 158, 11, 0.1);
        border-color: var(--orange-color);
    }
    
    #checklist-page .checklist-delete-btn {
        color: var(--red-color);
        border-color: rgba(239, 68, 68, 0.3);
    }
    
    #checklist-page .checklist-delete-btn:active {
        background-color: rgba(239, 68, 68, 0.1);
        border-color: var(--red-color);
    }
}

/* ========================================
   RESPONSIVE DESIGN - VERY SMALL MOBILE (360px and below)
   ======================================== */

@media (max-width: 360px) {
    #checklist-page .container {
        padding: 0.25rem;
    }
    
    #checklist-page .card {
        padding: 0.75rem;
    }
    
    #checklist-page .card-title {
        font-size: 0.9375rem;
    }
    
    #checklist-page .item-text-input {
        font-size: 0.9375rem;
        padding: 0.625rem;
        min-height: 2.25rem;
    }
    
    #checklist-page .item-action-buttons .btn-icon {
        padding: 0.625rem;
        min-width: 40px;
        min-height: 40px;
        font-size: 0.9375rem;
    }
}

/* ========================================
   RESPONSIVE DESIGN - EXTRA SMALL MOBILE (320px and below)
   ======================================== */

@media (max-width: 320px) {
    #checklist-page .card {
        padding: 0.5rem;
    }
    
    #checklist-page .card-title {
        font-size: 0.875rem;
    }
    
    #checklist-page .item-text-input {
        font-size: 0.875rem;
        padding: 0.5rem;
        min-height: 2rem;
    }
    
    .tag {
        font-size: 0.5625rem;
        padding: 0.0625rem 0.375rem;
    }
}

/* ========================================
   MODAL RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 640px) {
    #checklist-page .modal {
        padding: 0.75rem;
        background-color: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
    }
    
    #checklist-page .modal-content {
        width: 100%;
        max-height: 95vh;
        border-radius: 1rem;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
        animation: modalSlideIn 0.3s ease-out;
    }
    
    @keyframes modalSlideIn {
        from {
            opacity: 0;
            transform: translateY(50px) scale(0.95);
        }
        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }
    
    #checklist-page .modal-header {
        padding: 1.5rem;
        border-bottom: 2px solid var(--border-color);
        background: linear-gradient(135deg, var(--primary-color), var(--purple-color));
        color: white;
        border-radius: 1rem 1rem 0 0;
    }
    
    #checklist-page .modal-title {
        font-size: 1.25rem;
        font-weight: 700;
        margin: 0;
    }
    
    #checklist-page .modal-body {
        padding: 1.5rem;
        max-height: calc(95vh - 120px);
        overflow-y: auto;
    }
    
    #checklist-page .form-group {
        margin-bottom: 1.5rem;
    }
    
    #checklist-page .form-label {
        font-size: 1rem;
        margin-bottom: 0.5rem;
        font-weight: 600;
        color: var(--text-color);
    }
    
    #checklist-page .form-input,
    #checklist-page .form-select {
        padding: 0.875rem;
        font-size: 1rem;
        border-radius: 0.75rem;
        border: 2px solid var(--border-color);
        background-color: var(--card-bg);
        transition: all 0.2s ease;
        min-height: 48px;
    }
    
    #checklist-page .form-input:focus,
    #checklist-page .form-select:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        outline: none;
    }
    
    /* Mobile-optimized item container in modals */
    #checklist-page .item-container {
        padding: 1rem;
        gap: 0.75rem;
        margin-bottom: 1rem;
        border-radius: 0.75rem;
        flex-direction: column;
        align-items: stretch;
        background-color: var(--card-bg);
        border: 2px solid var(--border-color);
        box-shadow: 0 2px 8px var(--shadow-color);
        transition: all 0.2s ease;
    }
    
    #checklist-page .item-container:focus-within {
        border-color: var(--primary-color);
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    }
    
    #checklist-page .item-main-content {
        gap: 0.75rem;
        width: 100%;
        margin-bottom: 0.75rem;
    }
    
    #checklist-page .item-type-select {
        width: 100%;
        height: 48px;
        padding: 0.75rem;
        font-size: 0.9375rem;
        border: 2px solid var(--border-color);
        border-radius: 0.75rem;
        background-color: var(--card-bg);
        color: var(--text-color);
        appearance: none;
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
        background-position: right 0.75rem center;
        background-repeat: no-repeat;
        background-size: 1.5em 1.5em;
        padding-right: 3rem;
        transition: border-color 0.2s ease;
    }
    
    #checklist-page .item-type-select:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        outline: none;
    }
    
    #checklist-page .item-text-input {
        width: 100%;
        padding: 0.875rem;
        font-size: 1rem;
        min-height: 48px;
        border: 2px solid var(--border-color);
        border-radius: 0.75rem;
        background-color: var(--card-bg);
        color: var(--text-color);
        transition: border-color 0.2s ease;
    }
    
    #checklist-page .item-text-input:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        outline: none;
    }
    
    #checklist-page .item-action-buttons {
        gap: 0.75rem;
        justify-content: space-between;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 2px solid var(--border-color);
        width: 100%;
    }
    
    #checklist-page .item-action-buttons .btn-icon {
        padding: 0.75rem;
        border-radius: 0.75rem;
        background-color: var(--secondary-color);
        border: 2px solid var(--border-color);
        font-size: 1.125rem;
        min-width: 48px;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
        flex: 1;
        max-width: 60px;
    }
    
    #checklist-page .item-action-buttons .btn-icon:active {
        transform: scale(0.95);
        background-color: var(--border-color);
    }
    
    /* Modal close button enhancement */
    #checklist-page .modal-header button {
        background: rgba(255, 255, 255, 0.2);
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 1.25rem;
        transition: all 0.2s ease;
    }
    
    #checklist-page .modal-header button:active {
        transform: scale(0.9);
        background: rgba(255, 255, 255, 0.3);
    }
    
    /* Modal scrollbar styling */
    #checklist-page .modal-body::-webkit-scrollbar {
        width: 6px;
    }
    
    #checklist-page .modal-body::-webkit-scrollbar-track {
        background: var(--secondary-color);
        border-radius: 3px;
    }
    
    #checklist-page .modal-body::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 3px;
    }
    
    #checklist-page .modal-body::-webkit-scrollbar-thumb:hover {
        background: var(--text-light);
    }
}

/* ========================================
   BUTTON COLOR VARIANTS
   ======================================== */

#checklist-page .checklist-edit-btn {
    color: #3b82f6;
    transition: color 0.2s ease;
}

#checklist-page .checklist-edit-btn:hover {
    color: #1d4ed8;
    background-color: var(--secondary-color);
}

#checklist-page .checklist-share-btn {
    color: #10b981;
    transition: color 0.2s ease;
}

#checklist-page .checklist-share-btn:hover {
    color: #047857;
    background-color: var(--secondary-color);
}

#checklist-page .checklist-duplicate-btn {
    color: #f59e0b;
    transition: color 0.2s ease;
}

#checklist-page .checklist-duplicate-btn:hover {
    color: #d97706;
    background-color: var(--secondary-color);
}

#checklist-page .checklist-delete-btn {
    color: #ef4444;
    transition: color 0.2s ease;
}

#checklist-page .checklist-delete-btn:hover {
    color: #dc2626;
    background-color: var(--secondary-color);
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#checklist-page .dropdown-menu {
    animation: fadeIn 0.2s ease-out;
}

/* ========================================
   DARK MODE TOGGLE
   ======================================== */

#checklist-page .dark-toggle {
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    padding: 0.25rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 3rem;
    height: 1.5rem;
    position: relative;
}

#checklist-page .dark-toggle::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1rem;
    height: 1rem;
    background-color: var(--text-color);
    border-radius: 50%;
    transition: transform 0.2s;
}

.dark-mode #checklist-page .dark-toggle::before {
    transform: translateX(1.5rem);
}

/* ========================================
   SPIN ANIMATION FOR LOADING
   ======================================== */

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   FORM ELEMENT SPECIFIC STYLES
   ======================================== */

/* Checkbox label styling */
#checklist-page .checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

#checklist-page .checkbox-label input[type="checkbox"] {
    transform: scale(1.2);
}

#checklist-page .checkbox-label span {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Rating input styling */
#checklist-page .rating-input {
    display: flex;
    gap: 0.25rem;
}

#checklist-page .rating-star {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
    color: #d1d5db; /* Default gray color */
    padding: 0.25rem;
    border-radius: 0.25rem;
}

#checklist-page .rating-star.active {
    color: #f59e0b; /* Orange color for active stars */
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

#checklist-page .rating-star.inactive {
    color: #d1d5db; /* Light gray for inactive stars */
}

#checklist-page .rating-star:hover {
    color: #f59e0b;
    transform: scale(1.1);
}

#checklist-page .rating-star:active {
    transform: scale(0.95);
}

/* Dark mode star ratings */
.dark-mode #checklist-page .rating-star {
    color: #6b7280; /* Darker gray for dark mode */
}

.dark-mode #checklist-page .rating-star.active {
    color: #f59e0b; /* Orange color for active stars */
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.dark-mode #checklist-page .rating-star.inactive {
    color: #6b7280; /* Darker gray for inactive stars */
}

.dark-mode #checklist-page .rating-star:hover {
    color: #f59e0b;
}

/* ========================================
   MOBILE ACTION BUTTONS CONTAINER
   ======================================== */

@media (max-width: 480px) {
    /* Mobile-optimized action buttons container */
    #checklist-page .btn-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
        margin-bottom: 2rem !important;
    }
    
    #checklist-page .btn-container .btn {
        width: 100% !important;
        flex: none !important;
        padding: 1rem 1.5rem !important;
        font-size: 1rem !important;
        font-weight: 600 !important;
        border-radius: 0.875rem !important;
        transition: all 0.2s ease !important;
        border: 2px solid transparent !important;
        position: relative !important;
        overflow: hidden !important;
        min-height: 52px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.5rem !important;
    }
    
    #checklist-page .btn-container .btn-primary {
        background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)) !important;
        color: white !important;
        box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3) !important;
        border: 2px solid var(--primary-dark) !important;
    }
    
    #checklist-page .btn-container .btn-primary:active {
        box-shadow: 0 3px 10px rgba(59, 130, 246, 0.4) !important;
        transform: scale(0.95) translateY(1px) !important;
    }
    
    #checklist-page .btn-container .btn-secondary {
        background-color: var(--card-bg) !important;
        color: var(--text-color) !important;
        border-color: var(--border-color) !important;
        box-shadow: 0 2px 8px var(--shadow-color) !important;
    }
    
    #checklist-page .btn-container .btn-secondary:active {
        background-color: var(--border-color) !important;
        transform: scale(0.95) translateY(1px) !important;
        box-shadow: 0 1px 4px var(--shadow-color) !important;
    }
    
    #checklist-page .btn-container .btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s ease;
    }
    
    #checklist-page .btn-container .btn:active::before {
        left: 100%;
    }
}

/* ========================================
   END OF CHECKLIST STYLES
   ======================================== */