/**
 * Game Upload Form Styles - Dark Glass Morphism Theme
 * Matching register-login-system design system
 */

/* Main Form Container */
.cas-game-upload-form {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    background: rgba(55, 65, 81, 0.3);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    color: #e5e7eb;
    font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

/* Form Structure */
.cas-form-group {
    margin-bottom: 2rem;
}

.cas-form-group:last-child {
    margin-bottom: 0;
}

.cas-form-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #00cab6;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
}

.cas-help-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #9ca3af;
    font-style: italic;
}

.cas-help-text.cas-supported-engines {
    margin-top: 5px;
    color: #f39c12;
    font-size: 12px;
    font-style: normal;
}

/* Form Sections */
.cas-form-section {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: rgba(31, 41, 55, 0.3);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

.cas-form-section h3 {
    margin: 0 0 1.5rem 0;
    color: #00cab6;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Form Rows */
.cas-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.cas-form-half {
    margin-bottom: 0;
}

/* Form Controls */
.cas-form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #e5e7eb;
    background-color: rgba(31, 41, 55, 0.5);
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 8px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.cas-form-control::placeholder {
    color: #9ca3af;
}

.cas-form-control:focus {
    outline: none;
    border-color: #00cab6;
    box-shadow: 0 0 0 3px rgba(0, 202, 182, 0.2);
    background-color: rgba(31, 41, 55, 0.7);
}

.cas-form-control:hover {
    border-color: rgba(0, 202, 182, 0.3);
}

/* Markdown Editor */
.cas-markdown-editor {
    border: 2px solid rgba(75, 85, 99, 0.5);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: rgba(31, 41, 55, 0.4);
    backdrop-filter: blur(5px);
}

.cas-markdown-editor:focus-within {
    border-color: #00cab6;
    box-shadow: 0 0 0 3px rgba(0, 202, 182, 0.1);
}

/* Toolbar Styles */
.cas-editor-toolbar {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: rgba(17, 24, 39, 0.7);
    border-bottom: 1px solid rgba(75, 85, 99, 0.3);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cas-toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.cas-font-size-dropdown {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 6px;
    color: #e5e7eb;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    height: 32px;
    min-width: 70px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1rem;
    padding-right: 2rem;
}

.cas-font-size-dropdown:hover {
    background-color: rgba(31, 41, 55, 0.6);
    border-color: rgba(0, 202, 182, 0.3);
    box-shadow: 0 0 0 1px rgba(0, 202, 182, 0.1);
}

.cas-font-size-dropdown:focus {
    outline: none;
    border-color: #00cab6;
    box-shadow: 0 0 0 2px rgba(0, 202, 182, 0.2);
}

.cas-toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 32px;
    height: 32px;
    font-size: 0.75rem;
    font-weight: 600;
}

.cas-toolbar-btn:hover {
    background: rgba(0, 202, 182, 0.1);
    border-color: rgba(0, 202, 182, 0.3);
    color: #00cab6;
    transform: translateY(-1px);
}

.cas-toolbar-btn:active {
    transform: translateY(0);
    background: rgba(0, 202, 182, 0.2);
}

.cas-toolbar-btn.active {
    background: rgba(0, 202, 182, 0.15);
    border-color: rgba(0, 202, 182, 0.4);
    color: #00cab6;
}

.cas-toolbar-btn span {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.025em;
}

.cas-help-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

.cas-toolbar-separator {
    width: 1px;
    height: 24px;
    background: rgba(75, 85, 99, 0.3);
    margin: 0 0.25rem;
}

/* Rich Text Editor */
.cas-editor-content {
    position: relative;
}

.cas-rich-editor {
    min-height: 250px;
    padding: 16px;
    background: rgba(17, 24, 39, 0.4);
    color: #e5e7eb;
    font-size: 14px !important; /* Set default font size */
    line-height: 1.6;
    font-family: ui-sans-serif, system-ui, sans-serif;
    border: none;
    outline: none;
    resize: vertical;
    overflow-y: auto;
    word-wrap: break-word;
}

.cas-rich-editor:empty::before {
    content: attr(data-placeholder);
    color: #6b7280;
    font-style: italic;
    pointer-events: none;
}

.cas-rich-editor.empty::before {
    content: attr(data-placeholder);
    color: #6b7280;
    font-style: italic;
    pointer-events: none;
}

.cas-rich-editor:focus {
    outline: none;
}

/* Rich Text Formatting */
.cas-rich-editor h1 {
    font-size: 1.5em;
    font-weight: 600;
    margin: 0.5em 0;
    color: #00cab6;
}

.cas-rich-editor h2 {
    font-size: 1.3em;
    font-weight: 600;
    margin: 0.5em 0;
    color: #00cab6;
}

.cas-rich-editor h3 {
    font-size: 1.2em;
    font-weight: 600;
    margin: 0.5em 0;
    color: #00cab6;
}

.cas-rich-editor p {
    margin: 0.5em 0;
}

.cas-rich-editor strong,
.cas-rich-editor b {
    font-weight: 600;
    color: #f3f4f6;
}

.cas-rich-editor em {
    font-style: italic;
    color: #d1d5db;
}

.cas-rich-editor u {
    text-decoration: underline;
    color: #d1d5db;
}

.cas-rich-editor s {
    text-decoration: line-through;
    color: #9ca3af;
}

.cas-rich-editor ul {
    margin: 0.5em 0;
    padding-left: 1.5em;
    list-style-type: disc;
    font-size: inherit !important; /* Prevent auto-resize */
}

.cas-rich-editor ol {
    margin: 0.5em 0;
    padding-left: 1.5em;
    list-style-type: decimal;
    font-size: inherit !important; /* Prevent auto-resize */
}

.cas-rich-editor li {
    margin: 0.25em 0;
    font-size: inherit !important; /* Prevent auto-resize */
}

.cas-rich-editor blockquote {
    margin: 0.5em 0;
    padding: 0.5em 1em;
    background: rgba(31, 41, 55, 0.5);
    border-left: 4px solid #00cab6;
    color: #9ca3af;
    font-style: italic;
    font-size: inherit !important; /* Prevent auto-resize */
}

.cas-rich-editor code {
    background: rgba(31, 41, 55, 0.6);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    color: #00cab6;
}

.cas-rich-editor pre {
    background: rgba(31, 41, 55, 0.6);
    padding: 1em;
    border-radius: 6px;
    overflow-x: auto;
    border: 1px solid rgba(75, 85, 99, 0.3);
    margin: 0.5em 0;
}

.cas-rich-editor pre code {
    background: none;
    padding: 0;
    color: #e5e7eb;
}

.cas-rich-editor a {
    color: #00cab6;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.cas-rich-editor a:hover {
    color: #00a896;
}

.cas-rich-editor hr {
    border: none;
    border-top: 1px solid rgba(75, 85, 99, 0.5);
    margin: 1em 0;
}

/* Selection styling */
.cas-rich-editor::selection {
    background: rgba(0, 202, 182, 0.3);
}

.cas-rich-editor *::selection {
    background: rgba(0, 202, 182, 0.3);
}

/* Custom heading styles that don't auto-resize */
.cas-rich-editor .cas-heading {
    font-weight: 600;
    color: #00cab6;
    display: inline-block;
}

.cas-rich-editor .cas-h1 {
    font-weight: 700;
    color: #00cab6;
    text-decoration: underline;
    text-decoration-color: rgba(0, 202, 182, 0.3);
}

.cas-rich-editor .cas-h2 {
    font-weight: 650;
    color: #00cab6;
    border-bottom: 1px solid rgba(0, 202, 182, 0.3);
}

.cas-rich-editor .cas-h3 {
    font-weight: 600;
    color: #00cab6;
    font-style: italic;
}

/* Markdown Preview Content */
.cas-markdown-preview h1,
.cas-markdown-preview h2,
.cas-markdown-preview h3,
.cas-markdown-preview h4,
.cas-markdown-preview h5,
.cas-markdown-preview h6 {
    margin: 1.5em 0 0.5em 0;
    color: #00cab6;
    font-weight: 600;
}

.cas-markdown-preview h1 { font-size: 1.5em; }
.cas-markdown-preview h2 { font-size: 1.3em; }
.cas-markdown-preview h3 { font-size: 1.2em; }

.cas-markdown-preview p {
    margin: 1em 0;
}

.cas-markdown-preview ul,
.cas-markdown-preview ol {
    margin: 1em 0;
    padding-left: 2em;
}

.cas-markdown-preview blockquote {
    margin: 1em 0;
    padding: 0.5em 1em;
    background: rgba(31, 41, 55, 0.5);
    border-left: 4px solid #00cab6;
    color: #9ca3af;
}

.cas-markdown-preview code {
    background: rgba(17, 24, 39, 0.6);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    color: #00cab6;
}

.cas-markdown-preview pre {
    background: rgba(17, 24, 39, 0.6);
    padding: 1em;
    border-radius: 6px;
    overflow-x: auto;
    border: 1px solid rgba(75, 85, 99, 0.3);
}

.cas-markdown-preview pre code {
    background: none;
    padding: 0;
    color: #e5e7eb;
}

/* File Upload Areas */
.cas-file-upload-area {
    position: relative;
    border: 2px dashed rgba(75, 85, 99, 0.5);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease, box-shadow 0.3s ease;
    background: rgba(31, 41, 55, 0.4);
    cursor: pointer;
    backdrop-filter: blur(5px);
}

.cas-file-upload-area:hover {
    border-color: rgba(0, 202, 182, 0.4);
    background: rgba(31, 41, 55, 0.6);
}

.cas-file-upload-area.dragover {
    border-color: #00cab6;
    background: rgba(0, 202, 182, 0.1);
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(0, 202, 182, 0.2);
}

.cas-file-upload-area.has-file {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.cas-file-upload-area.has-file .cas-upload-icon {
    opacity: 0.8;
    color: #10b981;
}

.cas-file-upload-area.has-file p {
    color: #10b981;
}

.cas-file-upload-content {
    pointer-events: none;
}

.cas-upload-icon {
    margin: 0 auto 1rem auto;
    opacity: 0.6;
    transition: all 0.3s ease;
    color: #9ca3af;
}

.cas-file-upload-area p {
    margin: 0.5rem 0;
    color: #d1d5db;
    transition: color 0.3s ease;
}

.cas-file-link {
    color: #00cab6;
    text-decoration: underline;
    font-weight: 500;
}

.cas-file-requirements {
    font-size: 0.875rem;
    color: #9ca3af;
}

.cas-file-input {
    display: none;
}

/* File Info Display */
.cas-file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    color: #10b981;
}

.cas-file-info-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: #10b981;
}

.cas-file-info-details {
    flex: 1;
    min-width: 0;
}

.cas-file-info-name {
    margin: 0;
    font-weight: 500;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cas-file-info-size {
    margin: 0;
    font-size: 0.75rem;
    opacity: 0.8;
}

.cas-file-remove {
    background: none;
    border: none;
    color: #10b981;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cas-file-remove:hover {
    background: rgba(16, 185, 129, 0.2);
    color: #059669;
}

/* Gallery Preview */
.cas-gallery-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.cas-gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid rgba(75, 85, 99, 0.3);
}

.cas-gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cas-gallery-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.cas-gallery-remove:hover {
    background: rgba(220, 38, 38, 0.95);
    transform: scale(1.1);
}

/* Submit Button */
.cas-game-submit-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #00cab6, #008b7a);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.025em;
    margin-top: 1rem;
}

.cas-game-submit-btn:hover {
    background: linear-gradient(135deg, #008b7a, #00675a);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 202, 182, 0.3);
}

.cas-game-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cas-game-submit-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 202, 182, 0.4);
}

.cas-game-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Form Messages */
.cas-form-notice {
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.5;
    border: 1px solid;
}

.cas-form-notice.success {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}

.cas-form-notice.error {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.cas-form-notice.info {
    background-color: rgba(0, 202, 182, 0.1);
    color: #00cab6;
    border-color: rgba(0, 202, 182, 0.3);
}



/* Markdown Help Modal */
.cas-markdown-help-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.cas-markdown-help-content {
    background: rgba(31, 41, 55, 0.95);
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 12px;
    padding: 2rem;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    color: #e5e7eb;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.cas-markdown-help-content h3 {
    margin-top: 0;
    color: #00cab6;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.cas-markdown-help-content code {
    background: rgba(17, 24, 39, 0.6);
    padding: 2px 6px;
    border-radius: 4px;
    color: #00cab6;
    font-size: 0.875rem;
}

.cas-markdown-help-close {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 1rem;
}

.cas-markdown-help-close:hover {
    background: linear-gradient(135deg, #4b5563, #374151);
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .cas-game-upload-form {
        padding: 1.5rem;
        margin: 0 1rem;
        max-width: none;
    }
    
    .cas-form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .cas-form-section {
        padding: 1rem;
    }
    
    .cas-gallery-preview {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.75rem;
    }
    

    
    .cas-markdown-help-content {
        margin: 1rem;
        padding: 1.5rem;
        max-width: none;
    }
    
    /* Responsive Toolbar */
    .cas-editor-toolbar {
        padding: 0.5rem;
        gap: 0.25rem;
    }
    
    .cas-toolbar-group {
        gap: 0.125rem;
    }
    
    .cas-toolbar-btn {
        min-width: 28px;
        height: 28px;
        padding: 0.375rem;
    }
    
    .cas-toolbar-btn span {
        font-size: 0.6rem;
    }
    
    .cas-toolbar-separator {
        height: 20px;
        margin: 0 0.125rem;
    }
    
    /* Stack toolbar groups on very small screens */
    @media (max-width: 480px) {
        .cas-editor-toolbar {
            flex-direction: column;
            align-items: flex-start;
            gap: 0.5rem;
        }
        
        .cas-toolbar-group {
            width: 100%;
            justify-content: flex-start;
        }
        
        .cas-toolbar-separator {
            display: none;
        }
    }
}

/* Loading States */
.cas-form.loading .cas-game-submit-btn {
    position: relative;
    color: transparent;
}

.cas-form.loading .cas-game-submit-btn::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Success and Error Messages */
.cas-game-upload-form .cas-success-message {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(16, 185, 129, 0.15) 100%);
    border: 2px solid #10b981;
    color: #34d399;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.2), 
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    animation: slideInFade 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

.cas-game-upload-form .cas-success-message::before {
    content: "✓";
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: #10b981;
    background: rgba(34, 197, 94, 0.1);
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
}

.cas-game-upload-form .cas-success-message p {
    margin: 0;
    padding-left: 3.5rem;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.6;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.cas-game-upload-form .cas-error-message {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.15) 100%);
    border: 2px solid #ef4444;
    color: #f87171;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    animation: slideInFade 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

.cas-game-upload-form .cas-error-message::before {
    content: "✕";
    position: absolute;
    left: 1.5rem;
    top: calc(1.5rem + 0.8rem - 1.25rem); /* Align icon center with text center: padding + half-line-height - half-icon-height */
    font-size: 1.5rem;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
}

.cas-game-upload-form .cas-error-message p {
    margin: 0;
    padding-left: 3.5rem;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.6;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.cas-game-upload-form .cas-error-message .cas-error-title {
    margin: 0 0 1rem 0;
    font-weight: 600;
    font-size: 1rem;
}

.cas-game-upload-form .cas-error-message .cas-error-list {
    margin: 0;
    padding: 0;
    padding-left: 3.5rem;
    list-style: none;
}

.cas-game-upload-form .cas-error-message .cas-error-list li {
    margin-bottom: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    border-left: 3px solid #ef4444;
}

.cas-game-upload-form .cas-error-message .cas-error-list li:last-child {
    margin-bottom: 0;
}

.cas-game-upload-form .cas-error-message .cas-error-build-name {
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

.cas-game-upload-form .cas-error-message .cas-error-build-error {
    color: #fca5a5;
    display: block;
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Animation for messages */
@keyframes slideInFade {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Glow effect on hover */
.cas-game-upload-form .cas-success-message:hover {
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-color: #34d399;
}

.cas-game-upload-form .cas-error-message:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-color: #f87171;
}

/* Warning Message (for partial failures) */
.cas-game-upload-form .cas-warning-message {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(245, 158, 11, 0.15) 100%);
    border: 2px solid #f59e0b;
    color: #fbbf24;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    animation: slideInFade 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

.cas-game-upload-form .cas-warning-message .cas-warning-title {
    margin: 0 0 1rem 0;
    font-weight: 600;
    font-size: 1rem;
}

.cas-game-upload-form .cas-warning-message .cas-warning-list {
    margin: 0 0 1rem 0;
    padding: 0;
    list-style: none;
}

.cas-game-upload-form .cas-warning-message .cas-warning-list li {
    margin-bottom: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    border-left: 3px solid #f59e0b;
}

.cas-game-upload-form .cas-warning-message .cas-warning-list li:last-child {
    margin-bottom: 0;
}

.cas-game-upload-form .cas-warning-message .cas-warning-build-name {
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

.cas-game-upload-form .cas-warning-message .cas-warning-build-error {
    color: #fcd34d;
    display: block;
    font-size: 0.875rem;
    opacity: 0.9;
}

.cas-game-upload-form .cas-warning-message .cas-warning-hint {
    margin: 0;
    font-size: 0.875rem;
    opacity: 0.85;
}

.cas-game-upload-form .cas-warning-message:hover {
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-color: #fbbf24;
}

/* View Game Button - Pink Style */
.cas-view-game-btn {
    display: block;
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #ec4899, #db2777);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.025em;
    text-decoration: none;
    text-align: center;
    margin-top: 1rem;
}

.cas-view-game-btn:hover {
    background: linear-gradient(135deg, #db2777, #be185d);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(236, 72, 153, 0.3);
    color: white;
    text-decoration: none;
}

.cas-view-game-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cas-view-game-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.4);
}

/* Autosave Recovery Prompt */
.cas-autosave-recovery {
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.15) 100%);
    border: 2px solid #3b82f6;
    border-radius: 12px;
    animation: slideInFade 0.5s ease-out;
}

.cas-autosave-recovery h4 {
    color: #60a5fa;
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.cas-autosave-recovery p {
    color: #cbd5e1;
    margin: 0 0 15px 0;
    line-height: 1.5;
}

.cas-autosave-recovery button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    letter-spacing: 0.025em;
}

.cas-autosave-recovery button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#restore-autosave {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    margin-right: 10px;
}

#restore-autosave:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

#discard-autosave {
    background: linear-gradient(135deg, #64748b, #475569);
    color: white;
}

#discard-autosave:hover {
    background: linear-gradient(135deg, #475569, #334155);
}


/* Upload Progress Bar */
.cas-upload-progress {
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    backdrop-filter: blur(10px);
}

.cas-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.cas-progress-title {
    color: #00cab6;
    font-size: 1rem;
    font-weight: 600;
}

.cas-progress-percentage {
    color: #10b981;
    font-size: 1.2rem;
    font-weight: bold;
}

.cas-progress-bar-wrapper {
    background: rgba(17, 24, 39, 0.6);
    border-radius: 10px;
    height: 24px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.cas-progress-bar {
    background: linear-gradient(90deg, #00cab6 0%, #10b981 100%);
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 202, 182, 0.3);
    overflow: hidden;
}

.cas-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2) 50%,
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.cas-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 0.875rem;
}

.cas-progress-status {
    color: #9ca3af;
}

.cas-progress-size {
    color: #6b7280;
}

/* Removed pulsing animation that might interfere with width updates */

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {
    .cas-game-upload-form {
        background: rgba(31, 41, 55, 0.4);
        border-color: rgba(75, 85, 99, 0.4);
    }
    
    .cas-form-control {
        background-color: rgba(17, 24, 39, 0.6);
    }
    
    .cas-form-control:focus {
        background-color: rgba(17, 24, 39, 0.8);
    }
    
    .cas-file-upload-area {
        background: rgba(17, 24, 39, 0.5);
    }
    
    .cas-markdown-help-content {
        background: rgba(17, 24, 39, 0.95);
    }
    
    /* Enhanced message visibility in dark mode */
    .cas-game-upload-form .cas-success-message {
        background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(16, 185, 129, 0.2) 100%);
        border-color: #34d399;
        color: #6ee7b7;
    }
    
    .cas-game-upload-form .cas-error-message {
        background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.2) 100%);
        border-color: #f87171;
        color: #fca5a5;
    }
}

/* ===========================================
   IMMEDIATE UPLOAD PROGRESS UI
   =========================================== */

.cas-immediate-progress {
    margin-top: 12px;
    padding: 12px 16px;
    background: rgba(31, 41, 55, 0.6);
    border: 1px solid rgba(75, 85, 99, 0.4);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.cas-immediate-progress.uploading {
    border-color: rgba(0, 202, 182, 0.4);
}

.cas-immediate-progress.complete {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.1);
}

.cas-immediate-progress.error {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.1);
}

.cas-immediate-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cas-immediate-progress-filename {
    font-size: 0.875rem;
    font-weight: 500;
    color: #e5e7eb;
    word-break: break-all;
}

.cas-immediate-progress-cancel {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s ease;
}

.cas-immediate-progress-cancel:hover {
    color: #ef4444;
}

.cas-immediate-progress.complete .cas-immediate-progress-cancel:hover {
    color: #f87171;
}

.cas-immediate-progress-bar-container {
    height: 8px;
    background: rgba(75, 85, 99, 0.4);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.cas-immediate-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #00cab6, #10b981);
    border-radius: 4px;
    transition: width 0.15s ease-out;
    width: 0%;
}

.cas-immediate-progress.error .cas-immediate-progress-bar {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.cas-immediate-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.cas-immediate-progress-percent {
    font-weight: 600;
    color: #00cab6;
}

.cas-immediate-progress.complete .cas-immediate-progress-percent {
    color: #10b981;
}

.cas-immediate-progress-size {
    color: #9ca3af;
}

/* Animation for upload in progress */
.cas-immediate-progress.uploading .cas-immediate-progress-bar {
    background: linear-gradient(
        90deg,
        #00cab6 0%,
        #10b981 50%,
        #00cab6 100%
    );
    background-size: 200% 100%;
    animation: progressShimmer 2s ease-in-out infinite;
}

@keyframes progressShimmer {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

/* Multiple uploads stacked */
.cas-immediate-progress + .cas-immediate-progress {
    margin-top: 8px;
}

/* Scanning state */
.cas-immediate-progress.scanning {
    border-color: rgba(14, 165, 233, 0.5);
    background: rgba(14, 165, 233, 0.1);
}

.cas-immediate-progress.scanning .cas-immediate-progress-bar {
    background: linear-gradient(90deg, #0ea5e9, #06b6d4);
}

.cas-immediate-progress.scanning .cas-immediate-progress-percent {
    color: #0ea5e9;
}

/* Scan status section */
.cas-immediate-progress-scan {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(75, 85, 99, 0.3);
    font-size: 0.8rem;
}

.cas-scan-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #9ca3af;
}

/* Scanning spinner */
.cas-scan-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(14, 165, 233, 0.3);
    border-top-color: #0ea5e9;
    border-radius: 50%;
    animation: scanSpin 0.8s linear infinite;
}

@keyframes scanSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Scanning state bar animation - pulsing effect */
.cas-immediate-progress.scanning .cas-immediate-progress-bar {
    animation: scanPulse 1.5s ease-in-out infinite;
}

@keyframes scanPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* Progress UI within downloadable build items */
.new-build-item .cas-immediate-progress {
    margin-top: 10px;
    background: rgba(31, 41, 55, 0.8);
}

/* Hide the file info text when progress UI is showing */
.new-build-item:has(.cas-immediate-progress) .new-build-file-info {
    display: none !important;
} 