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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* Utility Classes */
.screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* Language Switcher */
.language-switcher {
    margin-right: 12px;
}

.language-select {
    padding: 6px 10px;
    font-size: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    color: #333;
    cursor: pointer;
    min-width: 120px;
}

.language-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

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

.login-header .language-switcher {
    margin: 0;
}

/* Attendee Header */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-actions .language-switcher {
    margin: 0;
}

/* Attendee List */
.attendees-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.attendee-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #f9f9f9;
}

.attendee-info {
    flex: 1;
}

.attendee-info strong {
    display: block;
    margin-bottom: 4px;
    color: #333;
}

.attendee-info span {
    color: #666;
    font-size: 14px;
}

.attendee-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.copy-link-btn {
    padding: 4px 8px;
    font-size: 11px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.copy-link-btn:hover {
    background-color: #218838;
}

.copy-link-btn:active {
    background-color: #1e7e34;
}


/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #0056b3;
    transform: translateY(-1px);
}

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

.btn-secondary:hover:not(:disabled) {
    background-color: #545b62;
}

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

.btn-success:hover:not(:disabled) {
    background-color: #1e7e34;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover:not(:disabled) {
    background-color: #e0a800;
}

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

.btn-danger:hover:not(:disabled) {
    background-color: #c82333;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 12px;
}

/* Login Screen */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    text-align: center;
    color: #007bff;
    margin-bottom: 10px;
    font-size: 28px;
}

.login-card h2 {
    text-align: center;
    color: #6c757d;
    margin-bottom: 30px;
    font-weight: 400;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #495057;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: #6c757d;
    font-size: 12px;
}

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

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

.header h1 {
    color: #007bff;
    font-size: 24px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.attendee-info {
    color: #6c757d;
    font-size: 14px;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.section h2 {
    margin-bottom: 20px;
    color: #495057;
}

/* Event Groups */
.event-group {
    margin-bottom: 48px;
}

.event-group:last-child {
    margin-bottom: 0;
}

.event-group-title {
    color: #495057;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

/* Events Grid */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.event-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    max-width: 350px;
    min-width: 349px;
}

.event-card:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.event-card h3 {
    color: #495057;
    margin-bottom: 8px;
}

.event-card p {
    color: #6c757d;
    margin-bottom: 12px;
    font-size: 14px;
}

.event-meta {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 24px;
    font-size: 12px;
    color: #6c757d;
}

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

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-draft { color: #6c757d; }
.status-published { color: #28a745; }
.status-archived { color: #ffc107; }

/* Event Details */
.event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.event-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.event-content {
    margin-top: 24px;
}

.event-info {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    background-color: #f8f9fa;
}

.event-info h2 {
    color: #495057;
    margin-bottom: 8px;
}

.event-info p {
    color: #6c757d;
    margin-bottom: 16px;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 24px;
    margin-top: 24px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: #007bff;
}

.tab-btn.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Attendees List */
.attendees-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.attendee-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.attendee-info h4 {
    color: #495057;
    margin-bottom: 4px;
}

.attendee-info p {
    color: #6c757d;
    font-size: 12px;
}

.attendee-actions {
    display: flex;
    gap: 4px;
}

/* Gift Groups */
.gift-group {
    margin-bottom: 40px;
}

.gift-group:last-child {
    margin-bottom: 0;
}

.gift-group-title {
    color: #495057;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

/* Gifts Grid */
.gifts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.gift-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
    position: relative;
}

.gift-card:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.gift-card.selected {
    border-color: #28a745;
    background-color: #f8fff9;
}

.gift-card.selected-by-other {
    border-color: #ffc107;
    background-color: #fffdf7;
    opacity: 0.7;
}

.gift-card h4 {
    color: #495057;
    margin-bottom: 8px;
}

.gift-price {
    color: #28a745;
    font-weight: 600;
    font-size: 18px;
    margin-bottom: 12px;
}

.gift-stores {
    margin-bottom: 16px;
}

.gift-stores h5 {
    color: #6c757d;
    font-size: 12px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gift-stores ul {
    list-style: none;
    padding: 0;
}

.gift-stores li {
    margin-bottom: 4px;
}

.gift-stores a {
    color: #007bff;
    text-decoration: none;
    font-size: 12px;
}

.gift-stores a:hover {
    text-decoration: underline;
}

.gift-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.gift-status {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.gift-status.available {
    background-color: #d4edda;
    color: #155724;
}

.gift-status.selected {
    background-color: #d1ecf1;
    color: #0c5460;
}

.gift-status.selected-by-other {
    background-color: #fff3cd;
    color: #856404;
}

/* Event Banner */
.event-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 40px;
    margin-bottom: 24px;
}

.event-banner .event-info h2 {
    color: white;
    margin-bottom: 8px;
}

.event-banner .event-info p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 16px;
}

.event-banner .event-meta {
    color: rgba(255, 255, 255, 0.8);
}

/* Selected Summary */
.selected-summary {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.selected-summary h3 {
    color: #155724;
    margin-bottom: 16px;
}

.selected-items-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.selected-item {
    background: white;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.selected-item h5 {
    color: #495057;
    margin-bottom: 4px;
}

.selected-item p {
    color: #6c757d;
    font-size: 12px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #dee2e6;
}

.empty-state h3 {
    color: #495057;
    margin-bottom: 8px;
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    color: #495057;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid #e9ecef;
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.loading-spinner {
    text-align: center;
    color: #007bff;
}

.loading-spinner i {
    font-size: 32px;
    margin-bottom: 16px;
}

.loading-spinner p {
    font-size: 16px;
    color: #6c757d;
}

/* Error Messages */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 6px;
    margin-top: 12px;
    border: 1px solid #f5c6cb;
}

.error-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.error-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.error-card i {
    font-size: 48px;
    color: #dc3545;
    margin-bottom: 16px;
}

.error-card h2 {
    color: #495057;
    margin-bottom: 12px;
}

.error-card p {
    color: #6c757d;
    margin-bottom: 24px;
}

/* Footer */
.footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    color: #6c757d;
    font-size: 14px;
    border-top: 1px solid #e9ecef;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
    }

    .main-content {
        padding: 16px;
    }

    .section {
        padding: 16px;
    }

    .events-grid {
        grid-template-columns: 1fr;
    }

    .gifts-grid {
        grid-template-columns: 1fr;
    }

    .attendees-list {
        grid-template-columns: 1fr;
    }

    .event-header {
        flex-direction: column;
        align-items: stretch;
    }

    .event-actions {
        justify-content: center;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1;
        min-width: 120px;
    }

    .modal-content {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }

    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .btn-sm {
        padding: 6px 10px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 24px;
    }

    .event-banner {
        padding: 24px 16px;
    }

    .selected-items-list {
        grid-template-columns: 1fr;
    }

    .gift-actions {
        flex-direction: column;
    }

    .gift-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .btn,
    .modal {
        display: none !important;
    }

    .main-content {
        padding: 0;
    }

    .section {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
