File size: 4,317 Bytes
a895648
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
/* Layer Editor Styles for Neural Network Playground */

/* Modal styling */
#layer-editor-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#layer-editor-modal.active {
    opacity: 1;
}

#layer-editor-modal .modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    width: 80%;
    max-width: 600px;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    overflow: hidden; /* Prevent content from causing layout shifts */
}

#layer-editor-modal.active .modal-content {
    transform: translateY(0);
}

/* Make the modal more obvious for debugging */
#layer-editor-modal[data-visible="true"] {
    /* Remove the debug border */
    /* border: 3px solid red; */
}

.modal-title {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* Top close button */
.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    transition: color 0.2s ease;
    z-index: 10; /* Ensure it's above other content */
}

.close-modal:hover {
    color: #333;
}

/* Form styling */
.layer-form {
    margin-bottom: 20px;
    overflow: auto; /* Allow scrolling if form gets too long */
    max-height: 60vh; /* Limit height to avoid modal being too tall */
}

.form-field {
    margin-bottom: 15px;
}

.form-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #2c3e50;
}

.form-field input,
.form-field select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field input:focus,
.form-field select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
    outline: none;
}

.help-text {
    display: block;
    margin-top: 5px;
    color: #7f8c8d;
    font-size: 12px;
}

/* Button styling */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 15px;
    border-top: 1px solid #eee;
    background-color: #fff; /* Ensure background is solid */
    position: relative; /* Establish a stacking context */
    z-index: 5; /* Higher than the form */
}

.modal-footer button {
    padding: 8px 16px;
    margin-left: 10px;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    /* Remove transition to prevent flickering */
    /* transition: background-color 0.2s ease; */
    position: relative; /* Establish a stacking context */
    z-index: 2; /* Higher than surrounding elements */
    text-rendering: optimizeLegibility; /* Improve text rendering */
    -webkit-font-smoothing: antialiased;
}

.save-layer-btn {
    background-color: #3498db;
    color: white;
    /* Fix position and prevent movement */
    transform: translateZ(0); /* Force GPU acceleration */
}

.save-layer-btn:hover {
    background-color: #2980b9;
}

/* Override for close button in footer */
.modal-footer .close-modal {
    position: static;
    background-color: #e0e0e0;
    color: #333;
    font-size: 14px;
    transform: translateZ(0); /* Force GPU acceleration */
}

.modal-footer .close-modal:hover {
    background-color: #ccc;
}

/* For number inputs */
input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Error state */
.form-field.error input,
.form-field.error select {
    border-color: #e74c3c;
}

.error-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #layer-editor-modal .modal-content {
        width: 90%;
        margin: 15% auto;
        padding: 15px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer button {
        margin-left: 0;
        margin-top: 10px;
    }
}