/* styles.css */
/* Gift Registry Styles */
/* Date: 2025-02-04 */

:root {
    --navy: #1a365d;
    --navy-light: #2c5282;
    --navy-dark: #0f2442;
    --accent: #4299e1;
    --accent-light: #63b3ed;
    --success: #48bb78;
    --warning: #ed8936;
    --danger: #f56565;
    --gray-50: #f7fafc;
    --gray-100: #edf2f7;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e0;
    --gray-400: #a0aec0;
    --gray-500: #718096;
    --gray-600: #4a5568;
    --gray-700: #2d3748;
    --gray-800: #1a202c;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
    min-height: 100vh;
    color: var(--gray-700);
    line-height: 1.6;
}

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

/* Header */
.app-header {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    color: var(--white);
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}
.app-header h1 { font-size: 2rem; margin-bottom: 10px; font-weight: 700; }
.app-header p { opacity: 0.9; max-width: 600px; margin: 0 auto; }

/* Navigation */
.nav-bar {
    background: var(--white);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-user { display: flex; align-items: center; gap: 15px; }
.nav-user span { color: var(--gray-600); }
.nav-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-light); transform: translateY(-1px); }
.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-300); }
.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #38a169; }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #e53e3e; }
.btn-outline { background: transparent; border: 2px solid var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-lg { padding: 14px 28px; font-size: 1.1rem; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 25px;
    margin-bottom: 20px;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--gray-200);
}
.card-title { font-size: 1.25rem; font-weight: 600; color: var(--navy); }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--gray-700); }
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}
.form-textarea { min-height: 100px; resize: vertical; }
.form-hint { font-size: 0.85rem; color: var(--gray-500); margin-top: 4px; }
.form-error { color: var(--danger); font-size: 0.85rem; margin-top: 4px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.form-checkbox { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.form-checkbox input { width: 18px; height: 18px; cursor: pointer; }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}
.modal-overlay.active .modal { transform: scale(1); }
.modal-lg { max-width: 700px; }
.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-title { font-size: 1.25rem; font-weight: 600; color: var(--navy); }
.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-400);
    padding: 5px;
    line-height: 1;
}
.modal-close:hover { color: var(--gray-600); }
.modal-body { padding: 25px; }
.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Registry Cards */
.registry-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.registry-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.registry-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.registry-card-header {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    color: var(--white);
    padding: 20px;
}
.registry-card-type {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
    margin-bottom: 5px;
}
.registry-card-title { font-size: 1.25rem; font-weight: 600; }
.registry-card-body { padding: 20px; }
.registry-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: var(--gray-600);
}
.registry-card-meta span { display: flex; align-items: center; gap: 5px; }
.registry-progress { margin-top: 15px; }
.progress-bar { height: 8px; background: var(--gray-200); border-radius: 4px; overflow: hidden; }
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success) 0%, var(--accent) 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}
.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-top: 8px;
}

/* Gift Items */
.gift-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.gift-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
}
.gift-card.claimed { opacity: 0.7; }
.gift-card-image { width: 100%; height: 180px; object-fit: cover; background: var(--gray-100); }
.gift-card-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-size: 3rem;
}
.gift-card-body { padding: 20px; }
.gift-card-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
    margin-bottom: 5px;
}
.gift-card-title { font-size: 1.1rem; font-weight: 600; color: var(--gray-800); margin-bottom: 8px; }
.gift-card-description {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.gift-card-price { font-size: 1.1rem; font-weight: 600; color: var(--navy); margin-bottom: 12px; }
.gift-card-quantity { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.quantity-badge { background: var(--gray-100); padding: 4px 10px; border-radius: 20px; font-size: 0.85rem; }
.quantity-badge.fulfilled { background: var(--success); color: var(--white); }
.gift-priority {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.priority-must_have { background: var(--danger); color: var(--white); }
.priority-high { background: var(--warning); color: var(--white); }
.priority-medium { background: var(--accent); color: var(--white); }
.priority-low { background: var(--gray-400); color: var(--white); }
.gift-card-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--gray-200);
}
.gift-card-actions .btn { flex: 1; }

/* Tabs */
.tabs { display: flex; border-bottom: 2px solid var(--gray-200); margin-bottom: 20px; overflow-x: auto; }
.tab {
    padding: 12px 24px;
    border: none;
    background: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: all 0.2s;
}
.tab:hover { color: var(--navy); }
.tab.active { color: var(--navy); border-bottom-color: var(--navy); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Stats Cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; margin-bottom: 25px; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 20px; text-align: center; box-shadow: var(--shadow); }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--navy); }
.stat-label { font-size: 0.85rem; color: var(--gray-500); margin-top: 5px; }

/* Charts */
.chart-container { background: var(--white); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.chart-title { font-size: 1rem; font-weight: 600; color: var(--gray-700); margin-bottom: 15px; }
.chart-bar-container { margin-bottom: 12px; }
.chart-bar-label { font-size: 0.85rem; color: var(--gray-600); margin-bottom: 4px; display: flex; justify-content: space-between; }
.chart-bar { height: 20px; background: var(--gray-200); border-radius: 10px; overflow: hidden; }
.chart-bar-fill { height: 100%; background: linear-gradient(90deg, var(--navy) 0%, var(--accent) 100%); border-radius: 10px; transition: width 0.5s ease; }

/* Share Section */
.share-section {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    color: var(--white);
    border-radius: var(--radius-lg);
    padding: 25px;
    margin-bottom: 20px;
}
.share-section h3 { margin-bottom: 15px; }
.share-link-box { display: flex; gap: 10px; margin-bottom: 15px; }
.share-link-input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: rgba(255,255,255,0.9);
}
.share-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.share-btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s;
}
.share-btn:hover { transform: translateY(-2px); }
.share-email { background: var(--gray-700); color: var(--white); }
.share-facebook { background: #1877f2; color: var(--white); }
.share-twitter { background: #1da1f2; color: var(--white); }
.share-whatsapp { background: #25d366; color: var(--white); }

/* Filter/Sort Bar */
.filter-bar {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.filter-bar label { font-weight: 500; color: var(--gray-600); }
.filter-bar select { padding: 8px 12px; border: 1px solid var(--gray-300); border-radius: var(--radius); font-size: 0.9rem; }
.search-box { flex: 1; min-width: 200px; position: relative; }
.search-box input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9rem;
}
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gray-400); }

/* Claims Table */
.claims-table { width: 100%; border-collapse: collapse; }
.claims-table th, .claims-table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid var(--gray-200); }
.claims-table th { background: var(--gray-50); font-weight: 600; color: var(--gray-700); }
.claims-table tr:hover { background: var(--gray-50); }

/* Empty State */
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray-500); }
.empty-state-icon { font-size: 4rem; margin-bottom: 20px; }
.empty-state h3 { font-size: 1.25rem; margin-bottom: 10px; color: var(--gray-700); }

/* Toast Notifications */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast {
    background: var(--white);
    border-radius: var(--radius);
    padding: 15px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-info { border-left: 4px solid var(--accent); }

/* Landing Page */
.landing-hero { text-align: center; padding: 60px 20px; }
.landing-hero h2 { font-size: 2.5rem; color: var(--navy); margin-bottom: 20px; }
.landing-hero p { font-size: 1.2rem; color: var(--gray-600); max-width: 600px; margin: 0 auto 30px; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; margin-top: 50px; }
.feature-card { background: var(--white); border-radius: var(--radius-lg); padding: 30px; text-align: center; box-shadow: var(--shadow); }
.feature-icon { font-size: 3rem; margin-bottom: 15px; }
.feature-card h3 { color: var(--navy); margin-bottom: 10px; }
.feature-card p { color: var(--gray-600); font-size: 0.95rem; }

/* Footer */
.app-footer { text-align: center; padding: 30px 20px; margin-top: 40px; border-top: 1px solid var(--gray-200); }
.footer-link { display: inline-flex; align-items: center; gap: 8px; color: var(--gray-600); text-decoration: none; font-size: 0.9rem; }
.footer-link:hover { color: var(--navy); }
.footer-link img { width: 16px; height: 16px; }

/* Loading Spinner */
.spinner { width: 40px; height: 40px; border: 4px solid var(--gray-200); border-top-color: var(--navy); border-radius: 50%; animation: spin 1s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Data notice */
.data-notice {
    background: var(--gray-100);
    border-left: 4px solid var(--accent);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.9rem;
    color: var(--gray-600);
}
.data-notice strong { color: var(--gray-800); }

/* Responsive */
@media (max-width: 768px) {
    .app-header h1 { font-size: 1.5rem; }
    .landing-hero h2 { font-size: 1.75rem; }
    .nav-bar { flex-direction: column; text-align: center; }
    .modal { margin: 10px; max-height: calc(100vh - 20px); }
    .share-link-box { flex-direction: column; }
    .gift-grid { grid-template-columns: 1fr; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .tabs { justify-content: flex-start; }
    .claims-table { font-size: 0.85rem; }
    .claims-table th, .claims-table td { padding: 8px 10px; }
}

/* Print styles */
@media print {
    .nav-bar, .app-footer, .btn, .filter-bar, .share-section { display: none !important; }
    .gift-card { break-inside: avoid; box-shadow: none; border: 1px solid var(--gray-300); }
}

/* Accessibility */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
