/* ============================================
   EVENT TYPE GRID VIEW STYLES
   Works with appoiintcard.css for card display
   ============================================ */

/* Grid Container */
.eventtype-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

/* Card Header (for checkbox and status) */
.event-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.event-status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.event-status-badge.active {
    background-color: #10b981;
    color: white;
}

.event-status-badge.inactive {
    background-color: #6b7280;
    color: white;
}

/* Card Selection State */
.event-card[data-selected="true"] {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Card Actions Layout */
.event-card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.event-card-secondary-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.event-card-action-btn {
    background: transparent;
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-color);
}

.event-card-action-btn:hover {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
}

/* View Toggle Buttons */
.view-toggle-buttons {
    display: flex;
    gap: 0.5rem;
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 0.5rem;
    padding: 0.25rem;
    background: var(--color-surface);
}

.view-toggle-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #cccccc;
    font-weight: 500;
}

.view-toggle-btn:hover {
    background-color: rgba(0,0,0,0.05);
}

.view-toggle-btn.active {
    background-color: var(--brand-primary);
    color: #000000;
}

.view-toggle-btn i {
    margin-right: 0.5rem;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .eventtype-grid-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .eventtype-grid-container {
        grid-template-columns: 1fr;
    }
    
    .event-card-actions {
        flex-direction: column;
    }
}

/* Edit Button - Distinct styling for better visibility */
.btn-primary-custom-edit {
    background-color: var(--brand-primary, #000000);
    color: #ffffff;
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    cursor: pointer;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-primary-custom-edit:hover {
    background-color: #111111;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.btn-primary-custom-edit:active {
    background-color: #001100;
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-primary-custom-edit i {
    font-size: 0.875rem;
}

@media (max-width: 480px) {
    .event-card-header {
        margin-bottom: 0.75rem;
    }
    
    .event-card-actions {
        gap: 0.5rem;
    }
    
    .btn-primary-custom-edit {
        padding: 0.625rem 1.25rem;
        font-size: 0.85rem;
    }
}

/* ============================================
   EVENT TYPE FORM WITH IFRAME PREVIEW
   Similar to user-profile page layout
   ============================================ */

/* Maximize container width */
.eventtype-form-container {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Form Container with Preview Layout */
.eventtype-form-with-preview {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    margin: 0;
    padding: 0;
    width: 100%;
}

/* Form Column */
.eventtype-form-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

/* Preview Column */
.eventtype-preview-column {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: sticky;
    top: 20px;
    align-self: flex-start;
}

.eventtype-preview-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--color-surface);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.eventtype-preview-container .section-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.eventtype-preview-container .section-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.eventtype-preview-container .section-header i {
    color: #0066cc;
    font-size: 14px;
}

.eventtype-preview-container .section-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
}

.eventtype-iframe-wrapper {
    width: 100%;
    height: 100%;
    min-height: 600px;
    display: flex;
    flex-direction: column;
}

.eventtype-iframe-wrapper iframe {
    width: 100%;
    height: 100%;
    flex: 1;
    border: none;
    background: var(--color-surface);
}

/* Refresh Button */
.preview-refresh-btn {
    background: transparent;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

.preview-refresh-btn:hover {
    background: rgba(0,0,0,0.05);
    color: var(--color-text-primary);
}

.preview-refresh-btn:active {
    transform: rotate(360deg);
    transition: transform 0.5s;
}

/* Loading State */
.eventtype-iframe-wrapper.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0066cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive Layout */
@media (max-width: 1400px) {
    .eventtype-form-with-preview {
        grid-template-columns: 55fr 45fr;
    }
}

@media (max-width: 1200px) {
    .eventtype-form-with-preview {
        grid-template-columns: 1fr;
    }
    
    .eventtype-preview-column {
        position: relative;
        top: 0;
    }
    
    .eventtype-iframe-wrapper {
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    .eventtype-iframe-wrapper {
        min-height: 400px;
    }
}

/* ============================================
   INLINE PREVIEW STYLES (Secure - No iframe)
   ============================================ */

.eventtype-inline-preview {
    width: 100%;
    height: 100%;
    min-height: 600px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.preview-booking-page {
    width: 100%;
    max-width: 400px;
}

.event-card-preview {
    background: var(--color-surface);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 2px solid var(--color-border);
    transition: all 0.3s ease;
}

.event-card-preview:hover {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.15), 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.event-card-color-bar {
    height: 4px;
    border-radius: 2px;
    margin-bottom: 16px;
}

.event-title-preview {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.event-description-preview {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.event-details-preview {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.event-detail-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #495057;
}

.event-detail-preview i {
    width: 16px;
    text-align: center;
    color: #6c757d;
}

.btn-preview {
    width: 100%;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-preview:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-preview:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Responsive adjustments for inline preview */
@media (max-width: 1200px) {
    .eventtype-inline-preview {
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    .eventtype-inline-preview {
        min-height: 400px;
        padding: 15px;
    }
    
    .event-card-preview {
        padding: 20px;
    }
    
    .event-title-preview {
        font-size: 18px;
    }
}
