* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(to bottom, #e8eaf6 0%, #f5f5f5 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Flash Messages */
.flash-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

.flash-message {
    padding: 15px 40px 15px 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.flash-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.flash-danger {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.flash-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.flash-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.flash-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.flash-close:hover {
    opacity: 1;
}

/* Login Page Styles */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border-top: 3px solid #5e72e4;
}

.login-container h1 {
    text-align: center;
    color: #5e72e4;
    margin-bottom: 10px;
    font-size: 28px;
    font-weight: 600;
}

.login-container p {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #5e72e4;
    box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.1);
}

.btn {
    width: 100%;
    padding: 12px;
    background: #5e72e4;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:hover {
    background: #4c5fd5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(94, 114, 228, 0.3);
}

/* Dashboard Styles */
.dashboard {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border-top: 3px solid #5e72e4;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.header h1 {
    color: #5e72e4;
    font-size: 28px;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    color: #666;
    font-weight: 500;
}

.btn-logout {
    padding: 8px 20px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-logout:hover {
    background: #d32f2f;
    transform: translateY(-1px);
}

/* Stats Section */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-left: 4px solid #5e72e4;
    color: #1a1a1a;
    padding: 25px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.stat-card.groom {
    border-left-color: #5e72e4;
    background: linear-gradient(to right, #f8f9ff 0%, #ffffff 100%);
}

.stat-card.bride {
    border-left-color: #f093fb;
    background: linear-gradient(to right, #fef5ff 0%, #ffffff 100%);
}

.stat-card.likely {
    border-left-color: #4facfe;
    background: linear-gradient(to right, #f0faff 0%, #ffffff 100%);
}

.stat-label {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.stat-value {
    font-size: 36px;
    font-weight: 600;
    color: #1a1a1a;
}

/* Add Guest Button Section */
.add-guest-button-section {
    margin-bottom: 30px;
}

.btn-add-guest {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s;
}

.btn-add-guest:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-add-guest svg {
    width: 20px;
    height: 20px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #f0f0f0;
}

.modal-header h2 {
    color: #1a1a1a;
    font-size: 22px;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 25px;
}

.modal-form-group {
    margin-bottom: 20px;
}

.modal-form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-size: 14px;
    font-weight: 500;
}

.modal-form-group input,
.modal-form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

.modal-form-group input:focus,
.modal-form-group select:focus {
    outline: none;
    border-color: #5e72e4;
    box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.1);
}

.modal-form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 25px;
    border-top: 2px solid #f0f0f0;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.btn-modal-cancel {
    padding: 10px 20px;
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-modal-cancel:hover {
    background: #4b5563;
}

.btn-modal-submit {
    padding: 10px 20px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-modal-submit:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Guest List Header with Export Button */
.guest-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.guest-list-section h2 {
    color: #1a1a1a;
    font-size: 18px;
    font-weight: 600;
}

.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #5e72e4;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-export:hover {
    background: #4c5fd5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(94, 114, 228, 0.3);
}

.btn-export svg {
    width: 16px;
    height: 16px;
}

/* Search and Filter Section */
.search-filter-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #5e72e4;
    box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.1);
}

.filter-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-controls select {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-controls select:focus {
    outline: none;
    border-color: #5e72e4;
    box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.1);
}

.btn-clear-filters {
    padding: 10px 20px;
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-clear-filters:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

/* Guest List Table */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-radius: 6px;
    overflow: hidden;
}

thead {
    background: #f8f9fa;
}

th {
    padding: 15px;
    text-align: left;
    color: #1a1a1a;
    font-weight: 600;
    border-bottom: 2px solid #e0e0e0;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Sortable table headers */
th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background 0.2s;
}

th.sortable:hover {
    background: #e8eaf6;
}

.sort-icon {
    font-size: 12px;
    color: #999;
    margin-left: 5px;
}

th.sortable.asc .sort-icon {
    color: #5e72e4;
}

th.sortable.asc .sort-icon::after {
    content: ' ↑';
    font-weight: bold;
}

th.sortable.desc .sort-icon {
    color: #5e72e4;
}

th.sortable.desc .sort-icon::after {
    content: ' ↓';
    font-weight: bold;
}

td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

tbody tr:hover {
    background: #f8f9fa;
}

tbody tr:last-child td {
    border-bottom: none;
}

.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.badge.groom {
    background: #e0e7ff;
    color: #4338ca;
}

.badge.bride {
    background: #fce7f3;
    color: #be185d;
}

.badge.likely {
    background: #d1fae5;
    color: #065f46;
}

.badge.unlikely {
    background: #fef3c7;
    color: #92400e;
}

.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-edit, .btn-delete, .btn-save, .btn-cancel {
    padding: 6px 14px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-edit {
    background: #60a5fa;
    color: white;
}

.btn-save {
    background: #10b981;
    color: white;
}

.btn-cancel {
    background: #6b7280;
    color: white;
}

.btn-delete {
    background: #f87171;
    color: white;
}

.btn-edit:hover {
    background: #3b82f6;
    transform: translateY(-1px);
}

.btn-save:hover {
    background: #059669;
    transform: translateY(-1px);
}

.btn-cancel:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

.btn-delete:hover {
    background: #ef4444;
    transform: translateY(-1px);
}

/* Edit Mode Styles */
.edit-input {
    padding: 6px;
    border: 2px solid #5e72e4;
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state p {
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .dashboard {
        padding: 20px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .header h1 {
        font-size: 24px;
    }

    .stats {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-value {
        font-size: 28px;
    }

    /* Add guest button mobile */
    .btn-add-guest {
        width: 100%;
        justify-content: center;
    }

    /* Modal mobile */
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header {
        padding: 15px 20px;
    }

    .modal-header h2 {
        font-size: 18px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-form-row {
        grid-template-columns: 1fr;
    }

    .modal-footer {
        padding: 15px 20px;
    }

    /* Guest list header on mobile */
    .guest-list-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-export {
        width: 100%;
        justify-content: center;
    }

    /* Search and filter mobile */
    .search-filter-section {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        width: 100%;
    }

    .filter-controls {
        width: 100%;
        flex-direction: column;
    }

    .filter-controls select,
    .btn-clear-filters {
        width: 100%;
    }

    /* Table responsiveness */
    table {
        font-size: 13px;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    th, td {
        padding: 12px 8px;
    }

    .action-buttons {
        flex-direction: row;
        gap: 5px;
    }

    .btn-edit, .btn-delete, .btn-save, .btn-cancel {
        font-size: 11px;
        padding: 5px 10px;
    }

    /* Login page mobile */
    .login-container {
        margin: 50px auto;
        padding: 30px 20px;
    }
}

/* iPhone specific optimizations */
@media (max-width: 430px) {
    .stats {
        grid-template-columns: 1fr;
    }

    .guest-list-section h2 {
        font-size: 16px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 10px 6px;
    }

    .badge {
        font-size: 10px;
        padding: 4px 8px;
    }
}