/**
 * Harmony Events - Public Styles
 */

/* Variables */
:root {
    --harmony-primary: #016D47;
    --harmony-primary-dark: #015a3b;
    --harmony-primary-light: #e8f5e9;
    --harmony-secondary: #17a2b8;
    --harmony-danger: #dc3545;
    --harmony-warning: #ffc107;
    --harmony-success: #28a745;
    --harmony-gray-100: #f8f9fa;
    --harmony-gray-200: #e9ecef;
    --harmony-gray-300: #dee2e6;
    --harmony-gray-500: #6c757d;
    --harmony-gray-700: #495057;
    --harmony-gray-900: #1a1a1a;
    --harmony-font: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --harmony-radius: 12px;
    --harmony-shadow: 0 4px 15px rgba(0,0,0,0.08);
    --harmony-shadow-hover: 0 8px 25px rgba(0,0,0,0.12);
}

/* Base */
.harmony-event-single,
.harmony-events-grid {
    font-family: var(--harmony-font);
    direction: rtl;
    text-align: right;
    color: var(--harmony-gray-900);
    line-height: 1.7;
}

/* Single Event */
.harmony-event-single {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.harmony-event-header {
    margin-bottom: 30px;
}

.harmony-event-image {
    position: relative;
    border-radius: var(--harmony-radius);
    overflow: hidden;
    margin-bottom: 20px;
}

.harmony-event-image img {
    width: 100%;
    height: auto;
    display: block;
}

.harmony-event-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
}

.badge-ended {
    background: var(--harmony-gray-500);
    color: white;
}

.badge-full {
    background: var(--harmony-danger);
    color: white;
}

.badge-waiting {
    background: var(--harmony-warning);
    color: var(--harmony-gray-900);
}

.harmony-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.harmony-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--harmony-gray-100);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 15px;
}

.harmony-meta-item a {
    color: var(--harmony-primary);
    text-decoration: none;
}

.harmony-meta-item a:hover {
    text-decoration: underline;
}

.harmony-meta-icon {
    font-size: 18px;
}

.harmony-event-content {
    margin-bottom: 30px;
    font-size: 16px;
}

/* Registration Section */
.harmony-registration-section,
.harmony-waiting-list-section {
    background: white;
    border-radius: var(--harmony-radius);
    box-shadow: var(--harmony-shadow);
    padding: 30px;
    margin-top: 30px;
}

.harmony-step-header {
    margin-bottom: 25px;
}

.harmony-step-header h3 {
    font-size: 22px;
    margin: 0 0 8px;
    color: var(--harmony-gray-900);
}

.harmony-step-desc {
    color: var(--harmony-gray-500);
    margin: 0;
}

/* Phone Input */
.harmony-phone-input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.harmony-phone-input {
    flex: 1;
    padding: 15px 20px;
    font-size: 18px;
    border: 2px solid var(--harmony-gray-300);
    border-radius: 10px;
    text-align: center;
    font-family: var(--harmony-font);
    transition: border-color 0.3s;
}

.harmony-phone-input:focus {
    outline: none;
    border-color: var(--harmony-primary);
}

.harmony-phone-formats {
    text-align: center;
    color: var(--harmony-gray-500);
}

.harmony-phone-formats code {
    background: var(--harmony-gray-100);
    padding: 2px 8px;
    border-radius: 4px;
    margin: 0 3px;
    font-family: monospace;
}

/* Form */
.harmony-form {
    margin-top: 20px;
}

.harmony-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .harmony-form-row {
        grid-template-columns: 1fr;
    }
}

.harmony-form-group {
    display: flex;
    flex-direction: column;
}

.harmony-form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--harmony-gray-700);
}

.harmony-form-group input,
.harmony-form-group select {
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid var(--harmony-gray-300);
    border-radius: 8px;
    font-family: var(--harmony-font);
    transition: border-color 0.3s;
}

.harmony-form-group input:focus,
.harmony-form-group select:focus {
    outline: none;
    border-color: var(--harmony-primary);
}

/* Ticket Types */
.harmony-ticket-types {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.harmony-ticket-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border: 2px solid var(--harmony-gray-300);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.harmony-ticket-option:hover:not(.disabled) {
    border-color: var(--harmony-primary);
}

.harmony-ticket-option input:checked + .harmony-ticket-name {
    color: var(--harmony-primary);
}

.harmony-ticket-option input[type="radio"]:checked ~ * {
    font-weight: 600;
}

.harmony-ticket-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.harmony-ticket-name {
    flex: 1;
    font-size: 16px;
}

.harmony-ticket-price {
    font-weight: bold;
    color: var(--harmony-primary);
}

.harmony-ticket-soldout {
    background: var(--harmony-danger);
    color: white;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 12px;
}

/* Coupon */
.harmony-coupon-section {
    margin: 25px 0;
    padding-top: 20px;
    border-top: 1px solid var(--harmony-gray-200);
}

.harmony-coupon-toggle a {
    color: var(--harmony-primary);
    text-decoration: none;
    font-size: 14px;
}

.harmony-coupon-toggle a:hover {
    text-decoration: underline;
}

.harmony-coupon-input {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.harmony-coupon-input input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid var(--harmony-gray-300);
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--harmony-font);
}

.harmony-coupon-result {
    margin-top: 10px;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
}

.harmony-coupon-result.success {
    background: var(--harmony-primary-light);
    color: var(--harmony-primary-dark);
}

.harmony-coupon-result.error {
    background: #ffeaea;
    color: var(--harmony-danger);
}

/* Price Summary */
.harmony-price-summary {
    background: var(--harmony-gray-100);
    border-radius: 10px;
    padding: 20px;
    margin: 25px 0;
}

.harmony-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.harmony-discount-row {
    color: var(--harmony-success);
}

.harmony-total-row {
    font-size: 20px;
    font-weight: bold;
    color: var(--harmony-primary);
    border-top: 2px solid var(--harmony-gray-300);
    margin-top: 10px;
    padding-top: 15px;
}

/* Buttons */
.harmony-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    font-family: var(--harmony-font);
    transition: all 0.3s;
    text-decoration: none;
}

.harmony-btn-primary {
    background: var(--harmony-primary);
    color: white;
}

.harmony-btn-primary:hover {
    background: var(--harmony-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(1, 109, 71, 0.3);
}

.harmony-btn-secondary {
    background: var(--harmony-secondary);
    color: white;
}

.harmony-btn-secondary:hover {
    background: #138496;
}

.harmony-btn-link {
    background: none;
    color: var(--harmony-gray-500);
    padding: 10px;
}

.harmony-btn-link:hover {
    color: var(--harmony-danger);
}

.harmony-btn-large {
    width: 100%;
    padding: 15px 30px;
    font-size: 18px;
}

.harmony-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Payment Wrapper */
.harmony-payment-wrapper {
    background: var(--harmony-gray-100);
    border-radius: 10px;
    overflow: hidden;
    margin: 20px 0;
}

.harmony-payment-wrapper iframe {
    width: 100%;
    height: 450px;
    border: none;
}

.harmony-payment-footer {
    text-align: center;
    margin-top: 15px;
}

/* Success */
.harmony-success-content {
    text-align: center;
    padding: 40px 20px;
}

.harmony-success-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.harmony-success-content h2,
.harmony-success-content h3 {
    color: var(--harmony-primary);
    margin-bottom: 15px;
}

.harmony-success-content p {
    color: var(--harmony-gray-500);
    font-size: 16px;
}

/* Notices */
.harmony-event-notice {
    text-align: center;
    padding: 40px 20px;
    border-radius: var(--harmony-radius);
    margin: 30px 0;
}

.notice-ended {
    background: var(--harmony-gray-100);
}

.notice-full {
    background: #fff3e0;
}

.notice-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
}

/* Floating CTA */
.harmony-floating-cta {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 15px 20px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.harmony-floating-price {
    font-size: 20px;
    font-weight: bold;
    color: var(--harmony-primary);
}

.harmony-floating-cta .harmony-btn {
    flex: 1;
    max-width: 200px;
}

@media (max-width: 768px) {
    .harmony-floating-cta {
        display: flex;
    }
    
    .harmony-registration-section {
        margin-bottom: 100px;
    }
}

/* Events Grid */
.harmony-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

.harmony-event-card {
    background: white;
    border-radius: var(--harmony-radius);
    overflow: hidden;
    box-shadow: var(--harmony-shadow);
    transition: all 0.3s;
}

.harmony-event-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--harmony-shadow-hover);
}

.harmony-event-card.status-ended {
    opacity: 0.7;
}

.harmony-event-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.harmony-event-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.harmony-event-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.harmony-event-card:hover .harmony-event-card-image img {
    transform: scale(1.05);
}

.harmony-event-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--harmony-gray-200);
    font-size: 48px;
}

.harmony-event-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
}

.harmony-event-card-badge.status-ended {
    background: var(--harmony-gray-500);
    color: white;
}

.harmony-event-card-badge.status-full {
    background: var(--harmony-danger);
    color: white;
}

.harmony-event-card-content {
    padding: 20px;
}

.harmony-event-card-title {
    font-size: 18px;
    margin: 0 0 12px;
    color: var(--harmony-gray-900);
    line-height: 1.4;
}

.harmony-event-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.harmony-event-card-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--harmony-gray-500);
}

.harmony-event-card-meta .meta-icon {
    font-size: 14px;
}

.harmony-event-card-excerpt {
    font-size: 14px;
    color: var(--harmony-gray-500);
    margin: 0 0 15px;
    line-height: 1.6;
}

.harmony-event-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--harmony-gray-200);
}

.harmony-event-card-price {
    font-size: 18px;
    font-weight: bold;
    color: var(--harmony-primary);
}

.harmony-event-card-cta {
    font-size: 14px;
    font-weight: 600;
    color: var(--harmony-primary);
    transition: transform 0.3s;
}

.harmony-event-card:hover .harmony-event-card-cta {
    transform: translateX(-5px);
}

/* No Events */
.harmony-no-events {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: var(--harmony-gray-100);
    border-radius: var(--harmony-radius);
}

.harmony-no-events-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
}

/* Error Messages */
.harmony-error {
    background: #ffeaea;
    color: var(--harmony-danger);
    padding: 15px 20px;
    border-radius: 8px;
    text-align: center;
}

/* Loading State */
.harmony-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    color: var(--harmony-gray-500);
}

.harmony-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid var(--harmony-gray-300);
    border-top-color: var(--harmony-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 600px) {
    .harmony-event-single {
        padding: 15px;
    }
    
    .harmony-event-meta {
        flex-direction: column;
    }
    
    .harmony-phone-input-wrapper {
        flex-direction: column;
    }
    
    .harmony-registration-section,
    .harmony-waiting-list-section {
        padding: 20px;
    }
    
    .harmony-events-grid {
        grid-template-columns: 1fr;
    }
}
