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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.4;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Language Switcher */
.language-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.lang-link {
    color: #333;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 15px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
}

.lang-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.lang-link.active {
    background: #667eea;
    color: white;
}

/* Language switcher adjustments when error panel is open */
body.error-panel-open .language-switcher {
    right: 420px;
}

/* Main Layout Container */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Documentation Panel */
.docs-panel {
    position: fixed;
    top: 0;
    left: -400px;
    width: 400px;
    height: 100vh;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
}

.docs-panel.open {
    left: 0;
}

.docs-header {
    padding: 20px;
    background: linear-gradient(135deg, #1a252f 0%, #2c3e50 100%);
    border-bottom: 2px solid #34495e;
    position: sticky;
    top: 0;
    z-index: 10;
}

.docs-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ecf0f1;
}

.docs-subtitle {
    font-size: 0.9rem;
    color: #bdc3c7;
}

.close-docs {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #ecf0f1;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.close-docs:hover {
    background-color: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.docs-content {
    padding: 20px;
}

.docs-section {
    margin-bottom: 30px;
}

.docs-section h3 {
    color: #3498db;
    font-size: 1.1rem;
    margin-bottom: 12px;
    padding-bottom: 5px;
    border-bottom: 1px solid #34495e;
}

.docs-section h4 {
    color: #e67e22;
    font-size: 1rem;
    margin: 15px 0 8px 0;
}

.docs-section p {
    margin-bottom: 10px;
    color: #ecf0f1;
    font-size: 0.9rem;
    line-height: 1.5;
}

.docs-code {
    background: #1a252f;
    padding: 8px 12px;
    border-radius: 5px;
    font-family: 'Courier New', Monaco, monospace;
    font-size: 0.85rem;
    color: #2ecc71;
    margin: 8px 0;
    border-left: 3px solid #3498db;
    white-space: pre-wrap;
}

.docs-list {
    margin: 10px 0;
    padding-left: 20px;
}

.docs-list li {
    margin-bottom: 5px;
    color: #ecf0f1;
    font-size: 0.9rem;
}

.docs-list li strong {
    color: #f39c12;
}

.docs-list li code {
    background: #1a252f;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', Monaco, monospace;
    font-size: 0.8rem;
    color: #2ecc71;
}

/* Error Panel */
.error-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow-y: auto;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

.error-panel.open {
    right: 0;
}

.error-header {
    padding: 20px;
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    border-bottom: 2px solid #e74c3c;
    position: sticky;
    top: 0;
    z-index: 10;
}

.error-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffffff;
}

.error-subtitle {
    font-size: 0.9rem;
    color: #f8d7da;
}

.close-error {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.close-error:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.error-content {
    padding: 20px;
}

.error-header-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.error-type-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    flex: 1;
}

.error-type-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.error-type-file_processing { background: #e67e22; color: white; }
.error-type-template { background: #9b59b6; color: white; }
.error-type-validation { background: #f39c12; color: white; }
.error-type-configuration { background: #3498db; color: white; }
.error-type-file_io { background: #e74c3c; color: white; }
.error-type-upload { background: #1abc9c; color: white; }
.error-type-internal { background: #7f8c8d; color: white; }

.error-description {
    margin-bottom: 16px;
}

.error-description p {
    margin-bottom: 8px;
    line-height: 1.5;
}

.error-details {
    margin-bottom: 16px;
}

.error-details p {
    margin-bottom: 8px;
    font-weight: 600;
}

.error-details-content {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 12px;
    font-family: 'Courier New', Monaco, monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #f8f9fa;
    word-break: break-word;
    overflow-wrap: break-word;
}

.error-suggestions {
    margin-bottom: 16px;
}

.error-suggestions p {
    margin-bottom: 8px;
    font-weight: 600;
}

.error-suggestions-list {
    list-style: none;
    padding: 0;
}

.error-suggestions-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    line-height: 1.5;
}

.error-suggestions-list li:before {
    content: "•";
    color: #e74c3c;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.error-section {
    margin-bottom: 30px;
}

.error-message {
    background: #1a252f;
    padding: 15px;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #ecf0f1;
    border-left: 4px solid #e74c3c;
}

.error-message strong {
    color: #f39c12;
    font-weight: 600;
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: 15px;
    transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1), margin-right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content.docs-open {
    margin-left: 400px;
}

.main-content.error-open {
    margin-right: 400px;
}

/* Existing styles for the main form */
.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 2.2rem;
    font-weight: 300;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.info {
    color: #333;
    padding: 10px 0;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

/* Enhanced Upload Area */
.upload-area {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 30px 20px;
    text-align: center;
    margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s ease;
}

.upload-area.dragover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    border-color: #764ba2;
    transform: scale(1.02) translateY(-3px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.3);
}

.upload-content {
    position: relative;
    z-index: 1;
}

.upload-icon {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 15px;
    display: block;
    animation: float 3s ease-in-out infinite;
}

.upload-area p {
    color: #667eea;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.upload-subtext {
    color: #8e9aaf;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

/* Hidden file input */
#file {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.browse-button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 10px 25px;
    border: none;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    position: relative;
    z-index: 2;
}

.browse-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Form Styles */
.form-section {
    background: #f8f9fc;
    padding: 5px 20px 0 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.section-title {
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.section-title.additional-settings-title {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    flex: 1 1 auto;
}

.section-title.additional-settings-title::after {
    display: none;
}

.form-group {
    margin-bottom: 10px;
    margin-top: 10px;
    display: grid;
    grid-template-columns: auto 4fr 1fr 1fr;
    align-items: center;
    gap: 12px;
}

.form-group.form-group-with-button {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.form-group.form-group-with-button > .form-checkbox {
    flex: 0 0 auto;
}

.form-group.form-group-with-button > label {
    flex: 0 0 auto;
}

.form-group.form-group-with-button > .form-select {
    flex: 1 1 200px;
    min-width: 150px;
}

.form-group.form-group-with-button > .template-button {
    flex: 0 1 auto;
}

.form-group input[type="number"] {
    justify-self: stretch;
    width: 100%;
}

/* Checkbox Styles */
.form-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
    cursor: pointer;
    transform: scale(1.1);
}

.form-checkbox:checked {
    accent-color: #00b894;
}

label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    cursor: pointer;
    transition: color 0.3s ease;
}

input[type="number"] {
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
    font-weight: 500;
}

input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

/* Select Dropdown Styles */
.form-select {
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23667eea" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px;
    padding-right: 35px;
}

.form-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.form-select:hover {
    border-color: #667eea;
}

.form-select option {
    padding: 8px;
    background: white;
    color: #2c3e50;
    font-weight: 500;
}

.input-unit {
    color: #6c757d;
    font-weight: 500;
    font-size: 0.8rem;
    background: #f8f9fa;
    padding: 10px 6px;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    min-width: 45px;
    text-align: center;
}

/* File Info Enhanced */
.file-info {
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #e8f5e8, #f0f8f0);
    border-radius: 10px;
    border-left: 4px solid #00b894;
    font-size: 0.9rem;
    color: #2d3436;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 184, 148, 0.1);
}

.file-info strong {
    color: #00b894;
}

/* Button Styles Enhanced */
.form-actions {
    text-align: center;
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#submitBtn {
    background: linear-gradient(135deg, #00b894, #00a085);
    color: white;
    padding: 15px 35px;
    border: none;
    border-radius: 40px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 220px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 184, 148, 0.3);
}

#submitBtn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

#submitBtn:hover::before {
    left: 100%;
}

#submitBtn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 184, 148, 0.4);
}

#submitBtn:active {
    transform: translateY(-1px);
}

#submitBtn:disabled {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 12px rgba(149, 165, 166, 0.3);
}

/* Custom Template Button - Red/Orange Styling */
.custom-submit-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 15px 35px;
    border: none;
    border-radius: 40px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 220px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.3);
}

.custom-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.custom-submit-btn:hover::before {
    left: 100%;
}

.custom-submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(231, 76, 60, 0.4);
}

.custom-submit-btn:active {
    transform: translateY(-1px);
}

.custom-submit-btn:disabled {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 12px rgba(149, 165, 166, 0.3);
}

.loading {
    display: inline-block;
}

/* Success/Error Notifications Enhanced */
.error-notification,
.success-notification {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 12px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.error-notification {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.95), rgba(192, 57, 43, 0.95));
    color: white;
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.3);
    border-left: 4px solid #e74c3c;
}

.success-notification {
    background: linear-gradient(135deg, rgba(0, 184, 148, 0.95), rgba(0, 160, 133, 0.95));
    color: white;
    box-shadow: 0 6px 20px rgba(0, 184, 148, 0.3);
    border-left: 4px solid #00b894;
}

.template-button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    width: auto;
    min-width: 126px;
    font-family: inherit;
}

.template-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.template-button:disabled {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 6px rgba(149, 165, 166, 0.3);
}

/* Template Section Styles */
.template-subtitle {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: normal;
    margin-left: 10px;
}

.template-container {
    position: relative;
}

.template-editor {
    width: 100%;
    min-height: 300px;
    max-height: 80vh;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-family: 'Courier New', Monaco, monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #2c3e50;
    background: white;
    resize: vertical;
    transition: all 0.3s ease;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow-x: auto;
    overflow-y: auto;
    border-color: #00b894;
    box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.1);
}

.template-editor:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.template-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: flex-end;
}

.template-action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.template-action-btn.secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    box-shadow: 0 2px 8px rgba(149, 165, 166, 0.3);
    margin-bottom: 10px;
}

.template-action-btn.secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(149, 165, 166, 0.4);
}

/* Responsive Design Enhanced */
@media (max-width: 1024px) {
    .docs-panel {
        width: 350px;
        left: -350px;
    }

    .main-content.docs-open {
        margin-left: 350px;
    }

    .error-panel {
        width: 350px;
        right: -350px;
    }

    .main-content.error-open {
        margin-right: 350px;
    }

    /* Language switcher adjustment for tablet */
    body.error-panel-open .language-switcher {
        right: 370px;
    }
}

@media (max-width: 768px) {
    .docs-panel {
        width: 100%;
        left: -100%;
    }

    .main-content.docs-open {
        margin-left: 0;
    }

    .error-panel {
        width: 100%;
        right: -100%;
    }

    .main-content.error-open {
        margin-right: 0;
    }

    /* Language switcher stays in original position on mobile since error panel is full width */
    body.error-panel-open .language-switcher {
        right: 20px;
    }

    .container {
        padding: 20px;
        margin: 8px;
    }

    h1 {
        font-size: 2rem;
    }

    .form-group {
        grid-template-columns: auto 1fr 80px 55px;
        gap: 8px;
    }

    .form-group.form-group-with-button {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .form-group.form-group-with-button > .form-select {
        flex: 1 1 150px;
        min-width: 120px;
    }

    .form-group.form-group-with-button > .template-button {
        flex: 1 1 100%;
        width: 100%;
    }

    .form-group.template-button-group {
        grid-template-columns: 1fr;
        justify-items: stretch;
    }

    .form-group.template-button-group .template-button {
        width: 100%;
    }

    input[type="number"], .form-select {
        width: 80px;
        padding: 8px 10px;
    }

    .input-unit {
        min-width: 40px;
        padding: 8px 4px;
        font-size: 0.75rem;
    }

    .upload-area {
        padding: 25px 15px;
    }

    .upload-icon {
        font-size: 2.5rem;
    }

    #submitBtn, .custom-submit-btn {
        width: 100%;
        padding: 15px;
    }

    .form-section {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .form-group {
        grid-template-columns: auto 1fr;
        gap: 8px;
    }

    .form-group.form-group-with-button {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .form-group.form-group-with-button > .form-select {
        flex: 1 1 100%;
        width: 100%;
    }

    .form-group.form-group-with-button > .template-button {
        flex: 1 1 100%;
        width: 100%;
    }

    .form-group > label {
        grid-column: 1 / -1;
    }

    .form-group > input[type="number"],
    .form-group > .form-select {
        width: 100%;
        max-width: none;
    }

    .form-group > .input-unit {
        justify-self: start;
    }

    .form-group.template-button-group {
        grid-template-columns: 1fr;
    }

    .upload-area p {
        font-size: 1rem;
    }

    .browse-button {
        padding: 8px 20px;
        font-size: 0.9rem;
    }
}

/* Animation Classes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

.fade-in {
    animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading Animation Enhanced */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.loading::before {
    content: "⚙️";
    display: inline-block;
    animation: spin 1.5s linear infinite;
    margin-right: 8px;
    font-size: 1.1rem;
}

#submitBtn:disabled, .custom-submit-btn:disabled {
    animation: pulse 2s ease-in-out infinite;
}

/* Hint System Styles */
.hint-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 6px;
    transition: all 0.3s ease;
    user-select: none;
    font-family: Arial, sans-serif;
    flex-shrink: 0;
}

.hint-icon:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.hint-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    pointer-events: none;
}

.hint-popup.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.hint-popup-content {
    background: white;
    border-radius: 15px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideIn 0.3s ease;
    pointer-events: auto;
}

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

.hint-popup-header {
    padding: 20px 20px 0 20px;
    position: relative;
}

.hint-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.hint-popup-close:hover {
    background: #f5f5f5;
    color: #333;
}

.hint-popup-body {
    padding: 15px 25px 25px 25px;
    line-height: 1.6;
    color: #333;
    font-size: 0.95rem;
}

.hint-popup-body p {
    margin-bottom: 12px;
}

.hint-popup-body strong {
    color: #2c3e50;
    font-weight: 600;
}

/* Mobile responsive for hint popup */
@media (max-width: 768px) {
    .hint-popup {
        padding: 10px;
    }
    
    .hint-popup-content {
        max-width: 100%;
        margin: 0;
        border-radius: 10px;
        max-height: 90vh;
    }
    
    .hint-popup-header {
        padding: 15px;
    }
    
    .hint-popup-body {
        padding: 10px 20px 20px 20px;
        font-size: 0.9rem;
    }
}