 * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

 

        .containerx {
           max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
            width: 90%;
            
        }

        .header {
            text-align: center;
            margin-bottom: 40px;
        }

        .header h1 {
            font-size: 2.5rem;
            font-weight: bold;
            margin-bottom: 10px;
        }

        .header p {
            color: #cbd5e1;
            font-size: 1.1rem;
        }

        .config-panel {
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            border-radius: 12px;
            padding: 24px;
            margin-bottom: 24px;
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        .config-header {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 16px;
        }

        .config-header h2 {
            font-size: 1.25rem;
            font-weight: 600;
        }

        .config-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 16px;
            margin-bottom: 16px;
        }

        .form-group {
            display: flex;
            flex-direction: column;
        }

        .form-group label {
            font-size: 0.875rem;
            font-weight: 500;
            color: #cbd5e1;
            margin-bottom: 8px;
        }

        .form-control {
            padding: 8px 12px;
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 8px;
            color: white;
            font-size: 14px;
        }

        .form-control:focus {
            outline: none;
            border-color: #7c3aed;
            box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.3);
        }

        .form-control::placeholder {
            color: #9ca3af;
        }

        .api-key-group {
            display: flex;
            gap: 8px;
            align-items: end;
        }

        .api-key-input {
            flex: 1;
        }

        .btnx {
            padding: 8px 16px;
            border-radius: 8px;
            font-weight: 500;
            transition: all 0.2s;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            min-width: 100px;
            font-size: 14px;
        }

        .btnx:disabled {
            background: #6b7280 !important;
            cursor: not-allowed;
        }

        .btnx-primary {
            background: #7c3aed;
            color: white;
        }

        .btnx-primary:hover:not(:disabled) {
            background: #6d28d9;
        }

        .btnx-success {
            background: #059669;
            color: white;
        }

        .btnx-success:hover:not(:disabled) {
            background: #047857;
        }

        .btnx-danger {
            background: #dc2626;
            color: white;
        }

        .btnx-danger:hover:not(:disabled) {
            background: #b91c1c;
        }

        .status-text {
            font-size: 0.75rem;
            margin-top: 4px;
        }

        .text-success {
            color: #10b981;
        }

        .text-danger {
            color: #ef4444;
        }

        .text-warning {
            color: #f59e0b;
        }

        .main-grid {
            display: grid;
            grid-template-columns: 2fr 1fr;
            gap: 24px;
        }

        @media (max-width: 1024px) {
            .main-grid {
                grid-template-columns: 1fr;
            }
        }

        .chat-interface {
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            border-radius: 12px;
            border: 1px solid rgba(255, 255, 255, 0.2);
            height: 700px;
            display: flex;
            flex-direction: column;
            

        }

        .chat-header {
            display: flex;
            justify-content: between;
            align-items: center;
            padding: 16px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.2);
            gap: 8px;
        }

        .chat-header h3 {
            font-size: 1.125rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
            flex: 1;
        }

        .chat-content {
            flex: 1;
            overflow-y: auto;
            padding: 16px;
        }

        .message {
            margin-bottom: 16px;
            display: flex;
        }

        .message.user {
            justify-content: flex-end;
        }

        .message.assistant {
            justify-content: flex-start;
        }

        .message-content {
            max-width: 75%;
            padding: 12px;
            border-radius: 8px;
            position: relative;
            white-space: pre-wrap;
        }

        .message.user .message-content {
            background: #7c3aed;
            color: white;
        }

        .message.assistant .message-content {
            background: rgba(255, 255, 255, 0.2);
            color: #f1f5f9;
        }

        .copy-btn {
            position: absolute;
            top: 8px;
            right: 8px;
            background: none;
            border: none;
            color: #cbd5e1;
            cursor: pointer;
            opacity: 0;
            transition: opacity 0.2s;
            padding: 4px;
            border-radius: 4px;
        }

        .message-content:hover .copy-btn {
            opacity: 1;
        }

        .copy-btn:hover {
            background: rgba(255, 255, 255, 0.1);
            color: white;
        }

        .loading-message {
            display: flex;
            justify-content: flex-start;
        }

        .loading-content {
            background: rgba(255, 255, 255, 0.2);
            padding: 12px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .spinner {
            width: 20px;
            height: 20px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-top: 2px solid white;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            0% {
                transform: rotate(0deg);
            }

            100% {
                transform: rotate(360deg);
            }
        }

        .chat-input {
            padding: 16px;
            border-top: 1px solid rgba(255, 255, 255, 0.2);
            display: flex;
            gap: 8px;
        }

        .input-field {
            flex: 1;
            padding: 10px 12px;
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 8px;
            color: white;
            font-size: 14px;
        }

        .input-field:focus {
            outline: none;
            border-color: #7c3aed;
            box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.3);
        }

        .input-field::placeholder {
            color: #9ca3af;
        }

        .images-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 16px;
        }

        .image-card {
            background: rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            padding: 12px;
        }

        .image-card img {
            width: 100%;
            height: 150px;
            object-fit: cover;
            border-radius: 4px;
            margin-bottom: 8px;
        }

        .image-prompt {
            font-size: 0.75rem;
            color: #cbd5e1;
            margin-bottom: 8px;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .download-btn {
            font-size: 0.75rem;
            color: #a78bfa;
            background: none;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .download-btn:hover {
            color: #c4b5fd;
        }

        .sidebar {
            display: flex;
            flex-direction: column;
            gap: 24px;
        }

        .info-card {
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            border-radius: 12px;
            padding: 16px;
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        .info-card h3 {
            font-size: 1.125rem;
            font-weight: 600;
            margin-bottom: 12px;
        }

        .info-item {
            font-size: 0.875rem;
            margin-bottom: 8px;
            color: #cbd5e1;
        }

        .info-item strong {
            color: white;
        }

        .provider-list {
            font-size: 0.75rem;
            color: #cbd5e1;
        }

        .provider-item {
            padding: 4px;
            margin-bottom: 4px;
            border-radius: 4px;
        }

        .provider-item.active {
            background: rgba(124, 58, 237, 0.3);
        }

        .hidden {
            display: none;
        }

        .clear-btn {
            background: none;
            border: none;
            color: #9ca3af;
            cursor: pointer;
            padding: 4px;
            border-radius: 4px;
        }

        .clear-btn:hover {
            color: white;
            background: rgba(255, 255, 255, 0.1);
        }

        .api-key-hint {
            font-size: 0.75rem;
            color: #cbd5e1;
            margin-top: 4px;
            font-style: italic;

        }
      @media (max-width: 420px) {
            .chat-interface {
                margin-right: 15px;
            }

            .info-card {
                
                margin-right: 15px;
            }

            .api-key-group{
                display: block;
            }
             .main-grid {
        grid-template-columns: 1fr; /* full-width single column */
        gap: 16px;
        width: 10%;
    }
    



    .containerx {
        padding: 10px;
        width: 100%;
    }

    .config-grid {
        grid-template-columns: 1fr; /* stack items vertically */
    }

    .main-grid {
        grid-template-columns: 1fr; /* full-width single column */
        gap: 16px;
        width: 80%;
    }

    .chat-interface {
        height: 500px;
        margin: 0;
    }

    .chat-header h3 {
        font-size: 1rem; /* shrink header text */
    }

    .form-control,
    .btnx {
        font-size: 12px;
        padding: 6px 10px;
    }

    .message-content {
        max-width: 100%; /* prevent overflow */
    }

    .info-card {
        margin: 0;
    }
    
}













