* {
    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(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
}

h1 {
    color: #667eea;
    margin-bottom: 30px;
    text-align: center;
    font-size: 2em;
}

h2 {
    color: #555;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

h3 {
    color: #666;
    margin-bottom: 15px;
}

/* Form Sections */
.form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

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

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Attendee Items */
.attendee-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    position: relative;
}

.attendee-item .btn-remove {
    position: absolute;
    top: 10px;
    right: 10px;
}

/* Room Items */
.room-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: 6px;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
}

.room-item label {
    font-weight: 500;
    color: #555;
    flex: 1;
}

.room-item input {
    width: 80px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

/* Total Section */
.total-section {
    background: #667eea;
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin: 30px 0;
}

.total-section h3 {
    color: white;
    margin: 0;
    font-size: 1.5em;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-remove, .btn-small {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

.btn-secondary:hover {
    background: #5a6268;
}

.btn-remove {
    background: #dc3545;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
}

.btn-remove:hover {
    background: #c82333;
}

.btn-small {
    background: #667eea;
    color: white;
    padding: 6px 12px;
    font-size: 14px;
    margin: 2px;
}

.btn-small:hover {
    background: #5568d3;
}

.btn-confirm {
    background: #28a745;
}

.btn-confirm:hover {
    background: #218838;
}

.btn-pending {
    background: #ffc107;
    color: #333;
}

.btn-pending:hover {
    background: #e0a800;
}

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

.form-actions button,
.form-actions a {
    margin: 0 10px;
}

/* Success Message */
.success-message {
    text-align: center;
    padding: 30px;
}

.success-message h2 {
    color: #28a745;
    border: none;
}

.link-container {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.link-container input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

/* Result Display */
.result-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.info-item {
    padding: 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.info-item.highlight {
    background: #fff3cd;
    border-color: #ffc107;
}

.info-item label {
    font-weight: 600;
    color: #555;
    display: block;
    margin-bottom: 5px;
}

.info-item span {
    color: #333;
}

.amount {
    font-size: 1.2em;
    font-weight: bold;
    color: #667eea;
}

/* Status Badge */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    display: inline-block;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

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

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.data-table thead {
    background: #667eea;
    color: white;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table.admin-table {
    font-size: 14px;
}

.data-table.admin-table th,
.data-table.admin-table td {
    padding: 10px;
}

.action-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #667eea;
}

/* Error Message */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    text-align: center;
}

/* Admin Controls */
.admin-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Statistics */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #667eea;
}

.stat-item label {
    display: block;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
}

.stat-item span {
    font-size: 1.5em;
    color: #667eea;
    font-weight: bold;
}

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

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section p {
    margin-bottom: 8px;
}

/* Activity Info Display */
.activity-info {
    text-align: center;
}

.activity-description {
    line-height: 1.6;
}

/* Table Wrapper for Horizontal Scroll */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Responsive */
@media (max-width: 1024px) {
    .container {
        padding: 25px;
    }

    .admin-controls {
        gap: 8px;
    }

    .btn-primary, .btn-secondary, .btn-remove {
        padding: 10px 18px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
        border-radius: 8px;
    }

    h1 {
        font-size: 1.5em;
        margin-bottom: 20px;
    }

    h2 {
        font-size: 1.3em;
    }

    h3 {
        font-size: 1.1em;
    }

    .form-section {
        padding: 15px;
        margin-bottom: 20px;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .stats-section {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .stat-item {
        padding: 15px;
    }

    .link-container {
        flex-direction: column;
    }

    /* Table Responsive */
    .data-table {
        font-size: 11px;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .data-table thead,
    .data-table tbody,
    .data-table tr {
        display: table;
        width: 100%;
        table-layout: fixed;
    }

    .data-table th,
    .data-table td {
        padding: 6px 4px;
        font-size: 11px;
    }

    /* Admin controls - stack buttons */
    .admin-controls {
        flex-direction: column;
    }

    .admin-controls button,
    .admin-controls a {
        width: 100%;
        text-align: center;
        margin: 0;
    }

    /* Room items - vertical layout */
    .room-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .room-item input {
        width: 100%;
    }

    /* Attendee item - adjust delete button */
    .attendee-item {
        padding: 15px 15px 50px 15px;
    }

    .attendee-item .btn-remove {
        position: static;
        width: 100%;
        margin-top: 10px;
    }

    /* Modal - full screen on mobile */
    .modal-content {
        max-width: 95%;
        max-height: 90vh;
        padding: 20px;
        margin: 20px;
    }

    .modal-close {
        font-size: 24px;
        top: 10px;
        right: 15px;
    }

    /* Buttons - ensure touch targets */
    .btn-primary, .btn-secondary, .btn-remove {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
    }

    .btn-small {
        padding: 8px 12px;
        font-size: 12px;
        min-height: 36px;
    }

    .form-actions button,
    .form-actions a {
        display: block;
        width: 100%;
        margin: 10px 0;
    }

    /* Action buttons in table */
    .action-buttons {
        flex-direction: column;
        gap: 4px;
    }

    .action-buttons .btn-small {
        width: 100%;
    }

    /* Total section */
    .total-section {
        padding: 15px;
    }

    .total-section h3 {
        font-size: 1.2em;
    }

    /* Breakdown section */
    .breakdown-section {
        font-size: 14px;
    }

    .breakdown-item {
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
    }

    .container {
        padding: 12px;
    }

    h1 {
        font-size: 1.3em;
    }

    .form-group input,
    .form-group select {
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .data-table {
        font-size: 10px;
    }

    .data-table th,
    .data-table td {
        padding: 4px 2px;
    }

    .stat-item {
        padding: 12px;
    }

    .stat-item span {
        font-size: 1.3em;
    }

    .info-item {
        padding: 10px;
    }

    .amount {
        font-size: 1.1em;
    }

    /* Smaller modal on very small screens */
    .modal-content {
        padding: 15px;
        margin: 10px;
    }
}
