/**
 * Donor Portal — Frontend Styles
 */

/* Portal container */
.dp-portal {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Navigation */
.dp-portal-nav {
    background: #2c3e50;
    border-radius: 8px;
    margin-bottom: 25px;
    overflow-x: auto;
}

.dp-portal-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: nowrap;
}

.dp-portal-nav li {
    margin: 0;
}

.dp-portal-nav li a {
    display: block;
    padding: 14px 20px;
    color: #bdc3c7;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.dp-portal-nav li a:hover {
    background: #34495e;
    color: #fff;
}

.dp-portal-nav li.dp-active a {
    background: #3498db;
    color: #fff;
}

/* Content area */
.dp-portal-content {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 30px;
}

.dp-portal-content h2 {
    color: #2c3e50;
    margin-top: 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

/* Dashboard grid */
.dp-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.dp-dashboard-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.dp-dashboard-card h3 {
    font-size: 32px;
    margin: 0 0 5px;
    color: #2c3e50;
}

.dp-dashboard-card p {
    color: #666;
    margin: 0 0 10px;
}

.dp-dashboard-section {
    margin-top: 30px;
}

.dp-dashboard-section h3 {
    color: #2c3e50;
}

/* Tables */
.dp-table-responsive {
    overflow-x: auto;
}

.dp-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.dp-table th {
    background: #f8f9fa;
    padding: 10px 12px;
    text-align: left;
    font-size: 13px;
    color: #2c3e50;
    border-bottom: 2px solid #dee2e6;
}

.dp-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.dp-table tbody tr:hover {
    background: #f8f9fa;
}

/* Status badges */
.dp-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.dp-status-active { background: #d4edda; color: #155724; }
.dp-status-inactive,
.dp-status-cancelled { background: #f8d7da; color: #721c24; }
.dp-status-paused { background: #fff3cd; color: #856404; }
.dp-status-pending,
.dp-status-pending_change { background: #cce5ff; color: #004085; }
.dp-status-in_progress { background: #e2e3f1; color: #383d6e; }
.dp-status-completed { background: #d4edda; color: #155724; }

.dp-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    background: #e0e0e0;
    color: #333;
}

.dp-badge-success { background: #d4edda; color: #155724; }
.dp-badge-muted { background: #f0f0f0; color: #999; }

/* Buttons */
.dp-btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

.dp-btn:active {
    transform: translateY(1px);
}

.dp-btn-primary {
    background: #3498db;
    color: #fff;
}

.dp-btn-primary:hover {
    background: #2980b9;
    color: #fff;
}

.dp-btn-secondary {
    background: #95a5a6;
    color: #fff;
}

.dp-btn-secondary:hover {
    background: #7f8c8d;
    color: #fff;
}

.dp-btn-danger {
    background: #e74c3c;
    color: #fff;
}

.dp-btn-danger:hover {
    background: #c0392b;
}

.dp-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
}

.dp-link:hover {
    text-decoration: underline;
}

/* Notices */
.dp-notice {
    padding: 15px 20px;
    border-radius: 6px;
    margin: 15px 0;
    font-size: 14px;
}

.dp-notice-info { background: #cce5ff; color: #004085; border: 1px solid #b8daff; }
.dp-notice-warning { background: #fff3cd; color: #856404; border: 1px solid #ffc107; }
.dp-notice-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.dp-notice-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* Filters */
.dp-filters {
    margin: 15px 0;
}

.dp-filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dp-filter-row label {
    font-weight: 600;
    font-size: 14px;
}

.dp-filter-row select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Pagination */
.dp-pagination {
    display: flex;
    gap: 5px;
    margin: 20px 0;
    justify-content: center;
}

.dp-page-link {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
}

.dp-page-link:hover {
    background: #f0f0f0;
}

.dp-page-current {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

/* Empty state */
.dp-empty {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 16px;
}

/* Sponsorship cards */
.dp-sponsorship-list {
    display: grid;
    gap: 15px;
}

.dp-sponsorship-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: box-shadow 0.2s;
}

.dp-sponsorship-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.dp-sponsorship-card h3 {
    margin: 0 0 5px;
    font-size: 16px;
}

/* Giving plan cards */
.dp-giving-plan-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
}

.dp-plan-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.dp-plan-header h3 {
    margin: 0;
    font-size: 18px;
    color: #2c3e50;
}

.dp-plan-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.dp-plan-detail {
    font-size: 14px;
}

.dp-plan-detail strong {
    color: #555;
}

.dp-plan-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

/* Edit form */
.dp-plan-edit-form {
    margin-top: 20px;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.dp-plan-edit-form h4 {
    margin-top: 0;
    color: #2c3e50;
}

.dp-form-group {
    margin-bottom: 15px;
}

.dp-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
    color: #333;
}

.dp-form-group select,
.dp-form-group input[type="text"],
.dp-form-group input[type="number"],
.dp-form-group input[type="date"],
.dp-form-group textarea {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.dp-form-group textarea {
    max-width: 100%;
}

.dp-input-group {
    display: flex;
    align-items: center;
    max-width: 400px;
}

.dp-input-prefix {
    padding: 8px 12px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
    color: #666;
}

.dp-input-group input {
    border-radius: 0 4px 4px 0 !important;
}

.dp-form-actions {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

/* Gift calculator */
.dp-gift-calculator {
    background: #f0f8ff;
    border: 1px solid #b8daff;
    border-radius: 6px;
    padding: 20px;
}

.dp-gift-calculator h5 {
    margin-top: 0;
    color: #004085;
}

.dp-calc-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.dp-calc-operator {
    font-size: 24px;
    font-weight: bold;
    color: #666;
    padding-bottom: 10px;
}

.dp-calc-total {
    font-size: 24px;
    font-weight: bold;
    color: #27ae60;
    padding: 8px 0;
}

/* Receipt cards */
.dp-receipt-list {
    display: grid;
    gap: 15px;
}

.dp-receipt-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.dp-receipt-year h3 {
    margin: 0;
    font-size: 24px;
    color: #2c3e50;
}

.dp-receipt-year p {
    margin: 0;
    color: #666;
    font-size: 12px;
}

/* Opportunities grid */
.dp-opportunities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.dp-opportunity-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.dp-opportunity-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.dp-opportunity-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.dp-opportunity-content {
    padding: 15px;
}

.dp-opportunity-content h3 {
    margin: 0 0 8px;
    font-size: 16px;
}

.dp-opportunity-content p {
    color: #666;
    font-size: 14px;
    margin: 8px 0;
}

/* Login prompt */
.dp-portal-login-prompt {
    display: flex;
    justify-content: center;
    padding: 60px 20px;
}

.dp-login-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
}

.dp-login-card h2 {
    color: #2c3e50;
    margin-top: 0;
}

.dp-login-card p {
    color: #666;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .dp-portal {
        padding: 10px;
    }

    .dp-portal-content {
        padding: 15px;
    }

    .dp-portal-nav ul {
        overflow-x: auto;
    }

    .dp-portal-nav li a {
        padding: 10px 14px;
        font-size: 13px;
    }

    .dp-dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }

    .dp-plan-details {
        grid-template-columns: 1fr;
    }

    .dp-calc-row {
        flex-direction: column;
        align-items: stretch;
    }

    .dp-calc-operator {
        text-align: center;
        padding: 5px 0;
    }

    .dp-sponsorship-card {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .dp-receipt-card {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}
