/**
 * Public-facing styles for ChildConnect
 */

.cc-container {
    padding: 20px 0;
}

.cc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 0 auto;
}

.cc-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid #f0f0f0;
}

.cc-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.cc-card-image {
    width: 100%;
    height: 350px !important;
    object-fit: cover;
    display: block;
}

.cc-card-image-placeholder {
    width: 100%;
    height: 350px !important;
    background: #f4f7fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0aec0;
}

.cc-card-content {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    color: #0A2540;
}

.cc-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.cc-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: #0A2540;
}

.cc-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.cc-badge-available {
    background: #ecfdf5;
    color: #16A34A;
}

.cc-card-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #64748b;
}

.cc-meta-item {
    display: flex;
    align-items: center;
}

.cc-card-pricing {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cc-amount-label {
    font-size: 0.85rem;
    color: #64748b;
    display: block;
}

.cc-amount-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0A2540;
}

.cc-button {
    display: inline-block;
    background: #16A34A;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s ease;
    text-align: center;
}

.cc-button:hover {
    background: #15803d;
    color: #ffffff;
}

@media (max-width: 640px) {
    .cc-grid {
        grid-template-columns: 1fr;
    }
}

/**
 * Checkout Styles Refined
 */
.cc-checkout-container {
    max-width: 900px;
    margin: 40px auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid #f0f0f0;
}

.cc-checkout-header {
    background: #f8fafc;
    padding: 30px;
    border-bottom: 1px solid #e2e8f0;
    text-align: center;
}

.cc-checkout-header h2 {
    margin: 0;
    color: #0A2540;
    font-size: 1.75rem;
    font-weight: 700;
}

.cc-checkout-body {
    padding: 40px;
}

/* Child Info Horizontal Row */
.cc-checkout-child-row {
    display: flex;
    align-items: center;
    gap: 30px;
    padding-bottom: 30px;
    border-bottom: 2px dashed #e2e8f0;
    margin-bottom: 40px;
}

.cc-checkout-child-image {
    width: 120px;
    height: 120px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.cc-checkout-child-data {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    flex-grow: 1;
}

.cc-data-item {
    display: flex;
    flex-direction: column;
}

.cc-data-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 4px;
    font-weight: 600;
}

.cc-data-value {
    font-size: 1.1rem;
    color: #0A2540;
    font-weight: 600;
}

.cc-data-value.cc-price {
    color: #16A34A;
    font-size: 1.25rem;
}

/* User Form Section */
.cc-checkout-section-title {
    font-size: 1.25rem;
    color: #0A2540;
    margin: 0 0 25px 0;
    font-weight: 700;
}

.cc-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.cc-form-group.full-width {
    grid-column: span 2;
}

.cc-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #0A2540;
    font-size: 0.9rem;
}

.cc-form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #ffffff;
}

.cc-form-control:focus {
    outline: none;
    border-color: #16A34A;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.cc-checkout-submit {
    margin-top: 10px;
}

.cc-checkout-button {
    width: 100%;
    background: #16A34A;
    color: #ffffff;
    padding: 16px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    text-decoration: none;
    display: block;
    text-align: center;
}

.cc-checkout-button:hover {
    background: #15803d;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.2);
}

/**
 * Thank You Page Styles
 */
.cc-thanks-container {
    max-width: 800px;
    margin: 40px auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid #f0f0f0;
}

.cc-thanks-hero {
    background: #f0fdf4;
    padding: 60px 40px;
    text-align: center;
    border-bottom: 1px solid #dcfce7;
}

.cc-thanks-icon {
    font-size: 60px;
    color: #16A34A;
    margin-bottom: 20px;
}

.cc-thanks-hero h1 {
    font-size: 2.5rem;
    color: #064e3b;
    margin: 0 0 10px 0;
}

.cc-thanks-hero p {
    font-size: 1.1rem;
    color: #065f46;
    margin: 0;
}

.cc-thanks-body {
    padding: 40px;
}

.cc-thanks-section {
    margin-bottom: 40px;
}

.cc-thanks-section h3 {
    font-size: 1.25rem;
    color: #0A2540;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f1f5f9;
}

.cc-thanks-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.cc-summary-item {
    display: flex;
    flex-direction: column;
}

.cc-summary-label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 4px;
}

.cc-summary-value {
    color: #0A2540;
    font-weight: 500;
}

.cc-thanks-actions {
    text-align: center;
    margin-top: 20px;
}

@media (max-width: 640px) {
    .cc-thanks-summary-grid {
        grid-template-columns: 1fr;
    }
}

.cc-notice {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.cc-notice-info {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.cc-notice-error {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/**
 * Single Child Page Styles
 */
.cc-single-container {
    max-width: 1000px;
    margin: 40px auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.cc-single-image img {
    width: 1000px;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.cc-single-content {
    display: flex;
    flex-direction: column;
}

.cc-single-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.cc-single-title {
    font-size: 2.5rem;
    margin: 0;
    color: #0A2540;
}

.cc-single-meta {
    margin-bottom: 30px;
    font-size: 1.1rem;
    color: #64748b;
}

.cc-single-description {
    line-height: 1.8;
    color: #334155;
    margin-bottom: 30px;
}

.cc-single-footer {
    margin-top: auto;
    padding-top: 30px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cc-single-price .cc-amount-value {
    font-size: 1.75rem;
}

@media (max-width: 768px) {
    .cc-single-container {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    .cc-single-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .cc-checkout-body {
        flex-direction: column;
    }
}

/**
 * Modal Styles
 */
.cc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.cc-modal-container {
    background: #fff;
    width: 100%;
    max-width: 800px;
    border-radius: 12px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.cc-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    z-index: 10;
}

.cc-modal-child-details {
    height: 500px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.cc-modal-child-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cc-modal-child-info {
    padding: 40px;
    display: flex;
    flex-direction: column;
}

.cc-modal-title {
    font-size: 2rem;
    margin: 0 0 10px 0;
    color: #0A2540;
}

.cc-modal-meta {
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 20px;
}

.cc-modal-description {
    font-size: 1rem;
    line-height: 1.6;
    color: #334155;
    margin-bottom: 30px;
}

.cc-modal-footer {
    margin-top: auto;
    padding-top: 25px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cc-modal-price .cc-amount-value {
    font-size: 1.5rem;
}

.cc-button-large {
    padding: 12px 25px;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .cc-modal-child-details {
        grid-template-columns: 1fr;
    }
    .cc-modal-child-image {
        height: 300px;
    }
    .cc-modal-child-info {
        padding: 25px;
    }
}

/**
 * Donor Dashboard Styles
 */
.cc-dashboard-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin: 30px 0;
    border: 1px solid #f0f0f0;
}

.cc-dashboard-header {
    background: #f8fafc;
    padding: 25px 30px;
    border-bottom: 1px solid #e2e8f0;
}

.cc-dashboard-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #0A2540;
}

.cc-dashboard-content {
    padding: 0;
}

.cc-dashboard-table {
    width: 100%;
    border-collapse: collapse;
}

.cc-dashboard-table th {
    text-align: left;
    background: #f8fafc;
    padding: 15px 30px;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 600;
}

.cc-dashboard-table td {
    padding: 20px 30px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.cc-status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.cc-status-active { background: #ecfdf5; color: #16A34A; }
.cc-status-cancelled { background: #fee2e2; color: #b91c1c; }

.cc-button-small {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.cc-button-outline {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #64748b;
}

.cc-button-outline:hover {
    background: #f8fafc;
    border-color: #b91c1c;
    color: #b91c1c;
}

.cc-dashboard-empty {
    padding: 60px 30px;
    text-align: center;
}

.cc-dashboard-empty p {
    color: #64748b;
    margin-bottom: 25px;
    font-size: 1.1rem;
}

.cc-muted {
    font-size: 0.85rem;
    color: #94a3b8;
}

@media (max-width: 900px) {
    .cc-dashboard-table thead {
        display: none;
    }
    .cc-dashboard-table tr {
        display: block;
        padding: 20px;
        border-bottom: 4px solid #f1f5f9;
    }
    .cc-dashboard-table td {
        display: flex;
        justify-content: space-between;
        padding: 10px 0;
        border: none;
        text-align: right;
    }
    .cc-dashboard-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #64748b;
        text-align: left;
    }
}
