/* Mobile-First BNI Cotisations Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: #f5f7fa;
    color: #2d3748;
    padding-bottom: 2rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Mobile Header */
.mobile-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    padding: 1rem 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #334155;
}

.mobile-logo {
    display: flex;
    align-items: center;
}

.logo-image {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.mobile-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-title i {
    font-size: 1.5rem;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.header-actions .btn-link {
    padding: 0.5rem;
    font-size: 1.25rem;
    color: white !important;
    transition: all 0.2s;
    border-radius: 8px;
}

.header-actions .btn-link:hover,
.header-actions .btn-link:active {
    background: rgba(255, 255, 255, 0.2);
    text-decoration: none;
}

/* Date Selector */
.date-selector-container {
    background: white;
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid #e2e8f0;
}

.date-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.month-year-display {
    font-size: 1.125rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
    text-transform: capitalize;
}

.date-header .btn-link {
    color: #667eea;
    font-size: 1.25rem;
    padding: 0.5rem;
}

.date-header .btn-link:hover {
    color: #764ba2;
    text-decoration: none;
}

/* Week Days */
.week-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.week-day {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #718096;
    padding: 0.25rem;
}

.week-day:nth-child(2) {
    color: #234e52;
    font-weight: 700;
    background: #e6fffa;
    border-radius: 4px;
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: #2d3748;
    background: #f7fafc;
}

.calendar-day.empty {
    background: transparent;
    cursor: default;
}

.calendar-day:not(.empty):hover {
    background: #e6f0ff;
    transform: scale(1.05);
}

.calendar-day.today {
    background: #bee3f8;
    color: #2c5282;
    font-weight: 700;
}

.calendar-day.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.calendar-day.tuesday {
    background: #e6fffa;
    color: #234e52;
    border: 1px solid #b2f5ea;
}

.calendar-day.tuesday:hover {
    background: #b2f5ea;
}

.calendar-day.has-payment {
    background: #d6f5e3;
    color: #22543d;
    border: 2px solid #48bb78;
    font-weight: 700;
    position: relative;
}

.calendar-day.has-payment::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #48bb78;
    border-radius: 50%;
}

.calendar-day.has-payment:hover {
    background: #c6f6d5;
    border-color: #38a169;
}

.calendar-day.future {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: pointer;
    pointer-events: auto;
    opacity: 0.95;
}

.calendar-day.future:hover {
    transform: scale(1.03);
    background: #eef2f7;
}

/* Future Tuesdays: keep the Tuesday green look but slightly muted */
.calendar-day.future.tuesday {
    background: #e6fffa;
    color: #234e52;
    border: 1px solid #b2f5ea;
    opacity: 0.95;
}
.calendar-day.future.tuesday:hover {
    background: #b2f5ea;
    transform: scale(1.06);
}

/* Quick Actions */
.quick-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
}

.selected-date-display {
    font-size: 0.875rem;
    color: #4a5568;
    font-weight: 500;
    text-transform: capitalize;
}

/* Search Container */
.search-container {
    background: white;
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 60px;
    z-index: 90;
}

.search-bar {
    position: relative;
    margin-bottom: 0.75rem;
}

.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 1rem;
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 2.75rem 0.75rem 2.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.9375rem;
    transition: all 0.2s;
    background: #f7fafc;
}

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

.btn-clear {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: #e2e8f0;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-clear:hover {
    background: #cbd5e0;
}

/* Filter Info */
.filter-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.week-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    background: #0c0c0d;
    color: white;
    border-radius: .6rem;
    font-size: 0.8125rem;
    font-weight: 600;
}

.members-count {
    font-size: 0.8125rem;
    color: #718096;
    font-weight: 500;
}

/* Members Container */
.members-container {
    padding: 1rem 1rem;
}

/* Member Card */
.member-card {
    background: white;
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}

.member-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.member-card:hover::before,
.member-card:active::before {
    transform: scaleX(1);
}

.member-card:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Member Card Header */
.member-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.3rem;    
    border-bottom: 1px solid #f1f5f9;
}

.member-info {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.member-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.member-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.member-name {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.member-id {
    font-size: 0.75rem;
    color: #a0aec0;
    font-weight: 500;
}

/* Payment Status */
.payment-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.payment-status i {
    font-size: 1.5rem;
}

.payment-status span {
    font-weight: 700;
    letter-spacing: 0.5px;
}

.payment-status.paid i {
    color: #48bb78;
}

.payment-status.paid span {
    color: #48bb78;
}

.payment-status.not-paid i {
    color: #f56565;
}

.payment-status.not-paid span {
    color: #f56565;
}

/* Member Card Body */

.info-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.info-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;    
    background: #f7fafc;
    border-radius: 12px;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.info-item.clickable {
    cursor: pointer;
    position: relative;
}

.info-item.clickable::after {
    content: '\f054';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 0.75rem;
    opacity: 0;
    transition: all 0.2s;
}

.info-item.clickable:hover,
.info-item.clickable:active {
    background: #e6f0ff;
    border-color: #667eea;
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.info-item.clickable:hover::after {
    opacity: 1;
    right: 0.5rem;
}

.info-item.clickable:active {
    transform: scale(0.98);
}

.info-item i {
    font-size: 1.25rem;
    margin-top: 0.125rem;
}

.info-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.info-label {
    font-size: 0.75rem;
    color: #718096;
    font-weight: 500;
}

.info-value {
    font-size: 1rem;
    color: #2d3748;
}

/* Invitees Section */

.invitees-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.invitee-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3rem 0.75rem;
    background: #e6f0ff;
    color: #2c5282;
    border-radius: 0.625rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border: 1px solid #bee3f8;
}

.invitee-badge i {
    font-size: 0.75rem;
}

.invitee-remove {
    background: transparent;
    border: none;
    color: #e53e3e;
    cursor: pointer;
    padding: 0.125rem 0.25rem;
    margin-left: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.invitee-remove:hover {
    opacity: 1;
    background: #fed7d7;
    transform: scale(1.1);
}

.invitee-remove i {
    font-size: 0.875rem;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: #a0aec0;
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results p {
    font-size: 1rem;
    font-weight: 500;
}

/* Modal Styles */
.modal-dialog-bottom {
    margin: 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 100%;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.modal-dialog-bottom .modal-content {
    border-radius: 24px 24px 0 0;
    border: none;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid #e2e8f0;
    padding: 1.25rem 1.5rem;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 700;
}

.modal-header .close {
    color: #4a5568;
    opacity: 0.5;
}

.modal-header .close:hover {
    color: #2d3748;
    opacity: 1;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e2e8f0;
    padding: 1rem 1.5rem;
    display: flex;
    gap: 0.75rem;
}

.modal-footer .btn {
    flex: 1;
    padding: 0.75rem;
    border-radius: 12px;
    font-weight: 600;
    border: none;
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.modal-footer .btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.modal-footer .btn-danger {
    background: #f56565;
    color: white;
    flex: 0 0 auto;
    padding: 0.75rem 1rem;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.form-group .form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.9375rem;
    transition: all 0.2s;
    background: #f7fafc;
}

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

.form-group .form-control[readonly] {
    background: #f1f5f9;
    color: #718096;
    cursor: not-allowed;
}

/* Responsive Adjustments */
@media (max-width: 375px) {
    .member-card {
        padding: 1rem;
    }
    
    .info-item {
        padding: 0.5rem;
    }
    
    .info-item i {
        font-size: 1.1rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Touch Feedback */
@media (hover: none) and (pointer: coarse) {
    .calendar-day:active {
        transform: scale(0.95);
    }
    
    .info-item.clickable:active {
        transform: scale(0.98);
    }
    
    .info-item.clickable::after {
        opacity: 0.7;
    }
}

/* Modal Backdrop Override */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.6);
}

.modal-dialog-bottom .modal-content {
    border-radius: 24px 24px 0 0;
    border: none;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.modal.fade .modal-dialog-bottom {
    transition: transform 0.3s ease-out;
}

.modal.show .modal-dialog-bottom {
    transform: none;
}

/* iOS Safe Area */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    body {
        padding-bottom: calc(2rem + env(safe-area-inset-bottom));
    }
    
    .mobile-header {
        padding-top: max(1rem, env(safe-area-inset-top));
    }
}

/* Floating Action Button (Hidden - kept for reference) */
.fab {
    display: none;
}
