:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --bg-gray: #f8fafc;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-gray);
    background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('../images/create.png') no-repeat center center fixed;
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.header-logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    padding: 6px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.header-logo {
    height: 32px;
    width: auto;
}

.header-divider {
    width: 1px;
    height: 36px;
    background: rgba(0, 0, 0, 0.1);
}

.header-text {
    display: flex;
    flex-direction: column;
}

.header-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.header-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.header-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.header-back-btn:hover {
    background: var(--bg-gray);
    border-color: var(--primary);
    color: var(--primary);
}

/* Main */
.main {
    padding: 40px 24px;
    min-height: calc(100vh - 72px);
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* Stepper */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.stepper {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 32px;
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stepper-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.stepper-circle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-gray);
    border: 2px solid var(--border);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
}

.stepper-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.stepper-item.active .stepper-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.stepper-item.active .stepper-label {
    color: var(--primary);
    font-weight: 600;
}

.stepper-item.completed .stepper-circle {
    background: var(--success);
    border-color: var(--success);
    color: var(--white);
}

.stepper-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin: 0 8px;
    position: relative;
    top: -12px;
}

/* Errors */
.errors {
    margin-bottom: 24px;
}

.error-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fef2f2;
    border-left: 3px solid var(--error);
    border-radius: var(--radius);
    color: #991b1b;
    font-size: 14px;
    margin-bottom: 12px;
}

/* Form Steps */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.step-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.step-description {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

/* Form Groups */
.form-group {
    margin-bottom: 24px;
}

.label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.label.required::after {
    content: '*';
    color: var(--error);
    margin-left: 4px;
}

.input,
.select,
textarea,
input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="url"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: inherit;
    color: var(--text-primary);
    transition: var(--transition);
}

.input:focus,
.select:focus,
textarea:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="url"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

.help-text {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Hide number spinners */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

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

/* Upload Container */
.upload-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.upload-box {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-gray);
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
}

.upload-box:hover {
    border-color: var(--primary);
    background: #eff6ff;
}

.upload-box.large {
    min-height: 320px;
}

.upload-box.small {
    min-height: 320px;
}

.upload-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
}

.upload-empty svg {
    color: var(--text-muted);
    margin-bottom: 16px;
}

.upload-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.upload-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.upload-hint {
    font-size: 13px;
    color: var(--text-muted);
}

.upload-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: calc(var(--radius-lg) - 2px);
}

.upload-remove {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.95);
    border: none;
    border-radius: 50%;
    color: var(--white);
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
}

.upload-remove:hover {
    background: var(--error);
    transform: scale(1.1);
}

/* Radio Cards */
.radio-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.radio-card {
    position: relative;
    cursor: pointer;
}

.radio-card input {
    position: absolute;
    opacity: 0;
}

.radio-content {
    padding: 20px;
    background: var(--bg-gray);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    transition: var(--transition);
}

.radio-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.radio-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.radio-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.radio-card:hover .radio-content {
    border-color: var(--primary);
    background: var(--white);
}

.radio-card input:checked + .radio-content {
    border-color: var(--primary);
    background: #eff6ff;
}

/* Ticket Builder */
.ticket-builder {
    margin-top: 24px;
    padding: 24px;
    background: var(--bg-gray);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.ticket-form {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 12px;
    margin-bottom: 20px;
}

.tickets-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ticket-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.ticket-info {
    display: flex;
    gap: 20px;
    flex: 1;
}

.ticket-info span {
    font-size: 14px;
    color: var(--text-secondary);
}

.ticket-info strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Custom Field */
.custom-field {
    padding: 24px;
    background: var(--bg-gray);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    animation: slideIn 0.3s ease;
}

.custom-field .label {
    margin-bottom: 8px;
}

.custom-field input,
.custom-field textarea {
    margin-bottom: 16px;
}

.custom-field button {
    padding: 8px 16px;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.custom-field button:hover {
    background: var(--error);
    color: var(--white);
    border-color: var(--error);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-gray);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--white);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline {
    background: var(--white);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: var(--bg-gray);
    border-color: var(--primary);
    color: var(--primary);
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.form-actions .btn-primary {
    margin-left: auto;
}

/* Select2 Premium Customization */
.select2-container--default .select2-selection--single {
    height: 52px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--white);
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 50px;
    padding-left: 20px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 50px;
    right: 12px;
}

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.select2-dropdown {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    background: var(--white);
    padding: 8px;
    margin-top: 8px;
    overflow: hidden;
    animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.select2-search--dropdown {
    padding: 8px 12px;
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    padding: 12px 12px 12px 40px !important;
    background: var(--bg-gray) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E") no-repeat 14px center !important;
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: var(--primary) !important;
    background-color: var(--white) !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.select2-results__options {
    max-height: 300px;
}

.select2-results__option {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 2px;
    transition: var(--transition);
}

.select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary) !important;
    color: var(--white) !important;
}

.select2-results__option[aria-selected=true] {
    background-color: #eff6ff !important;
    color: var(--primary) !important;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .stepper {
        overflow-x: auto;
        scrollbar-width: none;
    }
    
    .stepper::-webkit-scrollbar {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 16px;
    }
    
    .header-divider,
    .header-title {
        display: none;
    }
    
    .header-logo {
        height: 36px;
    }
    
    .header-back-btn {
        font-size: 13px;
        padding: 8px 14px;
    }
    
    .main {
        padding: 24px 16px;
    }
    
    .stepper {
        padding: 20px;
    }
    
    .stepper-circle {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }
    
    .stepper-label {
        font-size: 11px;
    }
    
    .card {
        padding: 24px;
    }
    
    .step-title {
        font-size: 20px;
    }
    
    .step-description {
        font-size: 14px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .upload-container {
        grid-template-columns: 1fr;
    }
    
    .upload-box.large,
    .upload-box.small {
        min-height: 240px;
    }
    
    .radio-cards {
        grid-template-columns: 1fr;
    }
    
    .ticket-form {
        grid-template-columns: 1fr;
    }
    
    .ticket-info {
        flex-direction: column;
        gap: 8px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn-primary {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .header-back-btn span {
        display: none;
    }
    
    .card {
        padding: 20px;
    }
}

/* Smooth Transitions */
button,
input,
select,
textarea {
    transition: var(--transition);
}
/* Flatpickr Customization */
.flatpickr-calendar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: var(--shadow-lg) !important;
    border-radius: var(--radius) !important;
}

.flatpickr-day.selected, 
.flatpickr-day.startRange, 
.flatpickr-day.endRange, 
.flatpickr-day.selected.inRange, 
.flatpickr-day.startRange.inRange, 
.flatpickr-day.endRange.inRange, 
.flatpickr-day.selected:focus, 
.flatpickr-day.startRange:focus, 
.flatpickr-day.endRange:focus, 
.flatpickr-day.selected:hover, 
.flatpickr-day.startRange:hover, 
.flatpickr-day.endRange:hover, 
.flatpickr-day.selected.prevMonthDay, 
.flatpickr-day.startRange.prevMonthDay, 
.flatpickr-day.endRange.prevMonthDay, 
.flatpickr-day.selected.nextMonthDay, 
.flatpickr-day.startRange.nextMonthDay, 
.flatpickr-day.endRange.nextMonthDay {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
}

.flatpickr-time input:focus {
    background: #eff6ff !important;
}