/*
 * Donatello Plugin Styles
 *
 * Stable Version: 2.2
 * Date: 2025-06-14
 * Note: This version is confirmed to work correctly on https://emigram.io/donatello/.
 *       All elements are centered, including "Enter custom amount" and "Make this a monthly donation".
 */

/* General Layout */
.donatello-layouts {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Section */
.donatello-layouts-header {
    background: #1a2a44; /* Dark blue background for the entire header */
    padding: 20px;
    border-radius: 8px;
}

.donatello-layouts-headerImage__img {
    width: 100% !important; 
    height: auto !important;
    border-radius: 8px;
    margin-bottom: 20px;
}

.donatello-layouts-header__content {
    padding: 20px;
    border-radius: 8px;
}

.donatello-layouts-headerTitle h2 {
    font-size: 28px;
    color: #fff; /* White text for contrast */
    margin-bottom: 10px;
}

.donatello-layouts-headerDescription p {
    font-size: 16px;
    color: #e0e0e0; /* Light gray for readability */
    line-height: 1.6;
    margin-bottom: 20px;
}

.donatello-form-secure-badge {
    text-align: center;
    margin: 10px 0;
}

.donatello-form-secure-badge span {
    background: #28a745;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
}

/* Goal and Stats Section */
.donatello-layouts-goal {
    margin: 20px 0;
    background: linear-gradient(135deg, #e8f0fe 0%, #f5f5f5 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.donatello-layouts-goal:hover {
    transform: translateY(-3px);
}

.donatello-layouts-goal h3 {
    font-size: 24px;
    text-align: center;
    color: #333;
    margin-bottom: 15px;
    font-weight: bold;
}

.donatello-layouts-goal__stats-panel__list {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 15px;
    width: 100%;
}

.donatello-layouts-goal__stats-panel__list-item {
    text-align: center;
    flex: 1 1 0;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
    transition: background 0.3s ease;
    min-width: 100px;
}

.donatello-layouts-goal__stats-panel__list-item:hover {
    background: #e7f1ff;
}

.donatello-layouts-goal__stats-panel__stat-value {
    display: block;
    font-weight: bold;
    font-size: 18px;
    color: #007bff;
    margin-bottom: 5px;
}

.donatello-layouts-goal__stat-label {
    color: #666;
    font-size: 14px;
}

.donatello-layouts-goal__progress {
    margin: 20px 0;
}

.donatello-layouts-goal__progress__description {
    display: block;
    text-align: center;
    font-size: 16px;
    color: #333;
    margin-bottom: 10px;
    font-weight: 500;
}

.donatello-layouts-goal__progress__meter {
    width: 100%;
    height: 12px;
    border-radius: 6px;
    background: #e9ecef;
    overflow: hidden;
    -webkit-appearance: none;
    appearance: none;
}

.donatello-layouts-goal__progress__meter::-webkit-progress-bar {
    background: #e9ecef;
}

.donatello-layouts-goal__progress__meter::-webkit-progress-value {
    background: #DAA520;
    transition: width 1.5s ease-in-out;
}

.donatello-layouts-goal__progress__meter::-moz-progress-bar {
    background: #DAA520;
    transition: width 1.5s ease-in-out;
}

.donatello-layouts-goal__progress__markers {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
}

.donatello-layouts-goal__progress__marker {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Leaderboard Section */
.donatello-leaderboard {
    margin-top: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.donatello-leaderboard h3 {
    font-size: 22px;
    color: #fff;
    text-align: center;
    margin-bottom: 15px;
}

.donatello-leaderboard__list {
    list-style: none;
    padding: 0;
}

.donatello-leaderboard__item {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.donatello-leaderboard__item:hover {
    transform: translateY(-2px);
}

.donatello-leaderboard__name {
    font-weight: bold;
    font-size: 16px;
    color: #333;
    flex: 1 1 30%;
}

.donatello-leaderboard__amount {
    font-weight: bold;
    font-size: 16px;
    color: #007bff;
    flex: 1 1 20%;
    text-align: center;
}

.donatello-leaderboard__date {
    font-size: 14px;
    color: #666;
    flex: 1 1 30%;
    text-align: center;
}

.donatello-leaderboard__comment {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
    flex: 1 1 100%;
    font-style: italic;
}

/* Donation Form Section */
.donatello-donate {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.donatello-donate h3 {
    font-size: 22px;
    color: #333;
    margin-bottom: 10px;
    text-align: center; /* Центрируем заголовок */
    max-width: 640px; /* Соответствует ширине формы */
    margin-left: auto;
    margin-right: auto;
}

.donatello-donate p {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
    text-align: center; /* Центрируем текст */
    max-width: 640px; /* Соответствует ширине формы */
    margin-left: auto;
    margin-right: auto;
}

.donatello-amounts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.donatello-amount {
    background: #1a2a44;
    border: 1px solid #2a3b55;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 18px;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 0 1 140px;
    text-align: center;
    box-sizing: border-box;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.donatello-amount:hover,
.donatello-amount.active {
    background: #2a3b55;
    color: #fff;
    border-color: #3a4b65;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.donatello-amount.selected {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
    box-shadow: 0 6px 12px rgba(0, 123, 255, 0.4);
    transform: translateY(-2px);
}

.donatello-custom-amount {
    margin-bottom: 10px;
    max-width: 640px; /* Соответствует ширине .donatello-amounts */
    margin-left: auto;
    margin-right: auto;
    text-align: center; /* Центрируем содержимое */
}

#donatello-custom-amount {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    width: 100%;
    max-width: 200px;
    background: #fff;
    color: #333;
}

#donatello-custom-amount:focus {
    border-color: #007bff;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.3);
    outline: none;
}

.donatello-recurring {
    font-size: 14px;
    color: #666;
    display: block;
    max-width: 640px; /* Соответствует ширине .donatello-amounts */
    margin-left: auto;
    margin-right: auto;
    text-align: center; /* Центрируем содержимое */
    margin-bottom: 20px;
}

.donatello-comment {
    margin-bottom: 20px;
    max-width: 640px; /* Ограничиваем ширину для единообразия */
    margin-left: auto;
    margin-right: auto;
}

.donatello-comment label {
    display: block;
    font-size: 16px;
    color: #333;
    margin-bottom: 5px;
}

.donatello-comment p {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

#donatello-comment {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    resize: vertical;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
    color: #333;
}

#donatello-comment:focus {
    border-color: #007bff;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.3);
    outline: none;
}

.donatello-anonymous {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

.donatello-anonymous-note {
    font-style: italic;
    color: #999;
}

#donatello-donate-now {
    background: #1a2a44;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 14px 20px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    max-width: 640px; /* Соответствует ширине формы */
    margin-left: auto;
    margin-right: auto;
    display: block; /* Центрируем кнопку */
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

#donatello-donate-now:hover {
    background: #2a3b55;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .donatello-amounts {
        max-width: 250px; /* 2 buttons per row (2 × 120px + 1 × 10px) */
    }

    .donatello-amount {
        flex: 0 1 120px;
        padding: 10px 15px;
        font-size: 16px;
    }

    .donatello-custom-amount,
    .donatello-recurring,
    .donatello-comment,
    #donatello-donate-now,
    .donatello-donate h3,
    .donatello-donate p {
        max-width: 100%; /* На мобильных устройствах используем всю ширину */
    }
}