.config-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding: 1.5rem 0;
}

.config-header h1 {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    margin: 1rem 0 0.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.config-header p {
    color: var(--text-muted);
    margin-bottom: 0;
    font-size: clamp(0.875rem, 2vw, 1rem);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9375rem;
    padding: 0.625rem 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.2s ease;
    font-weight: 500;
    margin-bottom: 1rem;
}

.back-link:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateX(-4px);
}

@media (max-width: 640px) {
    .back-link {
        width: 100%;
        justify-content: center;
    }
}

.config-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .config-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .preview-column {
        order: -1;
    }
}

@media (max-width: 640px) {
    .config-layout {
        gap: 1.5rem;
    }
}

.config-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 1025px) {
    .preview-column {
        position: sticky;
        top: 2rem;
    }
}

.config-container {
    max-width: 900px;
    margin: 0 auto;
}

.config-section {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.75rem;
    margin-bottom: 0;
    transition: all 0.2s ease;
}

.config-section:hover {
    border-color: var(--primary-color);
}

.config-section h2 {
    color: var(--text-color);
    margin-bottom: 0.625rem;
    font-weight: 700;
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.01em;
}

@media (max-width: 640px) {
    .config-section {
        padding: 1.25rem;
    }
}

.section-description {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.platform-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.platform-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.platform-item:hover:not(.disabled) {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.platform-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.platform-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
}

@media (max-width: 640px) {
    .platform-header {
        padding: 0.875rem 1rem;
    }
}

.platform-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.platform-icon-small {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.platform-icon-small svg {
    width: 18px;
    height: 18px;
}

.platform-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color);
}

.platform-badge {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.coming-soon-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--bg-color);
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--success);
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

input:disabled + .toggle-slider {
    cursor: not-allowed;
    opacity: 0.5;
}

.platform-input-container {
    padding: 0 1.25rem 1rem 1.25rem;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 100px;
    }
}

.platform-input-container input {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.platform-input-container input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.1);
}

.config-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.checkbox-label span {
    font-weight: 500;
}

/* API Status */
.api-status-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.api-status-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-success {
    background: var(--success);
    box-shadow: 0 0 8px rgba(35, 165, 89, 0.5);
}

.status-disabled {
    background: var(--border-color);
}

.status-platform {
    font-weight: 600;
    color: var(--text-color);
}

.status-text {
    color: var(--text-muted);
}

/* Copy Button */
.btn-copy {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #00b89c, #00d9a3);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 217, 163, 0.3);
}

.btn-copy:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 217, 163, 0.4);
}

.btn-copy:active {
    transform: translateY(0);
}

/* Preview Section */
.preview-section {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.75rem;
}

.preview-section h2 {
    color: var(--text-color);
    margin-bottom: 0.625rem;
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: -0.01em;
}

.preview-box {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 0;
    height: 500px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

@media (max-width: 640px) {
    .preview-section {
        padding: 1.25rem;
    }
    
    .preview-box {
        height: 400px;
    }
}

#preview-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    display: none;
}

.preview-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
    font-size: 0.9rem;
}

.preview-box::-webkit-scrollbar {
    width: 8px;
}

.preview-box::-webkit-scrollbar-track {
    background: var(--card-bg);
    border-radius: 4px;
}

.preview-box::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.preview-box::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.platform-config {
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.platform-config h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.platform-config label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.platform-config input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.platform-config input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.1);
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.config-item.full-width {
    grid-column: 1 / -1;
}

.config-item > label:first-child {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.color-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.color-input-group input[type="color"] {
    width: 60px;
    height: 40px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    background: var(--bg-color);
    transition: border-color 0.2s ease;
}

.color-input-group input[type="color"]:hover {
    border-color: var(--primary-color);
}

.color-input-group input[type="text"] {
    flex: 1;
    padding: 0.625rem;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-family: 'Courier New', monospace;
    transition: all 0.2s ease;
}

.color-input-group input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.1);
}

.range-input-group {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.range-input-group input[type="range"] {
    flex: 1;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    outline: none;
    transition: background 0.2s ease;
}

.range-input-group input[type="range"]:hover {
    background: var(--primary-color);
    opacity: 0.3;
}

.range-input-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px var(--shadow);
}

.range-input-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.4);
}

.range-input-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px var(--shadow);
}

.range-input-group input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.4);
}

.range-input-group span {
    min-width: 50px;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.9rem;
}

.preview-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    animation: slideIn 0.3s ease;
}

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

.platform-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    flex-shrink: 0;
}

.username {
    font-weight: 700;
    color: var(--accent-color);
}

.message-text {
    color: var(--text-color);
}

.url-container {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.url-container input {
    flex: 1;
    padding: 0.75rem;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.url-container input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.1);
}

.url-container button {
    white-space: nowrap;
}

.url-display-section {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.75rem;
}

.url-display-section label {
    display: block;
    margin-bottom: 0.625rem;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9375rem;
}

.url-display-section textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-color);
    color: var(--text-color);
    font-family: 'Courier New', monospace;
    font-size: 0.8125rem;
    resize: vertical;
    cursor: text;
    transition: all 0.2s ease;
}

.url-display-section textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

@media (max-width: 640px) {
    .url-display-section {
        padding: 1.25rem;
    }
    
    .url-display-section textarea {
        font-size: 0.75rem;
    }
}
}

.instructions h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.instructions ol {
    margin-left: 1.5rem;
    color: var(--text-muted);
    line-height: 1.8;
}

.instructions li {
    margin-bottom: 0.5rem;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 0.5rem;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* Appearance controls styling */
.appearance-controls {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.9375rem;
}

.control-group select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-color);
    font-size: 0.9375rem;
}

.control-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.color-picker-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.color-picker-group input[type="color"] {
    width: 60px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
}

.color-picker-group input[type="text"] {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-color);
    font-family: monospace;
    font-size: 0.9375rem;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--primary-light);
    transform: scale(1.1);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.control-group input[type="range"]::-moz-range-thumb:hover {
    background: var(--primary-light);
    transform: scale(1.1);
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
}

.checkbox-label span {
    font-weight: 500;
    color: var(--text-color);
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .config-grid {
        grid-template-columns: 1fr;
    }
    
    .platform-icon-small {
        width: 28px;
        height: 28px;
    }
    
    .platform-icon-small svg {
        width: 16px;
        height: 16px;
    }
    
    .platform-name {
        font-size: 0.9375rem;
    }
    
    .toggle-switch {
        width: 40px;
        height: 22px;
    }
    
    .toggle-slider:before {
        height: 16px;
        width: 16px;
    }
    
    input:checked + .toggle-slider:before {
        transform: translateX(18px);
    }
}
