/* ============================================
   SUBMIT GAME PAGE - DARK THEME
   ============================================ */

* {
    box-sizing: border-box;
}

.ipsg-page {
    background: #0a0a0b;
    min-height: 100vh;
    padding-top: var(--ip-header-height, 64px); /* Account for fixed site header */
    padding-bottom: 80px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Hero Section */
.ipsg-hero {
    background: linear-gradient(180deg, #151518 0%, #0a0a0b 100%);
    border-bottom: 1px solid rgba(200, 42, 239, 0.1);
    padding: 60px 0;
    margin-bottom: 40px;
}

.ipsg-hero-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
    text-align: center;
}

.ipsg-hero-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(200, 42, 239, 0.2) 0%, rgba(200, 42, 239, 0.05) 100%);
    border: 1px solid rgba(200, 42, 239, 0.3);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.ipsg-hero-icon svg {
    width: 40px;
    height: 40px;
    color: var(--ip-primary);
}

.ipsg-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 12px 0;
    letter-spacing: -0.02em;
}

.ipsg-hero-subtitle {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Container */
.ipsg-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Login Required State */
.ipsg-login-required {
    background: linear-gradient(135deg, rgba(200, 42, 239, 0.1) 0%, rgba(200, 42, 239, 0.02) 100%);
    border: 1px solid rgba(200, 42, 239, 0.2);
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
}

.ipsg-login-icon {
    width: 64px;
    height: 64px;
    background: rgba(200, 42, 239, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.ipsg-login-icon svg {
    width: 32px;
    height: 32px;
    color: var(--ip-primary);
}

.ipsg-login-required h2 {
    font-size: 1.5rem;
    color: #ffffff;
    margin: 0 0 12px 0;
}

.ipsg-login-required p {
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 24px 0;
}

.ipsg-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--ip-primary);
    color: #ffffff;
    padding: 14px 32px;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ipsg-login-btn:hover {
    background: #a020c0;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(200, 42, 239, 0.4);
}

/* Form Styles */
.ipsg-form {
    background: transparent;
}

/* Section Card */
.ipsg-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 24px;
    transition: border-color 0.2s ease;
    overflow: hidden;
}

.ipsg-section:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.ipsg-section:focus-within {
    border-color: rgba(200, 42, 239, 0.3);
}

.ipsg-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ipsg-section-icon {
    width: 40px;
    height: 40px;
    background: rgba(200, 42, 239, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ipsg-section-icon svg {
    width: 20px;
    height: 20px;
    color: var(--ip-primary);
}

.ipsg-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.ipsg-section-subtitle {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 4px 0 0 0;
}

/* Form Fields - FIXED SPACING */
.ipsg-field {
    margin-bottom: 24px;
}

.ipsg-field:last-child {
    margin-bottom: 0;
}

.ipsg-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
}

.ipsg-label .required {
    color: var(--ip-primary);
    margin-left: 4px;
}

.ipsg-input,
.ipsg-select,
.ipsg-textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 1rem;
    color: #ffffff;
    transition: all 0.2s ease;
    outline: none;
}

.ipsg-input::placeholder,
.ipsg-textarea::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.ipsg-input:focus,
.ipsg-select:focus,
.ipsg-textarea:focus {
    border-color: var(--ip-primary);
    background: rgba(200, 42, 239, 0.05);
    box-shadow: 0 0 0 3px rgba(200, 42, 239, 0.1);
}

.ipsg-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 44px;
    cursor: pointer;
}

.ipsg-select option {
    background: #1a1a1d;
    color: #ffffff;
}

.ipsg-textarea {
    resize: vertical;
    min-height: 100px;
}

.ipsg-hint {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.45);
    margin: 8px 0 0 0;
    line-height: 1.5;
}

/* Row Layout - Two Column */
.ipsg-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.ipsg-row:last-child {
    margin-bottom: 0;
}

.ipsg-row .ipsg-field {
    margin-bottom: 0;
}

@media (max-width: 600px) {
    .ipsg-row {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* Pricing Row - Price on left, Monetization on right */
.ipsg-pricing-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 32px;
    align-items: start;
}

.ipsg-pricing-row .ipsg-field {
    margin-bottom: 0;
}

.ipsg-pricing-left {
    min-width: 0;
}

.ipsg-pricing-right {
    min-width: 0;
}

@media (max-width: 700px) {
    .ipsg-pricing-row {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* Checkbox Grid - FIXED ALIGNMENT */
.ipsg-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.ipsg-checkbox-grid.ipsg-checkbox-grid-compact {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

/* Wider grid for items with longer text (accessibility, languages) */
.ipsg-checkbox-grid.ipsg-checkbox-grid-wide {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.ipsg-checkbox {
    position: relative;
    min-width: 0;
}

.ipsg-checkbox input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.ipsg-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    word-break: break-word;
    line-height: 1.4;
}

.ipsg-checkbox-label:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.03);
}

.ipsg-checkbox input:checked + .ipsg-checkbox-label {
    background: rgba(200, 42, 239, 0.15);
    border-color: rgba(200, 42, 239, 0.4);
    color: #ffffff;
}

.ipsg-checkbox-box {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ipsg-checkbox input:checked + .ipsg-checkbox-label .ipsg-checkbox-box {
    background: var(--ip-primary);
    border-color: var(--ip-primary);
}

.ipsg-checkbox-box svg {
    width: 12px;
    height: 12px;
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.ipsg-checkbox input:checked + .ipsg-checkbox-label .ipsg-checkbox-box svg {
    opacity: 1;
}

/* Radio Buttons */
.ipsg-radio .ipsg-checkbox-box {
    border-radius: 50%;
}

.ipsg-radio input:checked + .ipsg-checkbox-label .ipsg-checkbox-box {
    background: transparent;
    border-color: var(--ip-primary);
}

.ipsg-radio input:checked + .ipsg-checkbox-label .ipsg-checkbox-box::after {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--ip-primary);
    border-radius: 50%;
}

/* Autocomplete / Company Search */
.ipsg-autocomplete {
    position: relative;
}

.ipsg-autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a1d;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    margin-top: 4px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.ipsg-autocomplete-results.active {
    display: block;
}

.ipsg-autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ipsg-autocomplete-item:last-child {
    border-bottom: none;
}

.ipsg-autocomplete-item:hover {
    background: rgba(200, 42, 239, 0.1);
}

.ipsg-autocomplete-item.add-new {
    background: rgba(200, 42, 239, 0.1);
    color: var(--ip-primary);
    font-weight: 500;
}

.ipsg-autocomplete-item.add-new:hover {
    background: rgba(200, 42, 239, 0.2);
}

.ipsg-autocomplete-name {
    color: #ffffff;
}

.ipsg-autocomplete-type {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.ipsg-autocomplete-verified {
    color: #22c55e;
    font-size: 0.75rem;
    margin-left: 8px;
}

/* Selected Tags */
.ipsg-selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    min-height: 0;
}

.ipsg-selected-tags:empty {
    display: none;
}

.ipsg-selected-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(200, 42, 239, 0.15);
    border: 1px solid rgba(200, 42, 239, 0.3);
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.875rem;
}

.ipsg-selected-tag.is-new {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
}

.ipsg-selected-tag.is-new::before {
    content: 'NEW';
    font-size: 0.625rem;
    font-weight: 700;
    background: #22c55e;
    color: #000;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 4px;
}

.ipsg-tag-remove {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 0;
    display: flex;
    transition: color 0.15s ease;
}

.ipsg-tag-remove:hover {
    color: #ef4444;
}

/* Store Links Section */
.ipsg-store-links {
    display: none;
}

.ipsg-store-links.active {
    display: block;
}

.ipsg-store-field {
    display: none;
    margin-bottom: 20px;
}

.ipsg-store-field.active {
    display: block;
}

.ipsg-store-field:last-child {
    margin-bottom: 0;
}

/* Collapsible Section */
.ipsg-collapsible {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
}

.ipsg-collapsible-toggle {
    width: 100%;
    background: none;
    border: none;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 500;
    text-align: left;
    transition: background 0.2s ease;
}

.ipsg-collapsible-toggle:hover {
    background: rgba(255, 255, 255, 0.03);
}

.ipsg-collapsible-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.ipsg-collapsible.open .ipsg-collapsible-icon {
    transform: rotate(90deg);
}

.ipsg-collapsible-hint {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.45);
    margin-left: auto;
}

.ipsg-collapsible-content {
    display: none;
    padding: 0 24px 24px;
}

.ipsg-collapsible.open .ipsg-collapsible-content {
    display: block;
}

.ipsg-subsection {
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ipsg-subsection:first-child {
    padding-top: 0;
    border-top: none;
}

.ipsg-subsection-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 16px 0;
}

/* Form Messages */
.ipsg-messages {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: none;
}

.ipsg-messages.success {
    display: block;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.ipsg-messages.error {
    display: block;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.ipsg-messages ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

/* Submit Button */
.ipsg-submit-section {
    background: linear-gradient(135deg, rgba(200, 42, 239, 0.1) 0%, rgba(200, 42, 239, 0.02) 100%);
    border: 1px solid rgba(200, 42, 239, 0.2);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
}

.ipsg-submit-info {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0 0 20px 0;
}

.ipsg-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--ip-primary) 0%, #9b1fd1 100%);
    color: #ffffff;
    border: none;
    padding: 18px 48px;
    border-radius: 12px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.ipsg-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(200, 42, 239, 0.4);
}

.ipsg-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ipsg-submit-btn .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

.ipsg-submit-btn.loading .spinner {
    display: block;
}

.ipsg-submit-btn.loading .btn-text {
    display: none;
}

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

/* Guidelines */
.ipsg-guidelines {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 32px;
}

.ipsg-guidelines-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #60a5fa;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ipsg-guidelines ul {
    margin: 0;
    padding-left: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    line-height: 1.7;
}

.ipsg-guidelines li {
    margin-bottom: 4px;
}

/* Demo Checkbox Toggle */
.ipsg-demo-field {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ipsg-demo-field.active {
    display: block;
}

/* Inline Checkbox */
.ipsg-inline-checkbox {
    display: inline-flex;
}

.ipsg-inline-checkbox .ipsg-checkbox-label {
    padding: 10px 16px;
}

/* Price field specific width */
.ipsg-price-input {
    max-width: 100% !important;
    width: 100%;
}

/* Success Message Styles */
.ipsg-success-content {
    text-align: center;
    padding: 20px 0;
}

.ipsg-success-icon {
    width: 64px;
    height: 64px;
    background: rgba(34, 197, 94, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.ipsg-success-icon svg {
    color: #22c55e;
}

.ipsg-success-text {
    margin-bottom: 24px;
}

.ipsg-success-text strong {
    display: block;
    font-size: 1.25rem;
    color: #22c55e;
    margin-bottom: 8px;
}

.ipsg-success-text p {
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    font-size: 0.9375rem;
}

.ipsg-success-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

/* Button Styles */
.ipsg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.ipsg-btn-primary {
    background: linear-gradient(135deg, var(--ip-primary) 0%, #9b1fd1 100%);
    color: #ffffff;
}

.ipsg-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(200, 42, 239, 0.4);
    color: #ffffff;
}

.ipsg-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ipsg-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.ipsg-btn-ghost {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
}

.ipsg-btn-ghost:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 500px) {
    .ipsg-success-actions {
        flex-direction: column;
    }
    
    .ipsg-btn {
        width: 100%;
    }
}
