/* ===== DONOR PAGE STYLES ===== */

/* Page Background */
body {
    background-color: #f8fafc !important;
}

.main-content {
    background-color: #f8fafc !important;
    padding: 0 !important;
}

.hero-container {
    background-color: white !important;
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

.hero {
    background-color: white !important;
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    gap: 0 !important;
}

/* Banner Section */
.donor-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 50px 20px;
    text-align: center;
    margin-bottom: 0;
    margin-left: calc(-1 * (100vw - 100%) / 2);
    margin-right: calc(-1 * (100vw - 100%) / 2);
    width: 100vw;
    max-width: 100vw;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.donor-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    animation: bep-float 20s ease-in-out infinite;
}

.donor-banner::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: bep-float-reverse 25s ease-in-out infinite;
}

@keyframes bep-float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(-30px, -30px) rotate(180deg);
    }
}

@keyframes bep-float-reverse {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(30px, 30px) rotate(-180deg);
    }
}

.banner-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.banner-title {
    font-size: 42px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.banner-title i {
    font-size: 38px;
}

.banner-subtitle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.6;
    margin-bottom: 0;
}

/* Summary Cards Section */
.summary-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 30px;
    padding: 30px clamp(20px, 5%, 64px) 25px;
    border-bottom: 2px solid #e5e7eb;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.summary-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    animation: slideInUp 0.6s ease-out backwards;
    justify-content: center;
}

.summary-card:nth-child(1) { animation-delay: 0.1s; }
.summary-card:nth-child(2) { animation-delay: 0.2s; }
.summary-card:nth-child(3) { animation-delay: 0.3s; }
.summary-card:nth-child(4) { animation-delay: 0.4s; }

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

.summary-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: transparent;
    border: 2px solid #e5e7eb;
    color: #667eea;
    flex-shrink: 0;
}

.summary-info {
    flex: 1;
}

.summary-info h3 {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 2px 0;
}

.summary-info p {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* Filters Section */
.filters-section {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 25px clamp(20px, 5%, 64px);
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 30px;
    flex-wrap: nowrap;
    background: transparent;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    justify-content: space-between;
}

.filter-group {
    flex: 0 0 auto;
    min-width: 200px;
}

.filter-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.filter-group label i {
    color: #667eea;
    margin-right: 5px;
}

.filter-group select {
    width: 100%;
    padding: 12px 15px;
    border: none;
    border-bottom: 2px solid #e5e7eb;
    border-radius: 0;
    font-size: 14px;
    color: #1f2937;
    background-color: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-group select:focus {
    outline: none;
    border-bottom-color: #667eea;
}

.view-toggle {
    display: flex;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.toggle-btn {
    padding: 10px 18px;
    border: 2px solid #e5e7eb;
    background: #ffffff;
    color: #6b7280;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.toggle-btn:hover {
    border-color: #667eea;
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.toggle-btn.active {
    border-color: #667eea;
    background: #667eea;
    color: #ffffff;
}

/* Donor Cards Grid */
.donors-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 30px;
    padding: 0 clamp(20px, 5%, 64px);
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.donor-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    animation: fadeIn 0.6s ease-out backwards;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.donor-card:nth-child(1) { animation-delay: 0.1s; }
.donor-card:nth-child(2) { animation-delay: 0.15s; }
.donor-card:nth-child(3) { animation-delay: 0.2s; }
.donor-card:nth-child(4) { animation-delay: 0.25s; }
.donor-card:nth-child(5) { animation-delay: 0.3s; }
.donor-card:nth-child(6) { animation-delay: 0.35s; }
.donor-card:nth-child(7) { animation-delay: 0.4s; }
.donor-card:nth-child(8) { animation-delay: 0.45s; }

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

.donor-card:hover {
    border-color: #667eea;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.15);
    transform: translateY(-8px);
}

.donor-card-header {
    position: relative;
    padding: 0;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.donor-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 4px solid #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.donor-flag {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.donor-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.donor-card-body {
    padding: 20px;
}

.donor-name {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 12px 0;
    text-align: center;
}

.donor-country,
.donor-service {
    font-size: 14px;
    color: #6b7280;
    margin: 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.donor-country i,
.donor-service i {
    color: #667eea;
    font-size: 13px;
}

.donor-amount {
    margin: 15px 0;
    padding: 15px;
    background: transparent;
    border-top: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
    text-align: center;
}

.amount-label {
    font-size: 12px;
    color: #9ca3af;
    display: block;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.amount-value {
    font-size: 28px;
    font-weight: 700;
    color: #10b981;
}

.donor-date {
    font-size: 13px;
    color: #9ca3af;
    text-align: center;
    margin-top: 12px;
}

.donor-date i {
    margin-right: 5px;
}

.donor-card-footer {
    padding: 0 20px 20px;
}

.view-details-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: #ffffff;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.view-details-btn:hover {
    background: #5568d3;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.view-details-btn i {
    margin-right: 6px;
}

/* List View */
.donors-list {
    margin-bottom: 30px;
    animation: fadeIn 0.6s ease-out;
    padding: 0 clamp(20px, 5%, 64px);
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.donors-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.donors-table thead {
    background: transparent;
    border-bottom: 2px solid #e5e7eb;
}

.donors-table thead th {
    padding: 12px 15px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.donors-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.3s ease;
}

.donors-table tbody tr:hover {
    background: #f9fafb;
}

.donors-table tbody td {
    padding: 15px;
    font-size: 14px;
    color: #1f2937;
}

.donor-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.list-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
}

.donor-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.donor-name-list {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.donor-id {
    font-size: 12px;
    color: #9ca3af;
}

.country-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.flag-small {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #e5e7eb;
}

.service-badge {
    display: inline-block;
    padding: 5px 12px;
    background: #ede9fe;
    color: #7c3aed;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
}

.amount-list {
    font-size: 16px;
    font-weight: 700;
    color: #10b981;
}

.email-link {
    color: #3b82f6;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s ease;
}

.email-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

.phone {
    font-size: 13px;
    color: #6b7280;
}

.date {
    font-size: 13px;
    color: #6b7280;
}

.action-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #3b82f6;
    font-size: 14px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    transform: scale(1.1);
}

/* Pagination */
.pagination-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px clamp(20px, 5%, 64px);
    border-top: 2px solid #e5e7eb;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.pagination-info {
    font-size: 14px;
    color: #6b7280;
}

.pagination-info span {
    font-weight: 600;
    color: #1f2937;
}

.pagination-controls {
    display: flex;
    gap: 8px;
}

.page-btn {
    padding: 8px 15px;
    border: 2px solid transparent;
    background: transparent;
    color: #6b7280;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.page-btn:hover {
    color: #667eea;
    border-bottom-color: #667eea;
}

.page-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.page-btn i {
    font-size: 12px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .donors-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .summary-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
        padding: 30px 20px 25px;
    }

    .donors-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filters-section {
        flex-wrap: wrap;
        gap: 15px;
    }

    .filter-group {
        min-width: calc(50% - 10px);
        flex: 1 1 calc(50% - 10px);
    }

    .view-toggle {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }

    .toggle-btn {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .donor-banner {
        padding: 40px 20px;
        margin-left: calc(-1 * (100vw - 100%) / 2);
        margin-right: calc(-1 * (100vw - 100%) / 2);
        width: 100vw;
    }

    .banner-title {
        font-size: 28px;
        flex-direction: column;
        gap: 10px;
    }

    .banner-title i {
        font-size: 28px;
    }

    .banner-subtitle {
        font-size: 16px;
    }

    .summary-section {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 30px 15px 25px;
    }

    .filters-section {
        padding: 25px 15px;
        flex-direction: column;
    }

    .filter-group {
        min-width: 100%;
        flex: 1 1 100%;
    }

    .view-toggle {
        width: 100%;
    }

    .donors-grid {
        grid-template-columns: 1fr;
    }

    .donors-table {
        font-size: 12px;
    }

    .donors-table thead th {
        padding: 10px 8px;
        font-size: 11px;
    }

    .donors-table tbody td {
        padding: 12px 8px;
        font-size: 12px;
    }

    .list-avatar {
        width: 35px;
        height: 35px;
    }

    .donor-name-list {
        font-size: 13px;
    }

    .donor-id {
        font-size: 11px;
    }

    .pagination-section {
        flex-direction: column;
        gap: 15px;
    }

    .pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
    }

    .page-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .banner-title {
        font-size: 24px;
    }

    .banner-title i {
        font-size: 22px;
    }

    .banner-subtitle {
        font-size: 14px;
    }

    .summary-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .summary-info h3 {
        font-size: 20px;
    }

    .summary-info p {
        font-size: 12px;
    }

    .filter-group {
        min-width: 100%;
    }

    .donor-card-header {
        padding: 20px;
    }

    .donor-avatar {
        width: 70px;
        height: 70px;
    }

    .donor-name {
        font-size: 16px;
    }

    .amount-value {
        font-size: 20px;
    }

    /* Mobile Table Scrolling */
    .donors-list {
        overflow-x: auto;
    }

    .donors-table {
        min-width: 800px;
    }
}

@media (max-width: 360px) {
    .banner-title {
        font-size: 20px;
    }

    .summary-info h3 {
        font-size: 18px;
    }

    .donor-avatar {
        width: 60px;
        height: 60px;
    }
}

/* ===== MOBILE CRITICAL FIXES ===== */

/* iOS zoom prevention for filter selects */
.filter-group select {
    font-size: 16px;
}

/* Donor Registration Modal — responsive at ≤640px (overrides inline styles) */
@media (max-width: 640px) {
    #donorRegModal > div > div:first-child {
        padding: 20px 18px !important;
    }
    form#regForm {
        padding: 20px 16px !important;
    }
    /* Stack 2-column form grid to single column */
    #regForm > div:first-child {
        grid-template-columns: 1fr !important;
    }
    /* Stack action buttons vertically */
    #regForm > div:last-child {
        flex-direction: column-reverse !important;
        gap: 10px !important;
    }
    #regForm > div:last-child button {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* ≤375px — compact layout for small phones */
@media (max-width: 375px) {
    .donor-banner {
        padding: 26px 14px;
    }
    .banner-title {
        font-size: 18px;
        gap: 8px;
    }
    .banner-subtitle {
        font-size: 13px;
    }
    .summary-section {
        gap: 15px;
        padding: 18px 12px;
    }
    .summary-card {
        gap: 12px;
    }
    .summary-icon {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    .summary-info h3 {
        font-size: 20px;
    }
    .filters-section {
        padding: 14px 12px;
        gap: 12px;
    }
    .toggle-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    .donors-grid {
        padding: 0 12px;
        gap: 14px;
    }
    .donors-list {
        padding: 0 12px;
    }
    .pagination-section {
        padding: 14px 12px;
    }
    .donor-card-body {
        padding: 14px;
    }
    .donor-card-footer {
        padding: 0 14px 14px;
    }
    .donor-name {
        font-size: 15px;
    }
    .donor-country,
    .donor-service {
        font-size: 13px;
        gap: 6px;
    }
    .amount-value {
        font-size: 20px;
    }
    .view-details-btn {
        padding: 10px;
        font-size: 13px;
    }
}

/* ≤320px — very small devices (Galaxy Fold, old phones) */
@media (max-width: 320px) {
    .banner-title {
        font-size: 15px;
    }
    .banner-subtitle {
        font-size: 12px;
    }
    .summary-icon {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    .summary-info h3 {
        font-size: 17px;
    }
    .donors-grid {
        padding: 0 10px;
        gap: 12px;
    }
    .toggle-btn {
        padding: 7px 10px;
        font-size: 11px;
    }
    .filter-group select {
        padding: 9px 10px;
    }
    .donor-name {
        font-size: 14px;
    }
    .amount-value {
        font-size: 17px;
    }
}
