/* CSS Reset & Variable DesignTokens */
.ics-wrapper {
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f5f5f5;
    color: #222222;
    padding: 20px;
    border-radius: 12px;
    width: 100%;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.ics-wrapper *, .ics-wrapper *::before, .ics-wrapper *::after {
    box-sizing: border-box;
}

/* Header Bar Component */
.ics-header {
    background-color: #222222;
    padding: 16px 24px;
    border-radius: 8px;
    margin-bottom: 24px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.ics-header h1 {
    color: #ffffff !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Layout Grid System */
.ics-container {
    display: table;
    width: 100%;
}

.ics-panel {
    display: table-cell;
    vertical-align: top;
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e0e0e0;
}

.ics-controls {
    width: 45%;
    padding-right: 25px;
}

.ics-preview-panel {
    width: 55%;
    padding-left: 25px;
    border-left: none;
}

/* Section Styling */
.ics-section {
    background: #fafafa;
    border: 1px solid #eaeaea;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 18px;
}

.ics-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #444444;
    text-transform: uppercase;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #eaeaea;
    padding-bottom: 6px;
}

.flex-justify {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Control Elements */
.ics-control-group {
    margin-bottom: 12px;
}
.ics-control-group:last-child {
    margin-bottom: 0;
}

.ics-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: #555555;
    margin-bottom: 6px;
}

.ics-value-val {
    color: #888888;
}

.ics-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    outline: none;
    margin: 8px 0;
}

.ics-slider::-webkit-skin-thumb,
.ics-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #00f0ff;
    border: 2px solid #222222;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.ics-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #00f0ff;
    border: 2px solid #222222;
    cursor: pointer;
}

/* Select & Inputs */
.ics-select {
    width: 100%;
    padding: 8px 12px;
    background-color: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 4px;
    color: #222222;
    font-size: 13px;
    outline: none;
}

.ics-control-row {
    display: flex;
    gap: 12px;
}

.flex-1 { flex: 1; }
.narrow { width: 70px; }
.mt-10 { margin-top: 10px; }

.ics-color-picker {
    -webkit-appearance: none;
    border: 1px solid #cccccc;
    width: 100%;
    height: 34px;
    border-radius: 4px;
    cursor: pointer;
    background: none;
    padding: 0;
}
.ics-color-picker::-webkit-color-swatch-wrapper { padding: 0; }
.ics-color-picker::-webkit-color-swatch { border: none; border-radius: 3px; }

/* Dropzone styling */
.ics-upload-box {
    border: 2px dashed #cccccc;
    background: #ffffff;
    padding: 24px;
    text-align: center;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.ics-upload-box:hover, .ics-upload-box.dragover {
    border-color: #00f0ff;
    background: #fdfdfd;
}

.ics-upload-box svg {
    stroke: #888888;
    margin-bottom: 8px;
}

.ics-upload-box p {
    margin: 0;
    font-size: 13px;
    color: #666666;
}

.ics-browse-txt {
    color: #0073aa;
    font-weight: 600;
    text-decoration: underline;
}

/* Custom Toggle Switch */
.ics-toggle-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 12px;
}
.ics-toggle-label input {
    margin-right: 6px;
}

/* Canvas & Stage Components */
.ics-preview-stage {
    background: #e9e9e9;
    border: 1px solid #dddddd;
    border-radius: 6px;
    padding: 30px;
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.ics-canvas-container {
    max-width: 100%;
    max-height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ics-placeholder {
    text-align: center;
    color: #777777;
    max-width: 280px;
}

.ics-placeholder p {
    font-size: 13px;
    line-height: 1.4;
    margin-top: 10px;
}

#ics-main-canvas {
    max-width: 100%;
    height: auto !important;
    display: block;
    object-fit: contain;
}

/* Neon Action Button styling */
.ics-export-actions {
    margin-top: 20px;
}

.ics-btn-neon {
    width: 100%;
    background-color: #00f0ff !important;
    color: #111111 !important;
    border: 2px solid #222222 !important;
    padding: 14px 24px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    box-shadow: 0 4px 0px #111111 !important;
    transition: transform 0.05s ease, box-shadow 0.05s ease !important;
}

.ics-btn-neon:hover:not([disabled]) {
    transform: translateY(1px);
    box-shadow: 0 3px 0px #111111 !important;
}

.ics-btn-neon:active:not([disabled]) {
    transform: translateY(4px);
    box-shadow: 0 0px 0px #111111 !important;
}

.ics-btn-neon[disabled] {
    background-color: #e0e0e0 !important;
    color: #999999 !important;
    border-color: #cccccc !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
}

/* Responsive Overrides (No Layout Breakages) */
@media (max-width: 820px) {
    .ics-container, .ics-panel {
        display: block !important;
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    .ics-preview-panel {
        margin-top: 24px;
    }
}