:root {
    --stem-bg: #0B1622;
    --stem-border: #00E0FF;
    --stem-text: #ffffff;
    --stem-input-bg: rgba(255, 255, 255, 0.1);
    --stem-error: #ff4444;
}

/* Frontend Styles */
.stem-cl-wrapper {
    background: var(--stem-bg);
    border: 1px solid var(--stem-border);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 224, 255, 0.1);
}

.stem-cl-wrapper h4 {
    color: var(--stem-border);
    margin-top: 0;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(0, 224, 255, 0.2);
    padding-bottom: 10px;
}

.stem-cl-field {
    margin-bottom: 15px;
}

.stem-cl-field label {
    color: var(--stem-text);
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.stem-cl-field input[type="text"],
.stem-cl-field input[type="number"],
.stem-cl-field input[type="date"],
.stem-cl-field textarea,
.stem-cl-field input[type="file"],
.stem-cl-field input.flatpickr-input {
    width: 100%;
    background: var(--stem-input-bg);
    border: 1px solid #555;
    color: var(--stem-text);
    padding: 10px;
    border-radius: 4px;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.stem-cl-field input:focus,
.stem-cl-field textarea:focus {
    border-color: var(--stem-border);
    outline: none;
    box-shadow: 0 0 5px rgba(0, 224, 255, 0.5);
}

.stem-cl-error {
    border-color: var(--stem-error) !important;
}

.stem-error-msg {
    color: var(--stem-error);
    font-size: 0.85em;
    margin-top: 5px;
    display: none;
}

/* Color Picker */
.stem-color-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.stem-color-wrapper input[type="color"] {
    border: none;
    width: 50px;
    height: 40px;
    padding: 0;
    background: none;
    cursor: pointer;
}

.stem-color-wrapper input[type="text"] {
    flex-grow: 1;
}

/* Image Manager Modal */
.stem-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.stem-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.stem-modal {
    background: var(--stem-bg);
    border: 1px solid var(--stem-border);
    width: 90%;
    max-width: 600px;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 224, 255, 0.2);
    position: relative;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.stem-modal h3 {
    color: var(--stem-border);
    margin-top: 0;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.stem-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #fff;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
}

.stem-image-grid {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
    min-height: 100px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 4px;
    border: 1px dashed #444;
}

.stem-thumb-item {
    position: relative;
    width: 100px;
    height: 100px;
    border: 1px solid #555;
    border-radius: 4px;
    overflow: hidden;
}

.stem-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stem-thumb-item .stem-remove-img {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(200, 0, 0, 0.8);
    color: white;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
}

.stem-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid #333;
}

.stem-btn {
    background: var(--stem-border);
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 13px;
}

.stem-btn-outline {
    background: transparent;
    border: 1px solid var(--stem-border);
    color: var(--stem-border);
}

/* Flatpickr Overrides */
.flatpickr-calendar.dark {
    background: var(--stem-bg);
    border: 1px solid var(--stem-border);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.flatpickr-calendar.arrowTop:before,
.flatpickr-calendar.arrowTop:after {
    border-bottom-color: var(--stem-border);
}

.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(--stem-border);
    border-color: var(--stem-border);
    color: #000;
}

/* Admin Styles */
#stem-cl-repeater-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: #fff;
    border: 1px solid #ddd;
}

#stem-cl-repeater-table th {
    background: #f1f1f1;
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

#stem-cl-repeater-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

#stem-cl-repeater-table input[type="text"],
#stem-cl-repeater-table input[type="number"],
#stem-cl-repeater-table select {
    width: 100%;
    max-width: 100%;
}

.stem-remove-row {
    color: #a00;
    text-decoration: none;
    cursor: pointer;
    font-weight: bold;
}

.stem-remove-row:hover {
    color: red;
}

.stem-add-row {
    margin-top: 10px;
}