/* Global 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: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

/* Guest RSVP Page */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-align: center;
    color: #2c3e50;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #34495e;
}

.subtitle {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 30px;
}

#loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.error-message {
    background: #fee;
    border: 2px solid #fcc;
    color: #c33;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.success-message {
    text-align: center;
    padding: 40px 20px;
}

.success-message h2 {
    color: #27ae60;
    margin-bottom: 10px;
}

/* Form Elements */
.member-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    background: #f9f9f9;
}

.member-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #2c3e50;
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1rem;
}

.radio-label input[type="radio"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.radio-label span {
    color: #555;
}

.form-actions {
    margin-top: 30px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #3498db;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px 10px;
    transition: transform 0.2s;
}

.btn-icon:hover {
    transform: scale(1.2);
}

/* Admin Dashboard */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    background: white;
    padding: 20px 30px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.admin-header h1 {
    margin: 0;
    font-size: 1.8rem;
    text-align: left;
}

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

.header-actions .btn {
    width: auto;
}

/* Stats Bar */
.stats-bar {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
}

/* Families List */
.families-list {
    display: grid;
    gap: 20px;
}

.family-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.family-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.family-header h3 {
    margin: 0;
    font-size: 1.4rem;
    color: #2c3e50;
}

.family-actions {
    display: flex;
    gap: 5px;
}

.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.member-badge {
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-pending {
    background: #f39c12;
    color: white;
}

.status-yes {
    background: #27ae60;
    color: white;
}

.status-no {
    background: #e74c3c;
    color: white;
}

.status {
    font-weight: 700;
    font-size: 1rem;
}

.family-link {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ecf0f1;
}

.family-link small {
    color: #7f8c8d;
    font-size: 0.85rem;
    word-break: break-all;
}

.loading, .empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.error {
    color: #e74c3c;
}

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

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

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

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #7f8c8d;
    line-height: 1;
}

.close-btn:hover {
    color: #2c3e50;
}

#family-form {
    padding: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #3498db;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
}

.member-input {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 6px;
}

.member-input input[type="text"] {
    flex: 1;
    min-width: 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    white-space: nowrap;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 5px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
}

.modal-actions .btn {
    width: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .card {
        padding: 30px 20px;
    }

    h1 {
        font-size: 2rem;
    }

    .admin-header {
        flex-direction: column;
        gap: 15px;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
    }

    .header-actions .btn {
        width: 100%;
    }

    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .member-input {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-content {
        width: 95%;
    }
}
