/**
 * WP Donor Insight - Frontend Styles
 */

.wpdi-donor-dashboard,
.wpdi-community-view {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.wpdi-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.wpdi-header h1 {
    font-size: 2em;
    margin: 0;
    color: #333;
}

.wpdi-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.wpdi-logout-button {
    padding: 8px 16px;
    background: #666;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.3s ease;
    display: inline-block;
}

.wpdi-logout-button:hover {
    background: #555;
    color: #fff;
    text-decoration: none;
}

/* Profile Summary */
.wpdi-profile-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.wpdi-summary-card,
.wpdi-stat-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wpdi-summary-card h3,
.wpdi-stat-card h3 {
    font-size: 0.9em;
    text-transform: uppercase;
    color: #666;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.wpdi-amount {
    font-size: 2em;
    font-weight: bold;
    color: #2c5aa0;
    margin: 0;
}

.wpdi-count {
    font-size: 2em;
    font-weight: bold;
    color: #2c5aa0;
    margin: 0;
}

.wpdi-date {
    font-size: 1.2em;
    color: #333;
    margin: 0;
}

/* Filters */
.wpdi-filters {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.wpdi-filters form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.wpdi-filters select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
}

.wpdi-button {
    padding: 8px 16px;
    background: #2c5aa0;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
}

.wpdi-button:hover {
    background: #1e3f73;
}

.wpdi-button-secondary {
    background: #666;
}

.wpdi-button-secondary:hover {
    background: #555;
}

/* Charts */
.wpdi-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.wpdi-chart-container {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wpdi-chart-container h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

.wpdi-chart-container canvas {
    max-height: 300px;
}

/* Donations Table */
.wpdi-donations-table {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wpdi-donations-table h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

.wpdi-table {
    width: 100%;
    border-collapse: collapse;
}

.wpdi-table thead {
    background: #f5f5f5;
}

.wpdi-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
}

.wpdi-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.wpdi-table tbody tr:hover {
    background: #f9f9f9;
}

.wpdi-no-data {
    text-align: center;
    color: #666;
    padding: 40px !important;
}

/* Community View */
.wpdi-community-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.wpdi-campaign-breakdown {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-top: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wpdi-campaign-breakdown h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

/* Messages */
.wpdi-message {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.wpdi-message.wpdi-error {
    background: #fee;
    border-left: 4px solid #dc3232;
    color: #dc3232;
}

.wpdi-message.wpdi-success {
    background: #efe;
    border-left: 4px solid #46b450;
    color: #46b450;
}

/* Donation Form Styles */
.wpdi-donation-form-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Today's Donors Styles */
.wpdi-todays-donors {
    margin-top: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.wpdi-todays-donors .wpdi-donors-box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wpdi-todays-donors .wpdi-donors-list {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Payment Method Message */
.wpdi-payment-message {
    background: #e7f5fe;
    border-left: 4px solid #0073aa;
    padding: 12px 15px;
    margin: 0;
    border-radius: 4px;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
}

.wpdi-payment-message p {
    margin: 0;
}

.wpdi-payment-message strong {
    color: #0073aa;
}

.wpdi-form-row {
    margin-bottom: 20px;
}

.wpdi-form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.wpdi-form-row .required {
    color: #dc3232;
}

.wpdi-form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.wpdi-form-control:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 0 2px rgba(44, 90, 160, 0.1);
}

.wpdi-form-description {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.wpdi-form-submit {
    margin-top: 30px;
    text-align: center;
}

/* Autocomplete styles */
.ui-autocomplete {
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 9999;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ui-autocomplete .ui-menu-item {
    padding: 0;
}

.ui-autocomplete .ui-menu-item-wrapper {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.ui-autocomplete .ui-menu-item-wrapper:hover,
.ui-autocomplete .ui-menu-item-wrapper.ui-state-active {
    background-color: #f5f5f5;
}

/* Thank You Message Styles */
.wpdi-donation-thankyou {
    text-align: center;
    padding: 40px 20px;
}

.wpdi-thankyou-content h2 {
    color: #2c5aa0;
    margin-bottom: 15px;
    font-size: 2em;
}

.wpdi-thankyou-message {
    font-size: 1.2em;
    color: #333;
    margin-bottom: 30px;
}

.wpdi-today-donation {
    margin: 30px 0;
}

/* Heart Container */
.wpdi-heart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.wpdi-heart {
    width: 140px;
    height: 130px;
    position: relative;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpdi-heart::before,
.wpdi-heart::after {
    content: '';
    width: 70px;
    height: 110px;
    position: absolute;
    left: 70px;
    top: 0;
    background: #ffcccc;
    border-radius: 70px 70px 0 0;
    transform: rotate(-45deg);
    transform-origin: 0 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wpdi-heart::after {
    left: 0;
    transform: rotate(45deg);
    transform-origin: 100% 100%;
}

.wpdi-heart-amount {
    position: relative;
    z-index: 10;
    font-size: 1.6em;
    font-weight: bold;
    color: #d32f2f;
    text-align: center;
    line-height: 1.2;
    padding: 0 10px;
    word-break: break-word;
}

.wpdi-heart-label {
    margin: 0;
    font-size: 1.1em;
    color: #666;
    font-weight: 600;
    margin-top: 10px;
}

/* Login Prompt */
.wpdi-login-prompt {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 40px;
    max-width: 500px;
    margin: 40px auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wpdi-login-message {
    font-size: 1.1em;
    color: #333;
    margin-bottom: 25px;
    line-height: 1.6;
    text-align: center;
}

.wpdi-login-form {
    margin-top: 20px;
}

.wpdi-form-group {
    margin-bottom: 20px;
}

.wpdi-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.wpdi-form-group input[type="text"],
.wpdi-form-group input[type="password"],
.wpdi-form-group input[type="email"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.wpdi-form-group input:focus {
    outline: none;
    border-color: #2c5aa0;
}

.wpdi-checkbox-label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.wpdi-checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    width: auto;
}

.wpdi-form-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 25px;
}

.wpdi-button-primary {
    width: 100%;
    padding: 12px;
    background: #2c5aa0;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.wpdi-button-primary:hover:not(:disabled) {
    background: #1e3f73;
}

.wpdi-button-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wpdi-forgot-password {
    text-align: center;
    color: #2c5aa0;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.wpdi-forgot-password:hover {
    color: #1e3f73;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .wpdi-donor-dashboard,
    .wpdi-community-view {
        padding: 10px;
    }
    
    .wpdi-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .wpdi-header h1 {
        font-size: 1.5em;
    }
    
    .wpdi-header-actions {
        width: 100%;
    }
    
    .wpdi-logout-button {
        width: 100%;
        text-align: center;
    }
    
    .wpdi-charts {
        grid-template-columns: 1fr;
    }
    
    .wpdi-filters form {
        flex-direction: column;
    }
    
    .wpdi-filters select,
    .wpdi-button {
        width: 100%;
    }
    
    .wpdi-table {
        font-size: 0.9em;
    }
    
    .wpdi-table th,
    .wpdi-table td {
        padding: 8px;
    }
    
    .wpdi-login-prompt {
        padding: 20px;
        margin: 20px auto;
    }
}

/* Community Filters */
.wpdi-community-filters {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wpdi-filter-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.wpdi-filter-group {
    flex: 1;
    min-width: 150px;
}

.wpdi-filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.wpdi-filter-group input[type="text"],
.wpdi-filter-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.wpdi-filter-group input:focus,
.wpdi-filter-group select:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 0 2px rgba(44, 90, 160, 0.1);
}

.wpdi-filter-actions {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.wpdi-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.3s ease;
}

.wpdi-btn-primary {
    background: #2c5aa0;
    color: #fff;
}

.wpdi-btn-primary:hover {
    background: #1e3f73;
}

.wpdi-btn-secondary {
    background: #666;
    color: #fff;
}

.wpdi-btn-secondary:hover {
    background: #555;
}

/* Community Content Layout */
.wpdi-community-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.wpdi-community-left {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.wpdi-community-right {
    position: sticky;
    top: 20px;
    height: fit-content;
    max-height: calc(100vh - 40px);
}

/* Donors Box */
.wpdi-donors-box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wpdi-donors-box h3 {
    margin-top: 0;
    margin-bottom: 5px;
    color: #333;
    font-size: 1.3em;
}

.wpdi-donors-subtitle {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 0.9em;
    font-style: italic;
}

.wpdi-donors-list {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 5px;
}

.wpdi-donors-list::-webkit-scrollbar {
    width: 6px;
}

.wpdi-donors-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.wpdi-donors-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.wpdi-donors-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.wpdi-donor-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    transition: background 0.2s ease;
}

.wpdi-donor-item:last-child {
    border-bottom: none;
}

.wpdi-donor-item:hover {
    background: #f9f9f9;
}

.wpdi-donor-info {
    flex: 1;
    min-width: 0;
}

.wpdi-donor-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    word-wrap: break-word;
}

.wpdi-donor-email {
    font-size: 0.9em;
    color: #666;
    word-wrap: break-word;
}

.wpdi-donor-payment-method {
    font-size: 0.85em;
    color: #888;
    font-weight: normal;
}

.wpdi-donor-amount {
    text-align: right;
    margin-left: 15px;
    flex-shrink: 0;
}

.wpdi-donor-amount strong {
    display: block;
    font-size: 1.1em;
    color: #2c5aa0;
    margin-bottom: 4px;
}

.wpdi-donor-count {
    display: block;
    font-size: 0.85em;
    color: #666;
}

.wpdi-no-donors {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

/* Loading State */
.wpdi-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.wpdi-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2c5aa0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments for community view */
@media (max-width: 1024px) {
    .wpdi-community-content {
        grid-template-columns: 1fr;
    }
    
    .wpdi-community-right {
        position: static;
        max-height: none;
    }
    
    .wpdi-donors-list {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .wpdi-filter-row {
        flex-direction: column;
    }
    
    .wpdi-filter-group {
        width: 100%;
    }
    
    .wpdi-filter-actions {
        width: 100%;
    }
    
    .wpdi-btn {
        width: 100%;
        text-align: center;
    }
    
    .wpdi-community-content {
        grid-template-columns: 1fr;
    }
    
    .wpdi-donors-list {
        max-height: 300px;
    }
}

