/**
 * JJ Entertainment CRM - Frontend Styles
 *
 * @package JJ_Entertainment_CRM
 * @since 1.0.0
 */

/* ==========================================================================
   General Frontend Styles
   ========================================================================== */

.jj-crm-frontend {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: #333;
}

/* ==========================================================================
   Form Styles
   ========================================================================== */

.jj-crm-booking-form-widget,
.jj-crm-contact-form-widget {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.jj-crm-form-title {
    font-size: 2em;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    text-align: center;
}

.jj-crm-form-description {
    font-size: 1.1em;
    color: #7f8c8d;
    text-align: center;
    margin-bottom: 30px;
}

.jj-crm-form {
    display: block;
}

.jj-crm-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.jj-crm-form-group {
    flex: 1;
    margin-bottom: 20px;
}

.jj-crm-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
}

.jj-crm-form-group input,
.jj-crm-form-group select,
.jj-crm-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
}

.jj-crm-form-group input:focus,
.jj-crm-form-group select:focus,
.jj-crm-form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.jj-crm-form-group input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
}

.jj-crm-checkbox-label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.jj-crm-checkbox-label .checkmark {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e1e8ed;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    background: #fff;
}

.jj-crm-checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #27ae60;
    font-weight: bold;
}

.jj-crm-submit-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.jj-crm-submit-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.jj-crm-submit-btn:active {
    transform: translateY(0);
}

.jj-crm-form-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
}

.jj-crm-form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.jj-crm-form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.jj-crm-form-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ==========================================================================
   Calendar Widget Styles
   ========================================================================== */

.jj-crm-calendar-widget {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.jj-crm-calendar-title {
    font-size: 2em;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    text-align: center;
}

.jj-crm-calendar-description {
    font-size: 1.1em;
    color: #7f8c8d;
    text-align: center;
    margin-bottom: 30px;
}

.jj-crm-calendar-container {
    margin-top: 30px;
}

.jj-crm-calendar-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    flex-wrap: wrap;
    gap: 15px;
}

.jj-crm-calendar-nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.jj-crm-calendar-nav button {
    background: #fff;
    border: 1px solid #e1e8ed;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.jj-crm-calendar-nav button:hover {
    background: #f8f9fa;
    border-color: #3498db;
}

.jj-crm-calendar-nav .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.jj-crm-calendar-today {
    background: #3498db !important;
    color: white;
    border-color: #3498db !important;
}

.jj-crm-calendar-today:hover {
    background: #2980b9 !important;
}

.jj-crm-calendar-title-display h4 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
    color: #2c3e50;
}

.jj-crm-calendar-views {
    display: flex;
    gap: 5px;
}

.jj-crm-calendar-view-btn {
    background: #fff;
    border: 1px solid #e1e8ed;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.jj-crm-calendar-view-btn:hover {
    background: #f8f9fa;
    border-color: #3498db;
}

.jj-crm-calendar-view-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.jj-crm-calendar-main {
    background: #fff;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    min-height: 500px;
}

/* FullCalendar Customization */
.fc {
    font-family: inherit;
}

.fc-toolbar {
    display: none; /* We have custom toolbar */
}

.fc-day-header {
    background: #f8f9fa;
    padding: 10px;
    font-weight: 600;
    color: #2c3e50;
}

.fc-day {
    border-color: #e1e8ed;
}

.fc-day-number {
    padding: 8px;
    font-weight: 500;
}

.fc-event {
    border-radius: 4px;
    border: none;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fc-event:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.jj-crm-calendar-event {
    background: #3498db;
    color: white;
}

.jj-crm-event-status-pending {
    background: #f39c12;
}

.jj-crm-event-status-confirmed {
    background: #27ae60;
}

.jj-crm-event-status-cancelled {
    background: #e74c3c;
}

.jj-crm-event-status-completed {
    background: #95a5a6;
}

/* ==========================================================================
   Google Calendar Integration
   ========================================================================== */

.jj-crm-google-calendar-integration {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e1e8ed;
}

.jj-crm-google-calendar-integration h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1em;
}

.jj-crm-google-calendar-frame {
    width: 100%;
    height: 400px;
    border: 1px solid #e1e8ed;
    border-radius: 4px;
    background: #fff;
}

/* ==========================================================================
   Quick Booking Form
   ========================================================================== */

.jj-crm-quick-booking-form {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e1e8ed;
}

.jj-crm-quick-booking-form h4 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 1.1em;
}

.jj-crm-quick-booking .jj-crm-form-row {
    margin-bottom: 15px;
}

.jj-crm-quick-booking .jj-crm-form-group {
    margin-bottom: 15px;
}

.jj-crm-quick-booking .jj-crm-submit-btn {
    padding: 12px 25px;
    font-size: 16px;
}

/* ==========================================================================
   Event Modal
   ========================================================================== */

.jj-crm-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.jj-crm-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.jj-crm-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e1e8ed;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.jj-crm-modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.3em;
}

.jj-crm-modal-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

.jj-crm-modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e1e8ed;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.jj-crm-modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s ease;
}

.jj-crm-modal-close:hover {
    color: #333;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .jj-crm-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .jj-crm-calendar-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .jj-crm-calendar-nav,
    .jj-crm-calendar-views {
        justify-content: center;
    }
    
    .jj-crm-modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .jj-crm-modal-footer {
        flex-direction: column;
    }
    
    .jj-crm-modal-footer .jj-crm-btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .jj-crm-booking-form-widget,
    .jj-crm-contact-form-widget,
    .jj-crm-calendar-widget {
        padding: 15px;
        margin: 10px;
    }
    
    .jj-crm-form-title {
        font-size: 1.5em;
    }
    
    .jj-crm-form-description {
        font-size: 1em;
    }
    
    .jj-crm-calendar-toolbar {
        padding: 10px;
    }
    
    .jj-crm-calendar-nav button,
    .jj-crm-calendar-view-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.jj-crm-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.jj-crm-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.jj-crm-text-center {
    text-align: center;
}

.jj-crm-text-left {
    text-align: left;
}

.jj-crm-text-right {
    text-align: right;
}

.jj-crm-mt-20 {
    margin-top: 20px;
}

.jj-crm-mb-20 {
    margin-bottom: 20px;
}

.jj-crm-p-20 {
    padding: 20px;
}

.jj-crm-hidden {
    display: none !important;
}

.jj-crm-visible {
    display: block !important;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .jj-crm-calendar-toolbar,
    .jj-crm-quick-booking-form,
    .jj-crm-google-calendar-integration {
        display: none;
    }
    
    .jj-crm-calendar-main {
        border: none;
        box-shadow: none;
    }
    
    .jj-crm-form {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
