/* Modern CSS Reset & Variable Design */
:root {
    --bg-primary: #0a0410;
    --bg-secondary: #140822;
    --bg-card: rgba(30, 15, 50, 0.45);
    --border-color: rgba(255, 75, 114, 0.15);
    --border-glass: rgba(255, 255, 255, 0.08);
    
    --primary: #ff4785;
    --primary-hover: #ff2e72;
    --secondary: #903df5;
    --secondary-hover: #7b29e0;
    
    --success: #00e699;
    --warning: #ffb700;
    --danger: #ff3b3b;
    
    --text-primary: #f5f0fb;
    --text-muted: #a596bd;
    --font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: radial-gradient(circle at 50% 0%, #200938 0%, var(--bg-primary) 80%);
    color: var(--text-primary);
    font-family: var(--font-family);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Header / Navigation */
header {
    background: rgba(10, 4, 16, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 2rem;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.logo-heart {
    display: inline-block;
    color: var(--primary);
    animation: pulse 1.5s infinite;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
}

.user-badge strong {
    color: var(--primary);
}

.btn-logout {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.btn-logout:hover {
    color: var(--danger);
}

/* Container & Layout */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 1rem;
    flex: 1;
}

/* Glassmorphism Card System */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Auth Cards */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 150px);
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 71, 133, 0.1) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.auth-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-align: center;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    text-align: center;
    margin-bottom: 2rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-weight: 600;
}

.form-control {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(255, 71, 133, 0.2);
    background: rgba(0, 0, 0, 0.4);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.9rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 71, 133, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 71, 133, 0.5);
    background: linear-gradient(135deg, var(--primary-hover), var(--secondary-hover));
}

.btn-primary:active {
    transform: translateY(0);
}

.error-message {
    background: rgba(255, 59, 59, 0.15);
    border: 1px solid rgba(255, 59, 59, 0.3);
    color: #ff8080;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Member Inputs (Registration) */
.member-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Dashboard Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Tabs Design */
.tab-navigation {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0.5rem;
    overflow-x: auto;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 4px 10px rgba(255, 71, 133, 0.25);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

/* Debit List & Item Card Styles */
.debit-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.no-debits {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-glass);
    border-radius: 16px;
    font-style: italic;
}

.debit-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.debit-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    border-color: rgba(255, 75, 114, 0.3);
}

.debit-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.debit-title-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.debit-qty {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-weight: 800;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(255, 71, 133, 0.3);
}

/* Tooltip implementation */
.encoded-kind {
    font-weight: 700;
    color: #ffd27f;
    border-bottom: 1px dotted #ffd27f;
    cursor: help;
    position: relative;
    display: inline-block;
}

.encoded-kind .tooltip-text {
    visibility: hidden;
    width: 220px;
    background-color: #1a0b2d;
    color: var(--text-primary);
    text-align: center;
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--primary);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    font-size: 0.8rem;
    font-weight: 500;
    
    /* Position the tooltip */
    position: absolute;
    z-index: 10;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}

.encoded-kind:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

.debit-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}

.debit-reason {
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 1rem;
    background: rgba(0, 0, 0, 0.15);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--secondary);
}

.debit-status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.debit-status-badge.pending {
    background: rgba(255, 183, 0, 0.15);
    border: 1px solid rgba(255, 183, 0, 0.3);
    color: var(--warning);
}

.debit-status-badge.paid {
    background: rgba(0, 230, 153, 0.15);
    border: 1px solid rgba(0, 230, 153, 0.3);
    color: var(--success);
}

/* Action Area Inside Debit Cards */
.debit-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Pay Form inside Card */
.payment-request-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
}

.payment-request-form input {
    flex: 1;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s ease;
}

.btn-small-success {
    background: var(--success);
    color: #053322;
    border: none;
}

.btn-small-success:hover {
    background: #00c985;
}

.btn-small-danger {
    background: var(--danger);
    color: white;
    border: none;
}

.btn-small-danger:hover {
    background: #e02a2a;
}

/* Mini Notification Badge for Tabs */
.tab-badge {
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    margin-left: 0.4rem;
}

/* Pending Requests Display */
.pending-request-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 0.8rem;
}

.request-claim-text {
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    border-left: 2px solid var(--primary);
    margin-top: 0.5rem;
    margin-bottom: 0.8rem;
}

/* Rejection / Opposition Style */
.rejection-history-card {
    border-left: 4px solid var(--danger);
}

.rejection-bubble {
    background: rgba(255, 59, 59, 0.08);
    border: 1px solid rgba(255, 59, 59, 0.15);
    border-radius: 8px;
    padding: 0.8rem;
    margin-top: 0.8rem;
    font-size: 0.9rem;
}

.rejection-title {
    color: #ff8080;
    font-weight: 700;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Add member dynamic button */
.btn-add-member {
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed var(--border-glass);
    color: var(--text-muted);
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-add-member:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
    }
}

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

/* Responsive tweaks */
@media (max-width: 600px) {
    .member-input-row {
        grid-template-columns: 1fr;
    }
    .payment-request-form {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: rgba(30, 15, 50, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--primary);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 320px;
    max-width: 450px;
    pointer-events: auto;
    animation: slideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

