/* Modal Base Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 240, 240, 0.9) 100%);
    border-radius: 15px;
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem 1rem 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.modal-close {
    background: rgba(0, 0, 0, 0.1);
    border: none;
    color: #666;
    width: 35px;
    height: 35px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #333;
}

.modal-body {
    padding: 2rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.modal .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333 !important;
    font-size: 0.9rem;
}

.modal .form-group input:not(.quantity-controls input) {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white !important;
    color: #333 !important;
}

.modal .quantity-controls input {
    width: 60px;
    height: 40px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    background: white !important;
    color: #333 !important;
}

.modal .form-group input:focus:not(.quantity-controls input) {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white !important;
    color: #333 !important;
}

.modal .quantity-controls input:focus {
    outline: none;
    border-color: #667eea;
    background: white !important;
    color: #333 !important;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-row .form-group {
    margin-bottom: 0;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.modal .checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666 !important;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 4px;
    margin-right: 0.5rem;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 2px;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.modal .forgot-password, .modal .terms-link {
    color: #667eea !important;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.modal .forgot-password:hover, .modal .terms-link:hover {
    color: #5a6fd8 !important;
    text-decoration: underline;
}

.modal-btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.modal .modal-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.modal .modal-footer p {
    margin: 0 0 0.5rem 0;
    color: #666 !important;
    font-size: 0.9rem;
}

.modal .modal-footer a {
    color: #667eea !important;
    text-decoration: none;
    font-weight: 500;
}

.modal .modal-footer a:hover {
    text-decoration: underline;
    color: #5a6fd8 !important;
}

/* AI Modal Styles */
.ai-modal-content {
    max-width: 600px;
    width: 90%;
    max-height: 75vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0);
    transition: all 0.3s ease;
}

.ai-modal-content.show {
    transform: scale(1);
}

.ai-modal-content.hide {
    transform: scale(0);
}

.ai-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.ai-title h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.ai-title p {
    margin: 5px 0 0 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.ai-modal-body {
    padding: 25px;
    height: calc(75vh - 120px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Ticket Purchase Panel Styles */
.ticket-purchase-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 20000;
    display: flex;
    flex-direction: column;
    border-radius: 0 0 20px 20px;
}

.purchase-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.back-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
    margin-right: 15px;
}

.back-btn:hover {
    background: #e9ecef;
    color: #333;
}

.purchase-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.purchase-step {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.step-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.back-step-btn {
    background: none;
    border: none;
    padding: 8px;
    margin-right: 10px;
    border-radius: 4px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
}

.back-step-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.step-header h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

/* Location Grid */
.location-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.location-btn {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px 15px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.location-btn:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.location-name {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.location-count {
    color: #666;
    font-size: 14px;
}

/* Events List */
.events-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.event-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    gap: 15px;
}

.event-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

.modal-event-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.event-info {
    flex: 1;
}

.event-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 16px;
}

.event-date {
    color: #666;
    font-size: 14px;
    margin-bottom: 3px;
}

.event-venue {
    color: #888;
    font-size: 13px;
    margin-bottom: 8px;
}

.event-price {
    color: #667eea;
    font-weight: 600;
    font-size: 15px;
}

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

.ticket-type-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ticket-type-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.ticket-type-info h5 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 16px;
}

.ticket-type-info p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.ticket-type-price {
    color: #667eea;
    font-weight: 600;
    font-size: 18px;
}

/* Quantity Selection */
.quantity-selection {
    text-align: center;
}

.selected-ticket-info {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}

.selected-ticket-info h5 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 18px;
}

.selected-ticket-info p {
    margin: 0;
    color: #667eea;
    font-size: 16px;
    font-weight: 600;
}

.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background: #667eea;
    color: white;
}

.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#ticketQuantity {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    min-width: 40px;
}

.total-price {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 25px;
    font-size: 18px;
}

#totalPrice {
    color: #667eea;
    font-weight: 600;
}

.payment-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.payment-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

/* AI Message Styles */
.ai-message {
    margin-bottom: 20px;
}

.ai-message-content {
    background: #000000b5;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.ai-message-content p {
    margin: 0 0 10px 0;
    line-height: 1.6;
}

.ai-message-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.ai-message-content li {
    margin: 8px 0;
    line-height: 1.5;
}

.ai-quick-actions {
    margin-top: 0px;
}

.ai-quick-actions h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
}

.quick-action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.quick-action-btn {
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    padding: 15px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    text-align: center;
}

.quick-action-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* Message Styles */
.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    color: black;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ai-modal-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .ai-message-content {
        padding: 10px;
        font-size: 0.85rem;
    }
    
    .ai-message-content p {
        margin: 0 0 8px 0;
        line-height: 1.4;
    }
    
    .ai-message-content ul {
        margin: 8px 0;
        padding-left: 15px;
    }
    
    .ai-message-content li {
        margin: 5px 0;
        line-height: 1.3;
    }
    
    .quick-action-buttons {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 8px;
    }
    
    .quick-action-btn {
        padding: 12px 8px;
        font-size: 0.8rem;
    }
    
    .location-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-row .form-group {
        margin-bottom: 1.5rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-header {
        padding: 1rem 1.5rem 0.5rem 1.5rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}