/* === משתני בסיס === */
:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --text-color: #f8fafc;
    --background-dark: #0f172a;
    --background-light: #1e293b;
    --accent-color: #fbbf24;
    --danger-color: #ef4444;
    --success-color: #22c55e;
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

/* === איפוס ובסיס === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
   overflow-y: auto; 
   overflow-x: hidden; 
   margin: 0;
   padding: 0;
   font-family: 'Open Sans', system-ui, sans-serif;
   font-weight: bold;
   direction: rtl;
   height: 100%; 
}

body {
    background: linear-gradient(to left, rgba(162, 209, 233, 0.9), rgba(8, 87, 128, 0.9)), url('/img/SORA.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); 
    z-index: 0;
    pointer-events: none; 
}

/* === מיכל האירוע === */
.event-container {
    max-width: 1800px;
    margin: 1rem auto;
    padding: 2rem;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeIn 0.6s ease-out;
    position: relative;
    z-index: 1;
}

.event-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* === סגנונות תמונה === */
.event-image {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.event-image img {
    width: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.event-image:hover img {
    transform: scale(1.05);
}

/* === פרטי האירוע === */
.event-details {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.event-details h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.event-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.event-info p {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
}

.event-info i {
    color: var(--accent-color);
    font-size: 1.25rem;
}

.custom-email {
    color: #ffcc00; 
    font-weight: bold;
    text-decoration: none; 
}

.custom-email:hover {
    text-decoration: underline; 
}

/* === אזור תיאור === */
.description {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    height: 55vh;
    max-height: 400px;
    overflow-y: auto;
    direction: rtl;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) rgba(255, 255, 255, 0.1);
    word-wrap: break-word !important;
    word-break: break-all !important;
    overflow-wrap: break-word !important;
}

.description::-webkit-scrollbar {
    width: 8px;
}

.description::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
}

.description::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
    border-radius: var(--border-radius);
}

.description img, .event-content img {
    max-width: 400px !important;
    max-height: 700px !important;
    object-fit: contain !important;
    display: block;
    margin: 10px auto;
}

.event-image img {
    max-width: 100% !important;
    max-height: none !important;
}

/* === מיכל כרטיסים === */
.tickets-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: 2rem;
}

.ticket-item {
    display: grid;
    grid-template-columns: 3fr 2fr;
    align-items: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    transition: var(--transition);
}

.ticket-item:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.ticket-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ticket-name {
    font-weight: 600;
    color: var(--accent-color);
    margin-left: auto;
}

.ticket-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin-right: 1rem;
    white-space: nowrap;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 12px;
}

/* === בקרת כמות === */
.ticket-quantity {
    display: flex;
    justify-content: center;
    align-items: center;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    border-radius: var(--border-radius);
    min-width: 120px;
    justify-content: center;
}

.quantity-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.quantity-btn:hover:not(:disabled) {
    background: var(--secondary-color);
    transform: scale(1.05);
}

.quantity-btn:disabled {
    background: #64748b;
    cursor: not-allowed;
    opacity: 0.5;
}

.quantity-value {
    min-width: 32px;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    color: var(--text-color);
}

.sold-message {
    color: var(--danger-color);
    font-weight: bold;
    font-size: 1.1rem;
}

/* === כפתורים === */
.buy-now {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: var(--text-color);
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    width: 100%;
    margin-top: 0rem;
}

.buy-now:hover:not(:disabled) {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.buy-now:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #64748b;
    pointer-events: none;
}

.buy-now-gray {
    background: #64748b;
    cursor: not-allowed;
}

/* === טפסים === */
.form-wrapper {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: 2rem;
    width: 100%;
    min-height: 65vh;
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.form-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    column-gap: 36px;
    margin-top: 20px;
}

.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-group select, .form-group input {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    color: var(--text-color);
    font-size: 1rem;
    direction: rtl;
}

.form-group input::placeholder {
    color: var(--text-color);
    transition: all 0.3s ease;
}

.form-group input:focus::placeholder {
    color: var(--accent-color);
    transform: translateY(10px);
    font-size: 0.9rem;
}

.form-group select:not([multiple]) {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23fbbf24' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 0.75rem center;
    padding-left: 2.5rem;
}

.form-group select option {
    background-color: var(--background-dark);
    color: var(--text-color);
    padding: 0.5rem;
}

.form-group select:focus, .form-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: rgba(255, 255, 255, 0.15);
}

.form-group.error input, .form-group.error select, .form-group.error .custom-file-upload {
    border-color: #ef4444;
    background-color: rgba(239, 68, 68, 0.05);
}

.error-message {
    display: none;
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    text-align: right;
    transition: all 0.3s ease;
}

.form-group.error .error-message {
    display: block;
    animation: fadeIn 0.3s ease;
}

.custom-file-upload {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    min-height: 120px;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.custom-file-upload:hover {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.1));
    border-color: var(--accent-color);
}

.upload-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.upload-text .main-text { font-size: 16px; font-weight: 600; color: var(--text-color); }
.upload-text .sub-text { font-size: 14px; color: rgba(255, 255, 255, 0.7); }
.custom-file-upload i { font-size: 24px; color: var(--accent-color); }

.image-preview {
    margin-top: 10px;
    max-width: 100%;
    border-radius: 8px;
    overflow: hidden;
    display: none;
}
.image-preview img { width: 130px; height: 130px; display: block; object-fit: cover; }

/* === קופונים === */
.coupon-container {
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    display: grid;
}

.btn_open_form_info {
    background: var(--primary-color);
    color: var(--text-color);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 10px;
    text-align: center;
}

.btn_open_form_info:hover {
    background: var(--secondary-color);
}

/* === סיכום הזמנה === */
.order-details-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.order-items {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
}

.total-amount {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent-color);
}

.discount-row { color: #22c55e; font-size: 0.95rem; }
.commission-row { color: #94a3b8; font-size: 0.95rem; }

/* === תפריט עליון === */
.menu-container {
    background: rgb(255 255 255 / 95%);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    height: 54px;
    max-width: 1800px;
    margin: 33px auto 13px auto;
    position: relative;
    z-index: 2;
}

.logo_card { cursor: pointer; width: 293px; position: absolute; }
.menu-container button {
    width: 21px; position: absolute; right: 10px; font-size: 2.5rem;
    background: transparent; border: 0; top: 6px; color: #3857b3;
}

/* === פופאפ הודעות === */
.popup-alert {
    position: fixed; top: -100px; left: 50%; transform: translateX(-50%);
    background-color: rgba(180, 126, 250, 0.9); color: white;
    padding: 15px 25px; border-radius: 8px; z-index: 1000;
    text-align: center; transition: top 0.5s ease-in-out;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2); min-width: 200px;
}
.popup-alert.show { top: 20px; }

/* === אנימציות === */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px;
}
.loading-spinner i { font-size: 24px; color: var(--primary-color); animation: spin 1s linear infinite; }

/* === רספונסיביות === */
@media (max-width: 1024px) {
    .event-container { margin: 0; padding: 1.5rem; }
    .event-content { grid-template-columns: 1fr; }
    .menu-container { width: 90%; }
}

@media (max-width: 768px) {
    .description img, .event-content img { max-width: 250px !important; max-height: 550px !important; }
    .form-container { grid-template-columns: 1fr; }
    .description { max-height: none; margin-bottom: 5vh; }
    .event-details h1 { font-size: 2rem; }
    .ticket-item { grid-template-columns: 1fr; gap: 1rem; padding: 1rem; }
    .ticket-info { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .ticket-price { margin-right: 0; }
    .quantity-control { width: 100%; justify-content: space-between; }
    .form-wrapper { padding: 0; }
    .mobile-buttons {
        position: fixed; bottom: 0; left: 0; right: 0;
        background: var(--background-dark); padding: 10px; z-index: 1000;
        box-shadow: 0 -4px 10px rgba(0,0,0,0.3);
    }
    .mobile-buttons .buy-now { margin: 0; border-radius: 8px; }
}
.original-price {
    text-decoration: line-through;
    color: #ff6b6b;
    font-size: 0.8em;
    font-weight: bold;
    display: inline-block;
    position: relative;
}

.original-price::after {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 2px;
    background-color: #ff6b6b;
}