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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.app-title {
    font-size: 2rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.event-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    font-size: 1rem;
    margin-top: 5px;
}

.event-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.event-info-item:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.event-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.event-family {
    font-weight: 600;
}

.event-name {
    font-weight: 500;
}

.event-date {
    font-weight: 400;
}

.btn-edit-setup {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-edit-setup:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.05);
}

/* Dashboard Summary */
.dashboard {
    padding: 30px;
    background: #fff;
}

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

.card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.card-primary {
    border-left: 5px solid #4CAF50;
}

.card-secondary {
    border-left: 5px solid #2196F3;
}

.card-tertiary {
    border-left: 5px solid #FF9800;
}

.card-icon {
    font-size: 3rem;
    line-height: 1;
}

.card-content h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.card-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
}

/* Form Section */
.form-section {
    padding: 30px;
    background: #fafafa;
    border-top: 1px solid #eee;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    font-size: 1.5rem;
    color: #333;
    font-weight: 600;
}

.donation-form {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 8px;
}

.form-group input,
.form-group select {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #ff6b6b;
}

/* Relation Buttons */
.relation-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.relation-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}

.relation-btn:hover {
    border-color: #ff6b6b;
    background: #fff8f8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.15);
}

.relation-btn.active {
    border-color: #ff6b6b;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.relation-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.relation-text {
    font-size: 0.85rem;
    font-weight: 500;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

.btn-secondary {
    background: #f5f5f5;
    color: #666;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-edit {
    background: #2196F3;
    color: white;
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-edit:hover {
    background: #1976D2;
}

.btn-delete {
    background: #f44336;
    color: white;
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-delete:hover {
    background: #d32f2f;
}

/* List Section */
.list-section {
    padding: 30px;
    background: white;
}

.header-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
    flex: 1;
}

.search-box {
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #ff6b6b;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 15px 0;
    flex-wrap: wrap;
    gap: 15px;
}

.pagination-info {
    color: #666;
    font-size: 0.9rem;
}

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

.pagination-btn {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: inherit;
    min-width: 40px;
}

.pagination-btn:hover:not(:disabled) {
    border-color: #ff6b6b;
    background: #fff8f8;
}

.pagination-btn.active {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    border-color: #ff6b6b;
}

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

.pagination-dots {
    padding: 8px 4px;
    color: #999;
}

/* Table Actions */
.table-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.btn-backup {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    padding: 10px 20px;
    font-size: 0.9rem;
}

.btn-backup:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.btn-restore {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    padding: 10px 20px;
    font-size: 0.9rem;
}

.btn-restore:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.3);
}

.btn-csv {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: white;
    padding: 10px 20px;
    font-size: 0.9rem;
}

.btn-csv:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.3);
}

.table-container {
    overflow-x: auto;
    margin-top: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.donation-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.donation-table thead {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
}

.donation-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

.donation-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95rem;
}

.donation-table tbody tr {
    transition: background-color 0.2s ease;
}

.donation-table tbody tr:hover {
    background-color: #fff8f8;
}

.donation-table .actions {
    display: flex;
    gap: 8px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 1.1rem;
    display: none;
}

.empty-state.show {
    display: block;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.modal-header h2 {
    font-size: 1.5rem;
    color: #333;
}

.close {
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

.close-setup {
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.close-setup:hover {
    color: #ff6b6b;
}

/* Modal Setup */
.modal-setup {
    background-color: rgba(0, 0, 0, 0.8);
    padding: 20px;
}

.modal-setup-content {
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
}

.modal-setup-content::-webkit-scrollbar {
    width: 8px;
}

.modal-setup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-setup-content::-webkit-scrollbar-thumb {
    background: #ff6b6b;
    border-radius: 10px;
}

.modal-setup-content::-webkit-scrollbar-thumb:hover {
    background: #ee5a6f;
}

.modal-setup .modal-header {
    justify-content: center;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.modal-setup .modal-header h2 {
    font-size: 1.6rem;
    color: #ff6b6b;
}

.setup-description {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.modal-setup .form-group {
    text-align: left;
    margin-bottom: 15px;
}

.modal-setup .form-actions {
    margin-top: 20px;
    margin-bottom: 0;
}

.modal-setup .btn-primary {
    width: 100%;
    padding: 14px;
    font-size: 1.05rem;
}

.setup-divider {
    margin: 25px 0;
    text-align: center;
    position: relative;
}

.setup-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e0e0e0;
}

.setup-divider span {
    background: white;
    padding: 0 15px;
    color: #999;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

.setup-restore {
    text-align: center;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 10px;
    border: 2px dashed #e0e0e0;
}

.restore-description {
    color: #666;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.btn-restore-setup {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    padding: 11px 25px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-restore-setup:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.3);
}

/* Footer */
.footer {
    background: #f5f5f5;
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

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

    .container {
        border-radius: 15px;
    }

    .header {
        padding: 20px;
    }

    .app-title {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }

    .event-info {
        font-size: 0.85rem;
        gap: 8px;
        flex-direction: column;
        margin-bottom: 15px;
    }

    .event-info-item {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .event-icon {
        font-size: 1rem;
    }

    .btn-edit-setup {
        position: static;
        width: 100%;
        padding: 10px;
        font-size: 0.9rem;
        margin-top: 10px;
    }

    .dashboard,
    .form-section,
    .list-section {
        padding: 20px;
    }

    .summary-cards {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 20px;
    }

    .card-value {
        font-size: 1.5rem;
    }

    .donation-form {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .relation-buttons {
        gap: 8px;
    }

    .relation-btn {
        min-width: 100px;
        padding: 10px 12px;
    }

    .relation-icon {
        font-size: 1.3rem;
    }

    .relation-text {
        font-size: 0.8rem;
    }

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

    .btn {
        width: 100%;
    }

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

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

    .search-box {
        max-width: 100%;
        min-width: 100%;
    }

    .pagination-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .pagination-buttons {
        justify-content: center;
    }

    .pagination-btn {
        padding: 6px 10px;
        font-size: 0.85rem;
        min-width: 35px;
    }

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

    .btn-backup,
    .btn-restore,
    .btn-csv {
        width: 100%;
    }

    .donation-table {
        font-size: 0.85rem;
    }

    .donation-table th,
    .donation-table td {
        padding: 10px 8px;
    }

    .donation-table .actions {
        flex-direction: column;
        gap: 5px;
    }

    .btn-edit,
    .btn-delete {
        width: 100%;
        padding: 6px 12px;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .app-title {
        font-size: 1.3rem;
    }

    .card-icon {
        font-size: 2.5rem;
    }

    .section-header h2 {
        font-size: 1.3rem;
    }
}
