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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #2d5016 0%, #0f8b3d 25%, #c41e3a 75%, #8b0000 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #0f8b3d 0%, #c41e3a 100%);
    color: white;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 2rem;
    font-weight: 600;
}

.header-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Toggle Switch Styles */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.toggle-label {
    color: white;
    font-size: 1rem;
    font-weight: 600;
}

.toggle-checkbox {
    display: none;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 13px;
    transition: background 0.3s ease;
    border: 2px solid white;
}

.toggle-switch::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
}

.toggle-checkbox:checked + .toggle-switch {
    background: #27ae60;
    border-color: #27ae60;
}

.toggle-checkbox:checked + .toggle-switch::before {
    transform: translateX(24px);
}

.toggle-container:hover .toggle-switch {
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* Reminder Notice Styles */
.reminder-notice {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 3px solid #f39c12;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.2);
}

.reminder-button-example {
    background: #27ae60;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 1.17rem;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0.7;
    cursor: not-allowed;
    flex-shrink: 0;
}

.reminder-text {
    color: #856404;
    font-size: 1.1rem;
    line-height: 1.5;
    margin: 0;
}

.reminder-text strong {
    color: #d63031;
    font-weight: 800;
}

.add-list-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-list-btn:hover {
    background: white;
    color: #667eea;
    transform: rotate(90deg);
}

.plus-icon {
    font-size: 2rem;
    font-weight: 300;
    line-height: 1;
}

.tabs-container {
    display: flex;
    background: #f5f5f5;
    padding: 0 20px;
    overflow-x: auto;
    border-bottom: 2px solid #e0e0e0;
    align-items: center;
    gap: 10px;
}

.tabs-content {
    display: flex;
    flex: 1;
    width: 100%;
}

.add-list-btn-tab {
    background: #0f8b3d;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.add-list-btn-tab:hover {
    background: #0d7533;
    transform: rotate(90deg) scale(1.1);
}

.add-list-btn-tab .plus-icon {
    font-size: 1.5rem;
    font-weight: 300;
    line-height: 1;
}

.tab {
    padding: 15px 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.tab span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tab:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.tab-delete {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 5px;
    transition: color 0.3s ease;
}

.tab-delete:hover {
    color: #e74c3c;
}

.main-content {
    padding: 30px;
    min-height: 400px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 1.2rem;
}

.list-content {
    animation: fadeIn 0.3s ease;
}

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

.gift-items-container {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.gift-item {
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.gift-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.item-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.item-name {
    font-size: 1.43rem;
    font-weight: 700;
    color: #333;
    cursor: pointer;
    flex: 1;
    padding: 5px;
    border: 2px solid transparent;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.item-name:hover {
    background: white;
    border-color: #667eea;
}

.item-name.editing {
    background: white;
    border-color: #667eea;
    outline: none;
}

.item-purchase-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.17rem;
    font-weight: 700;
    transition: all 0.3s ease;
    white-space: nowrap;
    align-self: flex-start;
}

.item-purchase-btn:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.item-delete {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.item-delete:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.item-description {
    color: #666;
    font-size: 1.43rem;
    margin-bottom: 15px;
    cursor: pointer;
    padding: 5px;
    border: 2px solid transparent;
    border-radius: 4px;
    min-height: 30px;
    transition: all 0.3s ease;
}

.item-description:hover {
    background: white;
    border-color: #667eea;
}

.item-description.editing {
    background: white;
    border-color: #667eea;
    outline: none;
}

.item-description.empty {
    color: #999;
    font-style: italic;
}

/* Price Estimate Styles */
.item-price-container {
    margin-bottom: 15px;
    padding: 10px;
    background: #e8f5e9;
    border-radius: 6px;
    border: 2px solid #4caf50;
}

/* Price estimate in view mode - positioned next to link button */
body.view-mode .item-price-container {
    margin-bottom: 0;
    flex: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

body.view-mode .item-price-label {
    font-size: 1rem;
}

body.view-mode .item-price-value {
    font-size: 1.5rem;
}

.item-price-label {
    font-size: 0.85rem;
    color: #2e7d32;
    font-weight: 600;
    margin-bottom: 4px;
}

.item-price-value {
    font-size: 1.2rem;
    color: #1b5e20;
    font-weight: 700;
    cursor: pointer;
    padding: 5px;
    border: 2px solid transparent;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: inline-block;
}

.item-price-value:hover {
    background: white;
    border-color: #4caf50;
}

.item-price-value.editing {
    background: white;
    border-color: #4caf50;
    outline: none;
}

.add-price-btn {
    background: #4caf50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.add-price-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

body.view-mode .item-price-value {
    cursor: default;
}

body.view-mode .item-price-value:hover {
    background: transparent;
    border-color: transparent;
}

body.view-mode .add-price-btn {
    display: none;
}

.item-link-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.no-link-banner {
    background: #e59a06;
    color: white;
    padding: 20px 40px;
    border-radius: 4px;
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
    width: 100%;
}

.item-link-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.item-link-input:focus {
    outline: none;
    border-color: #667eea;
}

.item-link-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.item-link-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.item-link-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.add-buttons-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.add-item-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.add-item-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.add-amazon-list-btn {
    background: #FF9900;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.add-amazon-list-btn:hover {
    background: #E68A00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 153, 0, 0.3);
}

/* Amazon List item specific styles */
.item-link-btn.amazon-list-btn {
    background: #FF9900;
    font-size: 1.1rem;
    font-weight: 700;
}

.item-link-btn.amazon-list-btn:hover {
    background: #E68A00;
    box-shadow: 0 4px 8px rgba(255, 153, 0, 0.3);
}

body.view-mode .item-link-btn.amazon-list-btn {
    font-size: 2rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.confirm-modal-content {
    max-width: 600px;
    padding: 40px;
}

.confirm-modal-content h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #333;
}

.confirm-modal-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #666;
    line-height: 1.6;
}

.confirm-modal-content .modal-buttons {
    gap: 15px;
}

.confirm-modal-content .btn-primary,
.confirm-modal-content .btn-secondary {
    padding: 15px 30px;
    font-size: 1.1rem;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #333;
}

.modal-content input,
.modal-content textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.modal-content input:focus,
.modal-content textarea:focus {
    outline: none;
    border-color: #667eea;
}

.modal-content textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #e0e0e0;
    color: #666;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }

    .add-list-btn {
        width: 40px;
        height: 40px;
    }

    .plus-icon {
        font-size: 1.5rem;
    }

    .tab {
        padding: 12px 15px;
        font-size: 0.9rem;
    }

    .main-content {
        padding: 20px;
    }

    .item-name {
        font-size: 1.1rem;
    }
}
/* View Mode (grandparent-friendly) styles */
body.view-mode .item-link-btn {
    padding: 0;
    font-size: 2rem;
    flex: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
}

body.view-mode .item-link-input {
    display: none;
}

body.view-mode .item-name,
body.view-mode .item-description {
    cursor: default;
    user-select: text;
}

body.view-mode .item-name:hover,
body.view-mode .item-description:hover {
    background: transparent;
    border-color: transparent;
}

body.view-mode .item-delete,
body.view-mode .add-list-btn-tab,
body.view-mode .add-item-btn,
body.view-mode .add-amazon-list-btn,
body.view-mode .tab-delete,
body.view-mode .add-buttons-container {
    display: none !important;
}

/* Hide purchase button in edit mode (when body does NOT have view-mode class) */
body:not(.view-mode) .item-purchase-btn {
    display: none;
}

body.view-mode .item-link-container {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}
/* Priority badge styles */
.priority-badge {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    display: inline-block;
}

.priority-high {
    background: #e91e63;
    color: white;
}

.priority-medium {
    background: #ffc107;
    color: #333;
}

.priority-low {
    background: #03a9f4;
    color: white;
}

.priority-selector {
    padding: 6px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.priority-selector:focus {
    outline: none;
    border-color: #667eea;
}

body.view-mode .priority-selector {
    display: none;
}
.password-error {
    color: #e74c3c;
    font-size: 0.9rem;
    margin: 10px 0;
    font-weight: 600;
}

/* My Purchases Button */
.my-purchases-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.my-purchases-btn:hover {
    background: #5568d3;
}

/* My Purchases Modal */
.my-purchases-modal-content {
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.my-purchases-container {
    margin: 20px 0;
}

.purchased-list-section {
    margin-bottom: 30px;
}

.purchased-list-header {
    color: #667eea;
    font-size: 1.3rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.purchased-item-card {
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-left: 4px solid #4caf50;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.purchased-item-card:hover {
    border-color: #4caf50;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.1);
}

.purchased-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.purchased-item-header h4 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
}

.purchased-date {
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
}

.purchased-item-description {
    color: #666;
    margin: 10px 0;
    font-size: 0.95rem;
}

.purchased-item-link {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    margin-top: 10px;
    transition: all 0.2s ease;
}

.purchased-item-link:hover {
    text-decoration: underline;
    color: #5568d3;
}