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

/* FontAwesome icon styles - ensure icons display properly */
.fas, .fa-solid, .far, .fa-regular, .fab, .fa-brands, .fa {
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands";
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    min-height: 100vh;
    padding: 0;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.6;
}

/* Background image variant for some pages */
body.bg-image {
    background-image: url("../images/20231206_100008.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    position: relative;
}

body.bg-image::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 0;
}

/* Header/Navigation */
.header {
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #202124;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #dc3545 0%, #28a745 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: #202124;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: #5f6368;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.15s;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.nav-link button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    color: inherit;
    font-size: inherit;
}

.nav-link:hover {
    color: #202124;
}

/* Modal Styles for Manage Accounts */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.show {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

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

.modal-overlay.show .modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content.modal-large {
    max-width: 1600px !important;
    width: 98% !important;
    max-height: 95vh;
    border-radius: 20px;
    overflow: hidden;
    background: white;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    padding: 0;
}

.modal-content.modal-extra-large {
    max-width: 1600px !important;
    width: 98% !important;
    max-height: 98vh;
    border-radius: 20px;
    overflow: hidden;
    background: white;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    padding: 0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    border-bottom: 1px solid #e8eaed;
    background: #f8f9fa;
    border-radius: 20px 20px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
    color: #28a745;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: #5f6368;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.15s;
    width: 36px;
    height: 36px;
}

.modal-close:hover {
    background: #e8eaed;
    color: #202124;
}

.modal-body {
    padding: 2rem;
    max-height: calc(95vh - 140px);
    overflow-y: auto;
    background: white;
    border-radius: 0 0 20px 20px;
}

.wishlist-modal-content {
    width: 100%;
}

.wishlist-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e8eaed;
}

.wishlist-toolbar > div:first-child {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.wishlist-toolbar form {
    margin-left: auto;
}

.modal-actions-top {
    margin-bottom: 1.5rem;
}

.accounts-table-container {
    overflow-x: auto;
}

.accounts-table-full {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
}

.accounts-table-full th,
.accounts-table-full td {
    padding: 1.25rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.accounts-table-full th {
    background: #f8f9fa;
    font-weight: 600;
    color: #28a745;
    position: sticky;
    top: 0;
    z-index: 10;
}

.accounts-table-full tr:hover {
    background: #f8f9fa;
}

.accounts-table-full .actions {
    display: flex;
    gap: 0.5rem;
}

.btn-logout {
    padding: 0.5rem 1rem;
    background: #dc3545;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s;
}

.btn-logout:hover {
    background: #c82333;
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url("../images/20231206_100008.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.7) 0%, rgba(40, 167, 69, 0.7) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    text-align: center;
    padding: 2rem;
    color: white;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-description {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    line-height: 1.6;
    opacity: 0.95;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
    font-weight: 500;
    text-align: center;
}

.btn-primary {
    background: #28a745;
    color: white;
}

.btn-primary:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.btn-secondary {
    background: white;
    color: #28a745;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.btn-link {
    padding: 0.5rem 1rem;
    background: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.15s;
    font-size: 0.875rem;
}

.btn-link:hover {
    background: #218838;
    transform: translateY(-1px);
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
    text-decoration: none;
    min-width: 32px;
    background: none;
}

.btn-icon.btn-secondary {
    background: #f1f3f4;
    color: #5f6368;
}

.btn-icon.btn-secondary:hover {
    background: #e8eaed;
    color: #202124;
}

.btn-icon:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

.btn-edit {
    background: none;
    color: #5f6368;
}

.btn-edit:hover {
    background: none;
    color: #28a745;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
    color: #e74c3c;
}

/* Content Sections */
.content-section {
    background: #f8f9fa;
    padding: 3rem 2rem;
    position: relative;
    z-index: 1;
}

/* Make content section transparent on pages with background image */
body.bg-image .content-section {
    background: transparent;
    min-height: calc(100vh - 200px);
}

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

.section-title {
    font-size: 2rem;
    font-weight: 600;
    color: #202124;
    margin-bottom: 2rem;
}

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

.page-header-left {
    flex: 1;
}

.page-header-right {
    display: flex;
    align-items: center;
}

h1 {
    color: #28a745;
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.user-info {
    text-align: left;
    color: #666;
    margin-top: 0.5rem;
}

.user-info strong {
    color: #28a745;
}

.user-info p {
    margin: 0;
}

.user-info p:first-child {
    margin-bottom: 0.25rem;
}

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

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

/* Wishlist Grid */
.wishlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.wishlist-card {
    background: white;
    border: 1px solid #e8eaed;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.15s;
    text-decoration: none;
    color: #202124;
    display: block;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    width: 100%;
}

.wishlist-card button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    text-align: left;
    width: 100%;
    font-family: inherit;
    color: inherit;
    cursor: pointer;
}

.wishlist-card:hover {
    border-color: #28a745;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
    transform: translateY(-2px);
}

.wishlist-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #28a745;
}

.wishlist-card p {
    font-size: 0.875rem;
    color: #5f6368;
    margin: 0.25rem 0;
}

.wishlist-form {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: white;
    border: 2px solid #e8eaed;
    border-radius: 12px;
}

.wishlist-form input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    color: #202124;
}

.wishlist-form input:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.wishlist-form button {
    padding: 0.75rem 1.5rem;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.15s;
    font-size: 1rem;
}

.wishlist-form button:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Reserved Items */
.reserved-item {
    background: white;
    border: 1px solid #e8eaed;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.15s;
}

.reserved-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.reserved-item.crossed-off {
    opacity: 0.6;
}

.reserved-item-content {
    flex: 1;
}

.reserved-item-content h3 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #202124;
}

.reserved-item-content p {
    font-size: 0.875rem;
    color: #5f6368;
    margin: 0.25rem 0;
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 1.5rem;
}

.flash-message {
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    animation: slideIn 0.3s ease-out;
}

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

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

.flash-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Empty States */
.no-reserved,
.no-wishlists {
    text-align: center;
    padding: 3rem;
    color: #5f6368;
    font-size: 1rem;
}

/* Login Page */
.login-container {
    max-width: 450px;
    width: 100%;
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    position: relative;
    z-index: 1;
}

.login-container h1 {
    color: #28a745;
    margin-bottom: 0.5rem;
    font-size: 2rem;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
}

.form-actions {
    margin-top: 2rem;
}

.links {
    text-align: center;
    margin-top: 1.5rem;
}

.links a {
    color: #28a745;
    text-decoration: none;
    font-size: 0.9rem;
}

.links a:hover {
    text-decoration: underline;
}

/* Form Pages (Create/Edit Account, Edit Wishlist, Edit Item) */
.form-page-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

.form-page-container h1 {
    color: #667eea;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.checkbox-group {
    margin-top: 0.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.checkbox-item input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

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

.item-form {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
}

/* Wishlist Detail Page */
.item-form {
    background: #f8f9fa;
    border: 1px solid #e8eaed;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.items-section {
    margin-top: 2rem;
}

.items-list {
    margin-top: 1rem;
}

.item-row {
    background: white;
    border: 1px solid #e8eaed;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.item-row.favorite {
    border-left: 3px solid #f39c12;
}

.item-row.reserved {
    /* Removed green border - using checkmark icon instead */
}

.item-row:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.item-favorite-icon {
    font-size: 1.5rem;
    color: #f39c12;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.item-suggested-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.item-icons-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 1.5rem;
    flex-shrink: 0;
    justify-content: flex-start;
}

.item-reserved-icon {
    font-size: 1.5rem;
    color: #28a745;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.item-reserved-icon i {
    font-size: 1.25rem;
}

.item-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.item-content h3 {
    color: #202124;
    margin: 0;
    margin-bottom: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.4;
}

.item-description-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.item-description-link:hover h3 {
    text-decoration: underline;
    color: #28a745;
}

.item-row.reserved .item-description-link:hover h3 {
    color: #218838;
}

.item-row:not(.reserved) .item-content h3 {
    color: #202124;
}

.item-row.reserved .item-content h3 {
    color: #28a745;
}

.item-content p {
    color: #5f6368;
    font-size: 0.75rem;
    margin-bottom: 0.125rem;
}

.item-content a {
    color: #202124;
    text-decoration: none;
    font-size: 0.75rem;
}

.item-content a:hover {
    text-decoration: underline;
}

.item-row.reserved .item-content a {
    color: #28a745;
}

.item-url-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: #f1f3f4;
    color: #5f6368;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.75rem;
    transition: all 0.15s;
    flex-shrink: 0;
}

.item-url-button:hover {
    background: #e8eaed;
    color: #202124;
    transform: scale(1.1);
}

.item-url-button i {
    font-size: 0.75rem;
}

.item-meta {
    color: #9aa0a6;
    font-size: 0.75rem;
}

.item-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-reserve {
    background: #28a745;
    color: white;
}

.content-section .btn-reserve:hover {
    background: #218838;
}

.btn-unreserve {
    background: #6c757d;
    color: white;
}

.content-section .btn-unreserve:hover {
    background: #5a6268;
}

.reserved-badge {
    background: #28a745;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.share-section {
    background: #f8f9fa;
    border: 1px solid #e8eaed;
    border-radius: 4px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.share-form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.share-checkboxes {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    max-height: 150px;
    overflow-y: auto;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.share-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 200px;
}

.share-checkbox-item input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.shared-accounts {
    margin-top: 0;
    padding-top: 0;
}

.shared-account-tag {
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    display: inline-block;
    margin: 0.25rem;
}

.shared-avatars {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    position: relative;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.avatar-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    margin-bottom: 0.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1000;
}

.avatar-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

.avatar:hover .avatar-tooltip {
    opacity: 1;
}

.avatar-container {
    position: relative;
}

.avatar-color-1 { background: #667eea; }
.avatar-color-2 { background: #764ba2; }
.avatar-color-3 { background: #f093fb; }
.avatar-color-4 { background: #4facfe; }
.avatar-color-5 { background: #00f2fe; }
.avatar-color-6 { background: #43e97b; }
.avatar-color-7 { background: #fa709a; }
.avatar-color-8 { background: #fee140; }
.avatar-color-9 { background: #30cfd0; }
.avatar-color-10 { background: #a8edea; }

.no-items {
    text-align: center;
    padding: 3rem;
    color: #999;
    font-style: italic;
}

/* Legacy modal overlay (for other modals) - keeping for backward compatibility */
.modal-overlay-legacy {
    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;
}

/* Tables */
.accounts-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    overflow-x: auto;
    display: block;
}

.accounts-table table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
}

.accounts-table th,
.accounts-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.accounts-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #28a745;
}

.accounts-table tr:hover {
    background: #f8f9fa;
}

.wishlist-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.wishlist-tag {
    background: #28a745;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
}

.admin-badge {
    background: #f39c12;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.actions {
    display: flex;
    gap: 0.5rem;
}

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

.confirmation-modal-overlay.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-content h3 {
    color: #28a745;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.modal-content p {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.modal-actions .btn {
    padding: 0.75rem 1.5rem;
}

/* Back Link */
.back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: #28a745;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.15s;
}

.back-link:hover {
    color: #218838;
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header {
        padding: 0.75rem 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    .logo-text {
        font-size: 1.125rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 0.75rem;
        width: 100%;
    }
    
    .nav-link {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    .btn-logout {
        padding: 0.5rem 0.875rem;
        font-size: 0.875rem;
    }
    
    .hero-section {
        min-height: 400px;
        padding: 2rem 1rem;
    }
    
    .hero-content {
        padding: 1.5rem 1rem;
    }
    
    .hero-title {
        font-size: 2.25rem;
        margin-bottom: 1rem;
    }
    
    .hero-description {
        font-size: 1.125rem;
        margin-bottom: 1.5rem;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .content-section {
        padding: 2rem 1rem;
    }
    
    .content-container {
        padding: 0;
    }
    
    .section-title {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }
    
    .wishlist-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .wishlist-card {
        padding: 1.25rem;
    }
    
    .wishlist-form {
        flex-direction: column !important;
        padding: 1rem;
    }
    
    .wishlist-form form {
        flex-direction: column !important;
        width: 100% !important;
        gap: 0.75rem !important;
    }
    
    .wishlist-form input {
        width: 100% !important;
        flex: none !important;
        margin-bottom: 0.75rem;
        font-size: 1.125rem;
        padding: 1rem 1.25rem;
        min-height: 52px;
        box-sizing: border-box;
    }
    
    .wishlist-form button {
        width: 100%;
        font-size: 1.125rem;
        padding: 1rem 1.5rem;
        min-height: 52px;
    }
    
    .reserved-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem 1.25rem;
    }
    
    .reserved-item-content {
        width: 100%;
    }
    
    .btn-link {
        width: 100%;
        text-align: center;
    }
    
    .no-reserved, .no-wishlists {
        padding: 2rem 1rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .page-header-right {
        width: 100%;
        margin-top: 0;
    }
    
    .page-header-right .btn {
        width: 100%;
    }
    
    h1 {
        font-size: 1.75rem;
        word-wrap: break-word;
    }
    
    .accounts-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .btn-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
        min-width: 36px;
    }
    
    /* Wishlist toolbar mobile */
    .wishlist-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .wishlist-toolbar > div:first-child {
        width: 100%;
        justify-content: flex-start;
    }
    
    .wishlist-toolbar form {
        margin-left: 0;
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }
    
    body.bg-image {
        padding: 1rem;
    }
    
    .container {
        padding: 2rem 1.5rem;
        max-width: 100%;
    }
    
    /* Item rows - mobile optimization */
    .item-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.25rem;
        gap: 1rem;
        border-radius: 12px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
        margin-bottom: 1rem;
        background: white;
    }
    
    .item-row:hover {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
        transform: translateY(-1px);
    }
    
    .item-icons-container {
        order: 1;
        align-self: flex-start;
        margin-bottom: 0.25rem;
    }
    
    .item-content {
        order: 2;
        width: 100%;
        min-width: 0;
    }
    
    .item-content h3 {
        font-size: 1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        line-height: 1.5;
        margin-bottom: 0.5rem;
    }
    
    .item-actions {
        order: 3;
        width: 100%;
        justify-content: flex-end;
        flex-wrap: nowrap;
        gap: 0.75rem;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid #e8eaed;
    }
    
    .item-url-button {
        width: 36px;
        height: 36px;
        font-size: 0.875rem;
        flex-shrink: 0;
    }
    
    /* Improve reserved item info display on mobile */
    .item-row.reserved .item-content > div > div {
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid #e8eaed;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .item-row.reserved .item-content span[style*="background"] {
        font-size: 0.8125rem;
        padding: 0.375rem 0.875rem;
        margin-right: 0;
        margin-bottom: 0;
    }
    
    .item-row.reserved .item-content span[style*="color: #666"] {
        font-size: 0.8125rem;
        display: inline;
        margin-top: 0;
    }
    
    /* Better spacing for favorite icon */
    .item-favorite-icon {
        font-size: 1.25rem;
    }
    
    .item-reserved-icon {
        font-size: 1.25rem;
    }
    
    .item-reserved-icon i {
        font-size: 1.125rem;
    }
    
    /* Share section mobile */
    .share-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .share-form {
        flex-direction: column;
        gap: 1rem;
    }
    
    .share-checkboxes {
        max-height: 200px;
        padding: 0.75rem;
    }
    
    .share-checkbox-item {
        min-width: 100%;
    }
    
    /* Reserve forms mobile */
    form[id^="reserve-form-"] {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    form[id^="reserve-form-"] input[type="text"] {
        font-size: 1rem; /* Prevents zoom on iOS */
        width: 100%;
        box-sizing: border-box;
    }
    
    form[id^="reserve-form-"] > div {
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Fix "From:" label and input layout */
    form[id^="reserve-form-"] > div > div[style*="display: flex"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }
    
    form[id^="reserve-form-"] > div > div[style*="display: flex"] label {
        width: 100%;
        margin-bottom: 0;
    }
    
    form[id^="reserve-form-"] > div > div[style*="display: flex"] input {
        width: 100% !important;
    }
    
    form[id^="reserve-form-"] label {
        font-size: 0.875rem;
    }
    
    /* Occasion tag selection mobile */
    label[style*="cursor: pointer"] {
        min-height: 44px; /* Better touch target */
        display: flex;
        align-items: center;
    }
    
    span[class*="occasion-tag-selectable"] {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.625rem 1rem;
    }
    
    /* Occasions mobile */
    .occasion-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .occasion-item input[type="text"] {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .occasion-item input[type="color"] {
        width: 100%;
        height: 50px;
    }
    
    .occasion-item button {
        width: 100%;
    }
    
    /* Form pages mobile */
    .form-page-container {
        padding: 1.5rem;
        margin: 1rem;
        border-radius: 12px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    /* Modal mobile */
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 1rem;
    }
    
    .modal-header {
        padding: 1.5rem;
        flex-wrap: wrap;
    }
    
    .modal-header h3 {
        font-size: 1.5rem;
        word-wrap: break-word;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-close {
        width: 40px;
        height: 40px;
    }
    
    /* Item form mobile */
    .item-form {
        padding: 1rem;
    }
    
    /* Login container mobile */
    .login-container {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }
    
    /* User info mobile */
    .user-info {
        font-size: 0.875rem;
    }
    
    /* Avatar mobile */
    .avatar {
        width: 36px;
        height: 36px;
        font-size: 0.75rem;
    }
    
    /* Shared avatars mobile */
    .shared-avatars {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    /* Buttons in item actions */
    .btn-small {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
        min-height: 44px; /* Better touch target */
    }
    
    /* Text overflow handling */
    .item-content a,
    .item-content p {
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }
    
    /* Fix overlapping in reserved items */
    .item-row.reserved .item-content > div {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.5rem;
        width: 100%;
    }
    
    .item-row.reserved .item-content > div > div {
        width: 100%;
        flex-wrap: wrap;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 0.5rem;
    }
    
    /* Ensure reserved info doesn't overlap */
    .item-row.reserved .item-content {
        margin-bottom: 0.5rem;
    }
    
    /* Better spacing for reserved item metadata */
    .item-row.reserved .item-content span[style*="background"] {
        margin-bottom: 0.25rem;
        display: inline-block;
    }
    
    /* Fix nested flex container in item-content to prevent overlap */
    .item-content > div[style*="display: flex"] {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }
    
    /* Ensure description and URL button don't overlap */
    .item-content > div[style*="display: flex"] > a.item-description-link,
    .item-content > div[style*="display: flex"] > h3 {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 100%;
    }
    
    .item-content > div[style*="display: flex"] > a.item-url-button {
        flex-shrink: 0;
    }
    
    /* Stack reserved info properly */
    .item-content > div[style*="display: flex"] > div[style*="display: flex"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        width: 100% !important;
        margin-top: 0.5rem;
    }
    
    /* Page header with edit button */
    .page-header > div:first-child {
        width: 100%;
    }
    
    .page-header h1 {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0.5rem 0.75rem;
    }
    
    .logo-icon {
        width: 28px;
        height: 28px;
        font-size: 1.125rem;
    }
    
    .logo-text {
        font-size: 1rem;
    }
    
    .hero-section {
        min-height: 350px;
        padding: 1.5rem 0.75rem;
    }
    
    .hero-content {
        padding: 1rem 0.75rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
        margin-bottom: 0.875rem;
    }
    
    .hero-description {
        font-size: 1rem;
        margin-bottom: 1.25rem;
    }
    
    .btn-primary, .btn-secondary {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .content-section {
        padding: 1.5rem 0.75rem;
    }
    
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
    }
    
    .wishlist-card {
        padding: 1rem;
    }
    
    .wishlist-card h3 {
        font-size: 1rem;
    }
    
    .wishlist-card p {
        font-size: 0.8125rem;
    }
    
    .reserved-item {
        padding: 0.875rem 1rem;
    }
    
    .reserved-item-content h3 {
        font-size: 0.9375rem;
    }
    
    .reserved-item-content p {
        font-size: 0.8125rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
        min-height: 44px; /* Better touch target */
    }
    
    .accounts-table th,
    .accounts-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
    
    body.bg-image {
        padding: 0.5rem;
    }
    
    .container {
        padding: 1.5rem 1rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .modal-large {
        max-width: 98vw;
        width: 98%;
        max-height: 98vh;
    }
    
    .modal-extra-large {
        max-width: 98vw;
        width: 98%;
        max-height: 98vh;
    }
    
    .modal-header {
        padding: 1.25rem;
        border-radius: 12px 12px 0 0;
    }
    
    .modal-header h3 {
        font-size: 1.25rem;
    }
    
    .modal-body {
        padding: 1.25rem;
        max-height: calc(98vh - 100px);
    }
    
    .accounts-table-full {
        font-size: 0.85rem;
    }
    
    .accounts-table-full th,
    .accounts-table-full td {
        padding: 0.75rem 0.5rem;
    }
    
    /* Extra small mobile optimizations */
    .item-row {
        padding: 1rem;
        gap: 0.875rem;
        border-radius: 10px;
        margin-bottom: 0.875rem;
    }
    
    .item-content h3 {
        font-size: 0.9375rem;
        margin-bottom: 0.375rem;
    }
    
    .item-actions {
        gap: 0.5rem;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }
    
    .form-page-container {
        padding: 1.25rem;
        margin: 0.5rem;
    }
    
    .login-container {
        padding: 1.5rem 1.25rem;
        margin: 0.5rem;
    }
    
    .share-section {
        padding: 0.875rem;
    }
    
    .item-form {
        padding: 0.875rem;
    }
    
    .btn-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }
    
    /* Wishlist toolbar small mobile */
    .wishlist-toolbar {
        padding-bottom: 0.75rem;
        gap: 0.5rem;
    }
    
    .wishlist-toolbar > div:first-child {
        gap: 0.375rem;
    }
    
    .page-header h1 {
        font-size: 1.375rem;
    }
    
    .nav-link {
        font-size: 0.8125rem;
        padding: 0.5rem;
    }
    
    /* Better spacing for small screens */
    .items-list {
        margin-top: 0.75rem;
    }
    
    .items-section h2 {
        font-size: 1.125rem;
    }
    
    /* Occasion tags on small screens */
    span[class*="occasion-tag"] {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
    
    /* Reserve button spacing */
    .reserve-toggle-btn {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    /* Better touch targets for interactive elements */
    input[type="checkbox"],
    input[type="radio"] {
        min-width: 24px;
        min-height: 24px;
    }
    
    /* Occasion tag labels - better touch area */
    label[for^="account_"] {
        padding: 0.5rem;
        display: block;
        cursor: pointer;
    }
    
    /* Reserve form inputs */
    form[id^="reserve-form-"] {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    form[id^="reserve-form-"] input[type="text"] {
        font-size: 1rem; /* Prevents zoom on iOS */
        width: 100% !important;
        box-sizing: border-box;
    }
    
    /* Fix "From:" label and input layout on small screens */
    form[id^="reserve-form-"] > div > div[style*="display: flex"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }
    
    form[id^="reserve-form-"] > div > div[style*="display: flex"] label {
        width: 100%;
        margin-bottom: 0;
    }
    
    form[id^="reserve-form-"] > div > div[style*="display: flex"] input {
        width: 100% !important;
    }
    
    /* Share form buttons */
    .share-form button {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    /* Occasions form buttons */
    #occasions-form button {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    /* Item actions buttons stay side-by-side on small screens */
    .item-actions form {
        display: inline-block;
        width: auto;
    }
    
    .item-actions .btn,
    .item-actions .btn-icon {
        width: auto;
        min-width: 44px;
    }
    
    /* Better spacing for reserved item info */
    .item-row.reserved .item-content > div {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.5rem;
    }
    
    .item-row.reserved .item-content > div > div {
        justify-content: flex-end;
        align-items: center;
    }
    
    /* Fix nested flex container in item-content on small screens */
    .item-content > div[style*="display: flex"] {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }
    
    /* Stack reserved info properly on small screens */
    .item-content > div[style*="display: flex"] > div[style*="display: flex"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        width: 100% !important;
        margin-top: 0.5rem;
    }
    
    /* Ensure description and URL button don't overlap on small screens */
    .item-content > div[style*="display: flex"] > a.item-description-link,
    .item-content > div[style*="display: flex"] > h3 {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 100%;
    }
}

