/* Gift Marshal Web View Styles */
/* Responsive design for viewing wishlists and claiming gifts without the app */

:root {
    --primary: #667eea;
    --primary-dark: #764ba2;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    --text-muted: #999;
    --background: #f5f5f7;
    --card-bg: #ffffff;
    --border: #e0e0e0;
    --success: #34c759;
    --error: #ff3b30;
    --claimed: #8e8e93;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.2);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

/* Page Container */
.page-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: var(--card-bg);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 18px;
}

.logo-icon {
    font-size: 24px;
}

/* Loading State */
.loader-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.loader {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loader-container p {
    margin-top: 16px;
    color: var(--text-secondary);
}

/* Error Message */
.error-message {
    background: #fff5f5;
    border: 1px solid #ffcdd2;
    color: var(--error);
    padding: 16px 20px;
    border-radius: 12px;
    margin: 20px;
    text-align: center;
}

/* Wishlist Header */
.wishlist-header {
    background: var(--gradient);
    color: white;
    padding: 32px 20px;
    text-align: center;
}

.wishlist-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.wishlist-header .subtitle {
    font-size: 16px;
    opacity: 0.9;
}

.wishlist-header .description {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 8px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Event Badge */
.event-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--card-bg);
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-secondary);
}

.event-badge .event-date {
    color: var(--text-muted);
}

/* Items Grid */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Item Card */
.item-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.item-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.item-card.claimed {
    opacity: 0.7;
}

.item-image {
    position: relative;
    width: 100%;
    height: 200px;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-no-image span {
    font-size: 48px;
    opacity: 0.5;
}

.claimed-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.claimed-overlay span {
    background: var(--claimed);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.item-details {
    padding: 16px;
    flex: 1;
}

.item-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.item-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.item-price {
    font-weight: 600;
    color: var(--primary);
    font-size: 16px;
}

.item-priority {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.priority-must-have {
    background: #fff3e0;
    color: #e65100;
}

.priority-nice-to-have {
    background: #e3f2fd;
    color: #1565c0;
}

.priority-dream {
    background: #fce4ec;
    color: #c2185b;
}

.item-link {
    display: inline-block;
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
}

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

.item-actions {
    padding: 0 16px 16px;
}

/* Buttons */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.button-primary {
    background: var(--gradient);
    color: white;
}

.button-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.button-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    margin-top: 12px;
}

.button-secondary:hover {
    background: rgba(102, 126, 234, 0.1);
}

.button-claim {
    background: var(--gradient);
    color: white;
}

.button-claim:hover {
    opacity: 0.9;
}

.button-disabled {
    background: var(--claimed);
    color: white;
    cursor: not-allowed;
}

.check-icon {
    font-size: 14px;
}

/* Empty State */
.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 32px;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    background: var(--background);
}

.modal-content h2 {
    font-size: 22px;
    margin-bottom: 20px;
    text-align: center;
}

/* Claim Item Preview */
.claim-item-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--background);
    border-radius: 12px;
    margin-bottom: 20px;
}

.preview-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-image span {
    font-size: 28px;
}

.preview-details h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.preview-price {
    font-size: 14px;
    color: var(--primary);
    font-weight: 500;
}

/* Form */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.form-error {
    background: #fff5f5;
    border: 1px solid #ffcdd2;
    color: var(--error);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}

/* Success Modal */
.success-content {
    text-align: center;
}

.success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    font-size: 32px;
    margin-bottom: 16px;
}

.success-content p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Footer */
.footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    padding: 20px;
    text-align: center;
    margin-top: auto;
}

.footer p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

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

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

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-links a {
    font-size: 13px;
    color: var(--text-muted);
}

/* Event Join Page */
.join-container {
    max-width: 440px;
    margin: 40px auto;
    padding: 0 20px;
}

.join-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 32px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.join-card h1 {
    font-size: 24px;
    margin-bottom: 8px;
}

.join-card .subtitle {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.code-input {
    font-size: 24px !important;
    text-align: center;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

/* Event Details */
.event-details {
    text-align: left;
    margin-top: 24px;
}

.event-info-card {
    background: var(--background);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.event-info-card h2 {
    font-size: 20px;
    margin-bottom: 4px;
}

.event-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.event-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.event-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Participants List */
.participants-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.participants-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.participant-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--background);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
}

.participant-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

/* Wishlists in Event */
.wishlists-section {
    margin-top: 24px;
}

.wishlists-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.wishlist-link-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    margin-bottom: 8px;
    transition: border-color 0.2s;
}

.wishlist-link-card:hover {
    border-color: var(--primary);
}

.wishlist-link-icon {
    font-size: 24px;
}

.wishlist-link-details {
    flex: 1;
}

.wishlist-link-title {
    font-weight: 600;
    font-size: 15px;
}

.wishlist-link-owner {
    font-size: 13px;
    color: var(--text-muted);
}

.wishlist-link-arrow {
    color: var(--text-muted);
    font-size: 18px;
}

/* ItemPriority.wouldLove (raw value 2) */
.priority-would-love {
    background: #fce4ec;
    color: #c2185b;
}

/* The spoiler gate: shown in place of, or above, any claim state */
.owner-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff8e1;
    border: 1px solid #ffe0b2;
    color: #8d6e00;
    padding: 14px 16px;
    border-radius: 12px;
    margin: 16px 20px 0;
    font-size: 14px;
}

.owner-notice-icon {
    font-size: 20px;
}

.owner-notice-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

/* A button that sits inside a paragraph of text rather than in a button row */
.button-inline {
    padding: 8px 14px;
    font-size: 14px;
    width: auto;
}

/* Small line above the claim buttons: "Claimed by you", or a group gift's
   contributor count on a claim that is not the visitor's. */
.claim-mine-label,
.claim-note {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.archived-notice {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
}

.archived-notice h2 {
    font-size: 18px;
    margin-bottom: 8px;
}

.archived-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
}

.section-note {
    font-size: 14px;
    color: var(--text-secondary);
}

/* One claimed gift on /claims/ */
.claim-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.claim-card-title {
    font-size: 17px;
    margin-bottom: 4px;
}

.claim-card-context {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* An unpurchased claim expires and the gift returns to the wishlist */
.claim-card-warning {
    font-size: 14px;
    color: #b26a00;
    margin-top: 8px;
}

.claim-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.item-hero-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.error-app-link {
    margin-top: 12px;
}

/* Responsive */
@media (max-width: 600px) {
    .items-grid {
        grid-template-columns: 1fr;
    }

    .wishlist-header h1 {
        font-size: 24px;
    }

    .modal-content {
        padding: 24px;
    }
}
