/**
 * Cnaught Carbon Credits - Frontend Styles
 */

/* Widget Container */
.cnaught-widget {
    margin: 30px 0;
    padding: 25px;
    background: #f8f9fa;
    border-left: 4px solid #28a745;
    border-radius: 4px;
}

.cnaught-widget-header h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: #333;
}

.cnaught-description {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 14px;
}

/* Carbon Info */
.cnaught-carbon-info {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    padding: 15px 0;
    border-top: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
}

.cnaught-carbon-amount,
.cnaught-offset-price {
    flex: 1;
}

.cnaught-label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.cnaught-value,
.cnaught-price {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.cnaught-price {
    color: #28a745;
}

/* Purchase Button */
.cnaught-purchase-btn {
    display: block;
    width: 100%;
    padding: 15px 30px;
    background-color: #28a745;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    text-align: center;
}

.cnaught-purchase-btn:hover {
    background-color: #218838;
    color: #fff;
}

/* Project Preview */
.cnaught-project-preview {
    margin-top: 20px;
}

.cnaught-project-intro {
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.cnaught-project-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cnaught-project-list li {
    padding: 5px 0 5px 25px;
    position: relative;
    color: #666;
}

.cnaught-project-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

/* Modal */
.cnaught-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
}

.cnaught-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.cnaught-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.cnaught-modal-close:hover,
.cnaught-modal-close:focus {
    color: #000;
}

body.cnaught-modal-open {
    overflow: hidden;
}

/* Modal Content */
.cnaught-modal-content h2 {
    margin: 0 0 20px 0;
    font-size: 24px;
}

.cnaught-modal-summary {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.cnaught-modal-summary p {
    margin: 5px 0;
}

/* Form */
.cnaught-form-group {
    margin-bottom: 20px;
}

.cnaught-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.cnaught-form-group .required {
    color: #dc3545;
}

.cnaught-form-group input[type="email"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.cnaught-help-text {
    font-size: 13px;
    color: #666;
    margin: 5px 0 10px 0;
}

/* Projects Grid */
.cnaught-projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

@media (max-width: 768px) {
    .cnaught-projects-grid {
        grid-template-columns: 1fr;
    }

    .cnaught-carbon-info {
        flex-direction: column;
        gap: 15px;
    }
}

.cnaught-project-option {
    cursor: pointer;
    margin: 0;
}

.cnaught-project-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
}

.cnaught-project-card {
    padding: 15px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    transition: all 0.3s;
}

.cnaught-project-option input[type="checkbox"]:checked + .cnaught-project-card {
    border-color: #28a745;
    background-color: #e8f5e9;
}

.cnaught-project-card h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #333;
}

.cnaught-project-card p {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.cnaught-project-type {
    display: inline-block;
    padding: 3px 8px;
    background: #e9ecef;
    border-radius: 3px;
    font-size: 11px;
    color: #495057;
    text-transform: uppercase;
}

/* Form Actions */
.cnaught-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.cnaught-submit-btn {
    flex: 1;
    padding: 12px 30px;
    background-color: #28a745;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.cnaught-submit-btn:hover {
    background-color: #218838;
}

.cnaught-cancel-btn {
    padding: 12px 30px;
    background-color: #6c757d;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.cnaught-cancel-btn:hover {
    background-color: #5a6268;
}

/* Loading State */
.cnaught-loading {
    text-align: center;
    padding: 20px;
}

.cnaught-loading .spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #28a745;
    animation: cnaught-spin 1s linear infinite;
}

@keyframes cnaught-spin {
    to { transform: rotate(360deg); }
}

.cnaught-loading-text {
    display: block;
    margin-top: 10px;
    color: #666;
}

/* Messages */
.cnaught-message {
    padding: 12px;
    border-radius: 4px;
    margin-top: 15px;
}

.cnaught-message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.cnaught-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Success State */
.cnaught-success {
    text-align: center;
    padding: 20px;
}

.cnaught-success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background-color: #28a745;
    color: #fff;
    font-size: 50px;
    line-height: 80px;
    border-radius: 50%;
}

.cnaught-success h3 {
    margin: 0 0 15px 0;
    color: #28a745;
}

.cnaught-success-message {
    margin-bottom: 20px;
}

.cnaught-order-id {
    font-size: 13px;
    color: #666;
    font-family: monospace;
}

.cnaught-success-actions {
    margin-top: 20px;
}

.cnaught-success-actions .button {
    margin: 5px;
}
