/* Base styles */
body {
    background-color: #f8f9fa;
    margin: 0;
    padding-top: 70px; /* to avoid overlap from fixed header */
    padding-bottom: 70px; /* to avoid overlap from fixed footer */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Invite card */
.invite-card {
    max-width: 700px;
    margin: 20px auto;
    padding: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

/* Logo */
.logo {
    max-width: 100px;
    margin-bottom: 20px;
}
a.logo-link {
    text-decoration: none;
}

/* Textarea */
.form-textarea {
    height: auto;
    min-height: 120px;
    resize: vertical;
}

/* Stats card */
.stats-card {
    max-width: 700px;
    margin: 20px auto 40px auto;
    padding: 20px 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-around;
    gap: 15px;
    font-weight: 600;
    flex-wrap: nowrap; /* prevent wrapping */
    overflow-x: auto;  /* allow horizontal scroll on small devices */
}

.stats-item {
    flex: 1 0 22%; /* roughly 4 cards in one row with some gap */
    min-width: 120px; /* ensure minimum size */
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    background-color: #f0f4f8;
}
.stats-item.pending {
    background-color: #fff3cd;
    color: #856404;
}
.stats-item.accepted {
    background-color: #d4edda;
    color: #155724;
}
.stats-item.expired {
    background-color: #e2e3e5;
    color: #6c757d;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #fff;
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1001;
}

/* Logo image styling */
.logo img {
    height: 40px;
    display: block;
}

/* Right side header group */
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Profile */
.profile-icon {
    width: auto;
    min-width: 36px;
    height: auto;
    padding: 4px 8px;
    background: #ccc;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}
.profile-icon img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}
.profile-icon div {
    font-size: 10px;
    color: #333;
    margin-top: 2px;
    text-align: center;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Profile Menu */
.profile-menu {
    display: none;
    position: absolute;
    top: 60px;
    right: 15px;
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 10px;
    width: 200px;
    z-index: 1002;
}
.profile-menu a {
    display: block;
    padding: 8px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
}
.profile-menu a:hover {
    background-color: #f0f0f0;
}

/* Footer */
.mobile-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 60px;
    z-index: 1000;
}
.mobile-footer a {
    text-align: center;
    flex: 1;
    font-size: 12px;
    color: #333;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.mobile-footer a i {
    font-size: 20px;
}
.mobile-footer a.active,
.mobile-footer a:hover {
    color: #007bff;
}

/* Footer Search Box */
#footerSearchBox {
    display: none;
    transition: all 0.3s ease;
    margin-top: 10px;
    padding: 10px;
    background-color: #f9f9f9;
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
}
#footerSearchBox.active {
    display: block;
}
#searchIcon {
    cursor: pointer;
    font-size: 20px;
    margin-left: 10px;
}

/* Responsive */
.stats-card {
    max-width: 700px;
    margin: 20px auto;
    padding: 15px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    font-weight: 600;
}

.stats-item {
    flex: 1 1 22%;
    min-width: 70px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stats-item .number {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 4px;
    line-height: 1;
}

.stats-item .label {
    font-size: 12px;
    font-weight: 500;
    color: #444;
}

/* Status-based colors */
.stats-item.pending {
    background-color: #fff3cd;
    color: #856404;
}
.stats-item.accepted {
    background-color: #d4edda;
    color: #155724;
}
.stats-item.expired {
    background-color: #e2e3e5;
    color: #6c757d;
}
.stats-item.total {
    background-color: #e0f0ff;
    color: #004085;
}
.stats-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    transition: all 0.2s ease;
}

/* Mobile Responsive */
@media (max-width: 576px) {
    .stats-item {
        flex: 1 1 45%;
        padding: 8px;
    }
    .stats-item .number {
        font-size: 26px;
    }
    .stats-item .label {
        font-size: 11px;
    }
    .stats-card {
        gap: 8px;
    }
}

@media (max-width: 768px) {
    .container {
        padding-left: 5px;
        padding-right: 5px;
    }

    .table-responsive {
        margin-left: 0;
        margin-right: 0;
        padding: 0;
    }

    table {
        width: 100%;
        table-layout: auto;
    }

    th, td {
        font-size: 11px;
        padding: 0.4rem;
        white-space: nowrap;
    }

    /* Compact columns for Sent At, Expiry, and Status */
    td:nth-child(2), td:nth-child(3), td:nth-child(4),
    th:nth-child(2), th:nth-child(3), th:nth-child(4) {
        width: 75px;
        text-align: center;
    }

    /* Email column fit */
    td:nth-child(1), th:nth-child(1) {
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    button.btn {
        font-size: 0.9rem;
        width: 100%;
    }

    h1, h4 {
        font-size: 1.4rem;
    }

    .form-label {
        font-size: 0.95rem;
    }

    .form-control {
        font-size: 0.9rem;
    }
}
