/*
 * Steam Manager Visual Customizer CSS
 * Simple and intuitive design for end users
 */

.steam-customizer {
    margin: 20px 20px 0 0;
}

.customizer-layout {
    display: flex;
    gap: 30px;
    margin-top: 20px;
    min-height: 600px;
}

/* Controls Panel */
.customizer-controls {
    flex: 0 0 400px;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    padding: 20px;
    height: fit-content;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.control-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f1;
}

.control-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.control-section h3 {
    margin: 0 0 15px 0;
    color: #1d2327;
    font-size: 16px;
    font-weight: 600;
}

.control-section h4 {
    margin: 0 0 12px 0;
    color: #50575e;
    font-size: 14px;
    font-weight: 500;
}

/* Template Selection Grid */
.template-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.template-option {
    cursor: pointer;
    display: block;
}

.template-option input[type="radio"] {
    display: none;
}

.template-preview {
    text-align: center;
    padding: 12px;
    border: 2px solid #dcdcde;
    border-radius: 6px;
    transition: all 0.2s ease;
    background: #fff;
}

.template-option input[type="radio"]:checked + .template-preview {
    border-color: #0073aa;
    background: #f0f6fc;
    box-shadow: 0 0 0 1px #0073aa;
}

.template-preview:hover {
    border-color: #0073aa;
    transform: translateY(-1px);
}

/* Mini Template Previews */
.mini-card {
    width: 60px;
    height: 40px;
    background: #f6f7f7;
    border-radius: 4px;
    margin: 0 auto 8px;
    position: relative;
    border: 1px solid #dcdcde;
}

.mini-avatar {
    width: 12px;
    height: 12px;
    background: #0073aa;
    border-radius: 50%;
    position: absolute;
    top: 6px;
    left: 6px;
}

.mini-info {
    position: absolute;
    right: 6px;
    top: 4px;
}

.mini-name {
    width: 30px;
    height: 3px;
    background: #50575e;
    margin-bottom: 2px;
}

.mini-details {
    width: 25px;
    height: 2px;
    background: #8c8f94;
}

.mini-badge {
    width: 50px;
    height: 18px;
    background: #f6f7f7;
    border-radius: 10px;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    padding: 2px;
    border: 1px solid #dcdcde;
}

.mini-avatar-small {
    width: 8px;
    height: 8px;
    background: #0073aa;
    border-radius: 50%;
    margin-right: 4px;
}

.mini-name-inline {
    width: 30px;
    height: 2px;
    background: #50575e;
}

.mini-detailed {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 8px;
}

.mini-avatar-large {
    width: 16px;
    height: 16px;
    background: #0073aa;
    border-radius: 50%;
}

.mini-stats {
    width: 30px;
    height: 12px;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 2px;
}

.mini-minimal {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    margin-bottom: 8px;
}

.mini-avatar-tiny {
    width: 8px;
    height: 8px;
    background: #0073aa;
    border-radius: 50%;
}

.mini-name-tiny {
    width: 20px;
    height: 2px;
    background: #50575e;
}

/* Library Templates */
.mini-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    margin-bottom: 8px;
}

.mini-game {
    width: 25px;
    height: 18px;
    background: #0073aa;
    border-radius: 2px;
}

.mini-cards {
    display: flex;
    gap: 3px;
    justify-content: center;
    margin-bottom: 8px;
}

.mini-card-big {
    width: 25px;
    height: 35px;
    background: #0073aa;
    border-radius: 3px;
}

.mini-list {
    margin-bottom: 8px;
}

.mini-list-item {
    width: 55px;
    height: 6px;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    margin-bottom: 2px;
    border-radius: 1px;
}

.mini-tags {
    display: flex;
    gap: 2px;
    justify-content: center;
    margin-bottom: 8px;
}

.mini-tag {
    width: 15px;
    height: 8px;
    background: #0073aa;
    border-radius: 4px;
}

.template-preview span {
    display: block;
    font-size: 12px;
    color: #50575e;
    font-weight: 500;
}

/* Form Controls */
.control-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    color: #1d2327;
}

.control-input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
    outline: none;
}

.size-options,
.layout-options,
.image-type-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.size-options label,
.layout-options label,
.image-type-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #1d2327;
    cursor: pointer;
}

.checkbox-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.checkbox-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #1d2327;
    cursor: pointer;
}

.control-help {
    display: block;
    font-style: italic;
    color: #666;
    font-size: 12px;
    margin-top: 4px;
    line-height: 1.3;
    grid-column: 1 / -1; /* Span full width in grid */
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.form-row label {
    font-size: 14px;
    color: #1d2327;
    font-weight: 500;
}

.small-input {
    width: 80px;
    padding: 6px 8px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
}

/* Action Buttons */
.customizer-actions {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f1;
    display: flex;
    gap: 10px;
}

.customizer-actions .button {
    flex: 1;
    padding: 8px 16px;
    text-align: center;
    white-space: nowrap;
}

/* Preview Panel */
.customizer-preview {
    flex: 1;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.preview-header {
    padding: 20px 20px 15px;
    border-bottom: 1px solid #f0f0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9f9f9;
    border-radius: 8px 8px 0 0;
}

.preview-header h3 {
    margin: 0;
    color: #1d2327;
    font-size: 16px;
    font-weight: 600;
}

.shortcode-output {
    padding: 15px 20px;
    background: #f6f7f7;
    border-bottom: 1px solid #f0f0f1;
}

.shortcode-output code {
    display: block;
    padding: 10px 12px;
    background: #1d2327;
    color: #f0f0f0;
    border-radius: 4px;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
    word-break: break-all;
    user-select: all;
}

.preview-content {
    flex: 1;
    padding: 20px;
    min-height: 400px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

#live-preview {
    width: 100%;
    max-width: 600px;
}

.preview-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #50575e;
    font-size: 14px;
    min-height: 200px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f0f0f1;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.preview-info {
    padding: 20px;
    background: #f9f9f9;
    border-top: 1px solid #f0f0f1;
    border-radius: 0 0 8px 8px;
}

.preview-info p {
    margin: 0 0 10px 0;
    color: #1d2327;
    font-size: 14px;
}

.preview-info ol {
    margin: 0;
    padding-left: 20px;
    color: #50575e;
    font-size: 14px;
}

.preview-info li {
    margin-bottom: 5px;
}

/* Component Controls Toggle */
.component-controls {
    transition: opacity 0.3s ease;
}

/* Copy Button Animation */
@keyframes copied {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.button.copied {
    animation: copied 0.3s ease;
    background-color: #00a32a !important;
    border-color: #00a32a !important;
    color: #fff !important;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .customizer-layout {
        flex-direction: column;
    }
    
    .customizer-controls {
        flex: none;
    }
    
    .template-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 782px) {
    .steam-customizer {
        margin: 10px 10px 0 0;
    }
    
    .customizer-layout {
        gap: 20px;
    }
    
    .customizer-controls,
    .customizer-preview {
        padding: 15px;
    }
    
    .size-options,
    .layout-options {
        flex-direction: column;
        gap: 8px;
    }
    
    .customizer-actions {
        flex-direction: column;
    }
    
    .template-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .checkbox-options {
        grid-template-columns: 1fr;
    }
}

/* Focus States for Accessibility */
.template-option:focus-within .template-preview {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

input[type="radio"]:focus,
input[type="checkbox"]:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Toast Notification System */
.toast-notification {
    position: fixed;
    top: 32px;
    right: 20px;
    z-index: 999999;
    max-width: 400px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.toast-notification.toast-show {
    opacity: 1;
    transform: translateX(0);
}

.toast-content {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.toast-success .toast-content {
    border-left: 4px solid #46b450;
    background: #f7fcf7;
}

.toast-error .toast-content {
    border-left: 4px solid #dc3232;
    background: #fcf7f7;
}

.toast-info .toast-content {
    border-left: 4px solid #0073aa;
    background: #f7fcff;
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    color: #1d2327;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #50575e;
    border-radius: 4px;
}

.toast-close:hover {
    background: rgba(0,0,0,0.1);
    color: #1d2327;
}

/* Custom Modal */
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.custom-modal.modal-show {
    opacity: 1;
    visibility: visible;
}

.custom-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.custom-modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 500px;
    margin: 20px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-show .custom-modal-content {
    transform: scale(1);
}

.custom-modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.custom-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
}

.custom-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #50575e;
    border-radius: 4px;
}

.custom-modal-close:hover {
    background: rgba(0,0,0,0.1);
    color: #1d2327;
}

.custom-modal-body {
    padding: 20px 24px;
}

.custom-modal-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #8c8f94;
    border-radius: 6px;
    font-size: 16px;
    line-height: 1.4;
}

.custom-modal-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.custom-modal-footer {
    padding: 16px 24px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.custom-modal-footer .button {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
}

.button-delete {
    background: #d63638 !important;
    border-color: #d63638 !important;
    color: #fff !important;
}

.button-delete:hover {
    background: #b32d2e !important;
    border-color: #b32d2e !important;
}

.confirm-modal .custom-modal-body p {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
    color: #1d2327;
}

/* Copy Button Animation */
.copied {
    background-color: #46b450 !important;
    border-color: #46b450 !important;
    color: #fff !important;
}

/* Presets Section Styling */
.presets-loading,
.presets-empty {
    padding: 16px;
    text-align: center;
    color: #50575e;
    font-style: italic;
    background: #f8f9fa;
    border: 1px dashed #c3c4c7;
    border-radius: 6px;
}

.presets-empty small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #787c82;
}

.presets-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preset-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.preset-item:hover {
    background: #f0f0f1;
    border-color: #c3c4c7;
}

.preset-info {
    flex: 1;
    min-width: 0;
}

.preset-name {
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 2px;
    word-break: break-word;
}

.preset-details {
    font-size: 12px;
    color: #50575e;
    font-family: 'Courier New', Monaco, monospace;
}

.preset-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.preset-actions .button {
    padding: 4px 8px;
    font-size: 12px;
    min-height: auto;
    line-height: 1.2;
}

.preset-actions .load-preset {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.preset-actions .load-preset:hover {
    background: #005a87;
    border-color: #005a87;
}

.preset-actions .delete-preset {
    background: #d63638;
    color: #fff;
    border-color: #d63638;
}

.preset-actions .delete-preset:hover {
    background: #b32d2e;
    border-color: #b32d2e;
}

/* Responsive adjustments for modals and toasts */
@media (max-width: 782px) {
    .toast-notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .custom-modal-content {
        margin: 10px;
    }
}

/* Single Game View Styles */
.search-results {
    position: absolute;
    z-index: 1000;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 2px;
}

.search-loading,
.no-results {
    padding: 10px 15px;
    color: #50575e;
    font-style: italic;
    text-align: center;
}

.game-suggestion {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f1;
}

.game-suggestion:last-child {
    border-bottom: none;
}

.game-suggestion:hover {
    background: #f6f7f7;
}

.suggestion-details {
    flex: 1;
}

.suggestion-details strong {
    display: block;
    color: #1d2327;
    font-size: 14px;
    margin-bottom: 2px;
}

.suggestion-details small {
    color: #646970;
    font-size: 12px;
}

.selected-game-info {
    margin-top: 10px;
    padding: 15px;
    background: #f6f7f7;
    border-radius: 4px;
    border-left: 4px solid #00a32a;
}

.game-preview {
    display: flex;
    align-items: center;
    gap: 12px;
}

.game-details {
    flex: 1;
}

.game-details strong {
    display: block;
    color: #1d2327;
    font-size: 15px;
    margin-bottom: 4px;
}

.game-details div {
    color: #646970;
    font-size: 13px;
    margin-bottom: 2px;
}

/* Template previews for game view */
.mini-hero {
    width: 60px;
    height: 35px;
    position: relative;
    border-radius: 3px;
    overflow: hidden;
}

.mini-game-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #4c6ef5, #495057);
}

.mini-game-info {
    position: absolute;
    bottom: 2px;
    left: 3px;
    right: 3px;
    height: 8px;
    background: rgba(255,255,255,0.9);
    border-radius: 2px;
}

.mini-game-card {
    width: 60px;
    height: 35px;
    display: flex;
    flex-direction: column;
    border-radius: 3px;
    overflow: hidden;
    background: #f8f9fa;
}

.mini-game-image {
    flex: 1;
    background: linear-gradient(45deg, #6c757d, #495057);
}

.mini-game-details {
    height: 10px;
    background: #fff;
    border-top: 1px solid #dee2e6;
}

.mini-game-detailed {
    width: 60px;
    height: 35px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    display: flex;
    flex-direction: column;
}

.mini-game-header {
    height: 12px;
    background: linear-gradient(90deg, #17a2b8, #6610f2);
    border-radius: 2px 2px 0 0;
}

.mini-game-sections {
    flex: 1;
    background: repeating-linear-gradient(
        transparent,
        transparent 3px,
        #e9ecef 3px,
        #e9ecef 4px
    );
    margin: 2px;
    border-radius: 1px;
}

.mini-game-minimal {
    width: 60px;
    height: 35px;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.mini-game-compact {
    width: 40px;
    height: 6px;
    background: #495057;
    border-radius: 3px;
}

/* Checkbox grid for display sections */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: #f6f7f7;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 13px;
}

.checkbox-grid label:hover {
    background: #e7e8e9;
}

.checkbox-grid input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
}

/* Color scheme grid */
.color-scheme-grid {
    display: flex;
    gap: 10px;
}

.scheme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.scheme-option:hover {
    background: #f6f7f7;
}

.scheme-preview {
    width: 40px;
    height: 25px;
    border-radius: 4px;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.scheme-option input[type="radio"]:checked + .scheme-preview {
    border-color: #0073aa;
}

.scheme-steam {
    background: linear-gradient(135deg, #1b2838 0%, #2a475e 50%, #171a21 100%);
}

.scheme-light {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 50%, #e9ecef 100%);
    border: 1px solid #dee2e6;
}

.scheme-dark {
    background: linear-gradient(135deg, #212529 0%, #343a40 50%, #495057 100%);
}
